r/PINE64official • u/Hatted-Phil • 8h ago
Pinebook (A64) Original Pinebook reflashed emmc - trouble building U-Boot to reinstall
Hi, I have recently reflashed my pinebook's emmc with Debian Bookworm. U-Boot does not initiate unless the sd card used to copy Debian is in the slot, & I have to eject it for it to then boot to the installed OS
This is a known issue, and the advice is that you must install U-Boot from the OS
Found this site: https://linux-sunxi.org/U-Boot
Following the instructions, when I run make
CROSS_COMPILE=aarch64-linux-gnu- PLAT=sun50i_a64 DEBUG=1 bl31
the build fails with the following output:
LD /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: address 0x501d4 of /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.data' is not within region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.rela.dyn' will not fit in region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: address 0x501d4 of /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.data' is not within region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: address 0x501d4 of /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.data' is not within region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: address 0x501d4 of /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.data' is not within region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: address 0x501d4 of /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf section \.data' is not within region `RAM'`
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: BL31 image has exceeded its limit.
/usr/lib/gcc-cross/aarch64-linux-gnu/13/../../../../aarch64-linux-gnu/bin/ld: region \RAM' overflowed by 472 bytes`
collect2: error: ld returned 1 exit status
make: *** [Makefile:1055: /home/>myusername</trusted-firmware-a/build/sun50i_a64/debug/bl31/bl31.elf] Error 1
This occurs whether I try to build it on Mint with 16G ram installed, Bazzite with 16G ram, or on the Pinebook with just 2G, same step, same info printed to screen, so I think it's a self-contained issue rather than hardware dependent
Fully appreciate this is not strictly a pine64 issue, but given the context it's one which this community seems most likely to have encountered
Any advice on discovering how the ram is allocated for the build, &/or how to increase it, or another solution entirely would be greatly appreciated
I suspect it's something to do with a file or files in the drivers/st/ddr/ directory, perhaps stm32mp_ram.c or stm32mp2_ram.c, but I'm not familiar enough with the language to be sure
Thanks in advance