flash-image.bin build for MACCHIATObin Single Shot, on Arch Linux x86_64, fails in include/lib/mmio.h.
To re-produce:
- pacman -Sy aarch64-linux-gnu-gcc - currently it's aarch64-linux-gnu-gcc (GCC) 12.2.0.
- export CROSS_COMPILE=aarch64-linux-gnu-
- git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
- Clone the binaries-marvell and mv-ddr-marvell Git repos alongside the trusted-firmware-a, and check out revisions as recommeded in TF-A build instructions for Armada80x0.
- Build u-boot.bin:
- git clone https://source.denx.de/u-boot/u-boot.git alongside the binaries-marvell and mv-ddr-marvell repos.
- cd u-boot
- git checkout v2023.01 - the latest release.
- make mvebu_mcbin-88f8040_defconfig
- Change CONFIG_DEFAULT_DEVICE_TREE to "armada-8040-mcbin-singleshot" (inspired by this SolidRun doc).
- Add arch/arm/dts/armada-8040-mcbin-singleshot.dts. Can be obtained from the latest Marvell kernel sources.
- make, built fine, cool.
- Trying to build TF-A:
- cd ../trusted-firmware-a/
- git checkout v2.8.0 - the latest release, as per changelog.
- make PLAT=a80x0_mcbin MV_DDR_PATH=../mv-ddr-marvell SCP_BL2=../binaries-marvell/mrvl_scp_bl2.img BL33=../u-boot/u-boot.bin mrvl_flash - error:
\nBuilding DRAM driver CC ddr3_training_leveling.c In file included from mv_ddr_atf_wrapper.h:232, from ddr3_init.h:105, from ddr3_training_leveling.c:98: In function 'mmio_read_32', inlined from 'mv_ddr_rl_dqs_burst' at ddr3_training_leveling.c:1980:5: /home/dane/devel/Marvell_Armada_8040_u-boot/trusted-firmware-a/include/lib/mmio.h:46:16: error: array subscript 0 is outside array bounds of 'volatile uint32_t[0]' {aka 'volatile unsigned int[]'} [-Werror=array-bounds] 46 | return *(volatile uint32_t*)addr; | ^~~~~~~~~~~~~~~~~~~~~~~~~ In function 'mmio_read_64', inlined from 'mv_ddr_rl_dqs_burst' at ddr3_training_leveling.c:1978:5: /home/dane/devel/Marvell_Armada_8040_u-boot/trusted-firmware-a/include/lib/mmio.h:56:16: error: array subscript 0 is outside array bounds of 'volatile uint64_t[0]' {aka 'volatile long unsigned int[]'} [-Werror=array-bounds] 56 | return *(volatile uint64_t*)addr; | ^~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[1]: *** [Makefile:473: /home/dane/devel/Marvell_Armada_8040_u-boot/trusted-firmware-a/build/a80x0_mcbin/release/ble/ddr3_training_leveling.o] Error 1 make: *** [plat/marvell/armada/a8k/common/ble/ble.mk:35: /home/dane/devel/Marvell_Armada_8040_u-boot/trusted-firmware-a/build/a80x0_mcbin/release/ble/mv_ddr_lib.a] Error 2
master TF-A branch fails to build as well, with the same error.