
On 05/12/16 06:26, Simon Glass wrote:
Hi Andre,
On 4 December 2016 at 18:52, Andre Przywara andre.przywara@arm.com wrote:
When compiling the SPL for the Allwinner A64 in AArch64 mode, we can't use the more compact Thumb2 encoding, which only exists for AArch32 code. This makes the SPL rather big, up to a point where any code additions or even a different compiler may easily exceed the 32KB limit that the Allwinner BROM imposes. Introduce a separate, mostly generic sun50i-a64 configuration, which defines the CPU_V7 symbol and thus will create a 32-bit binary using the memory-saving Thumb2 encoding. This should only be used for the SPL, the U-Boot proper should still be using the existing 64-bit configuration. The SPL code can switch to AArch64 if needed, so a 32-bit SPL can be combined with a 64-bit U-Boot proper to eventually launch arm64 kernels.
So if I understand correctly, you want SPL to be 32-bit and U-Boot proper to be 64-bit?
Yes, that is _one_ possible option, mostly driven by size constraints and due to AArch64 code being much bigger than Thumb2.
And you are adding a new board config for that?
Yes, for now this one (separate) defconfig aims to cover all A64 boards. This is not ideal (as Maxime pointed out already), so if you know a nice way of using a single defconfig for one board and configuring it once with CPU_V7 and then again with ARM64 set, I am all ears.
Also I haven't found a make target to just build the SPL (possibly another one for just the U-Boot proper). Maybe this would help things?
Instead, can you do something similar to tegra, which uses ARMv4t for SPL and ARMv7 for U-Boot proper?
You will need two different (cross-)compilers, so just setting some compiler options will not help. Besides compiling the SPL as 32-bit is only an option, the SPL also works as a pure 64-bit binary. And people expressed the wish of having the option of using both ways - at least for the time being.
Cheers, Andre.
Signed-off-by: Andre Przywara andre.przywara@arm.com
board/sunxi/Kconfig | 14 ++++++++++++-- configs/pine64_plus_defconfig | 2 +- configs/sun50i_spl32_defconfig | 10 ++++++++++ include/configs/sunxi-common.h | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 configs/sun50i_spl32_defconfig
Regards, Simon