@@ -43,6 +43,10 @@ config SUNXI_GEN_SUN6I
watchdog, etc.
+config MACH_SUN50I
+ bool
+ select SUNXI_GEN_SUN6I
+
choice
prompt "Sunxi SoC Variant"
optional
@@ -121,10 +125,16 @@ config MACH_SUN9I
select SUNXI_GEN_SUN6I
select SUPPORT_SPL
-config MACH_SUN50I
+config MACH_SUN50I_64
bool "sun50i (Allwinner A64)"
+ select MACH_SUN50I
select ARM64
- select SUNXI_GEN_SUN6I
+ select SUPPORT_SPL
+
+config MACH_SUN50I_32
+ bool "sun50i (Allwinner A64) SPL-32bit"
+ select MACH_SUN50I
+ select CPU_V7
select SUPPORT_SPL
endchoice
@@ -1,7 +1,7 @@
CONFIG_ARM=y
CONFIG_RESERVE_ALLWINNER_BOOT0_HEADER=y
CONFIG_ARCH_SUNXI=y
-CONFIG_MACH_SUN50I=y
+CONFIG_MACH_SUN50I_64=y
CONFIG_DRAM_CLK=672
CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
new file mode 100644
@@ -0,0 +1,11 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN50I_32=y
+CONFIG_DRAM_CLK=672
+CONFIG_SPL=y
+CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-pine64-plus"
+CONFIG_OF_LIST="sun50i-a64-pine64 sun50i-a64-pine64-plus"
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_MMC_SUNXI_SLOT_EXTRA=2
@@ -182,7 +182,7 @@
#define CONFIG_SPL_FRAMEWORK
-#ifndef CONFIG_MACH_SUN50I
+#ifndef CONFIG_MACH_SUN50I_64
#define CONFIG_SPL_BOARD_LOAD_IMAGE
#endif
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. Signed-off-by: Andre Przywara <andre.przywara@arm.com> --- board/sunxi/Kconfig | 14 ++++++++++++-- configs/pine64_plus_defconfig | 2 +- configs/sun50i_spl32_defconfig | 11 +++++++++++ include/configs/sunxi-common.h | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 configs/sun50i_spl32_defconfig