Skip to contentSkip to conversation

sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

RFC PATCH New Tuomas Tynkkynen 4 participants 10 messages Mar 6, 2018 – Mar 13, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

For some reason we seem to have documented how to build u-boot-sunxi-with-spl.bin manually with cat but not have a build system rule for it. Let's fix this to have the file built by default just like it is on 32-bit sunxi boards.

Build-tested only.

Tuomas Tynkkynen (2):
ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile
ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

 Makefile                           | 10 ++++++++++
 arch/arm/cpu/armv7/sunxi/config.mk |  6 ------
 board/sunxi/README.sunxi64         |  3 +--
 3 files changed, 11 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
Signature · 1 line
2.16.1
#1 lore raw

RFC PATCH 1/2 ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile

We're going to need this logic for 64-bit builds as well, so move it out from under arch/arm/cpu/armv7.

---
 Makefile                           | 5 +++++
 arch/arm/cpu/armv7/sunxi/config.mk | 6 ------
 2 files changed, 5 insertions(+), 6 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
Makefile +5 -0
index c6819d5742..24a79446d8 100644
@@ -800,6 +800,11 @@ ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
 ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
+# Build a combined spl + u-boot image for sunxi
+ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
+ALL-y += u-boot-sunxi-with-spl.bin
+endif
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
arch/arm/cpu/armv7/sunxi/config.mk deleted +0 -6
deleted file mode 100644
index 76ffec9df6..0000000000
@@ -1,6 +0,0 @@
-# Build a combined spl + u-boot image
-ifdef CONFIG_SPL
-ifndef CONFIG_SPL_BUILD
-ALL-y += u-boot-sunxi-with-spl.bin
-endif
-endif
Signature · 1 line
2.16.1
#2 lore raw

RFC PATCH 1/2 ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile

Hi,

Quoted 4 lines · Tuomas Tynkkynen

We're going to need this logic for 64-bit builds as well, so move it out from under arch/arm/cpu/armv7.

Thanks!
Andre.

Quoted 35 lines
---
 Makefile                           | 5 +++++
 arch/arm/cpu/armv7/sunxi/config.mk | 6 ------
 2 files changed, 5 insertions(+), 6 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
Makefile +5 -0
index c6819d5742..24a79446d8 100644
@@ -800,6 +800,11 @@ ifneq ($(BUILD_ROM)$(CONFIG_BUILD_ROM),)
 ALL-$(CONFIG_X86_RESET_VECTOR) += u-boot.rom
 endif
 
+# Build a combined spl + u-boot image for sunxi
+ifeq ($(CONFIG_ARCH_SUNXI)$(CONFIG_SPL),yy)
+ALL-y += u-boot-sunxi-with-spl.bin
+endif
+
 # enable combined SPL/u-boot/dtb rules for tegra
 ifeq ($(CONFIG_TEGRA)$(CONFIG_SPL),yy)
 ALL-y += u-boot-tegra.bin u-boot-nodtb-tegra.bin
arch/arm/cpu/armv7/sunxi/config.mk deleted +0 -6
deleted file mode 100644
index 76ffec9df6..0000000000
@@ -1,6 +0,0 @@
-# Build a combined spl + u-boot image
-ifdef CONFIG_SPL
-ifndef CONFIG_SPL_BUILD
-ALL-y += u-boot-sunxi-with-spl.bin
-endif
-endif
#4 lore raw

RFC PATCH 2/2 ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

In reply to Tuomas Tynkkynen

In README.sunxi64 we tell the user how to optionally create u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the build system create the file automatically just like it does for 32-bit sunxi boards.

---
 Makefile                   | 5 +++++
 board/sunxi/README.sunxi64 | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile +5 -0
index 24a79446d8..4b203a0155 100644
@@ -1191,8 +1191,13 @@ u-boot-x86-16bit.bin: u-boot FORCE
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
+ifeq ($(CONFIG_ARM64),)
 u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
 	$(call if_changed,binman)
+else
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
+	$(call if_changed,cat)
+endif
 endif
 
 ifneq ($(CONFIG_TEGRA),)
board/sunxi/README.sunxi64 +1 -2
index c492f749b8..5a363d27b8 100644
@@ -95,9 +95,8 @@ Transfer the SPL and the U-Boot FIT image directly to an uSD card:
 (replace /dev/sdx with you SD card device file name, which could be
 /dev/mmcblk[x] as well).
 
-Alternatively you can concatenate the SPL and the U-Boot FIT image into a
+Alternatively you can use the SPL and the U-Boot FIT image combined into a
 single file and transfer that instead:
-$ cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
 # dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=8k seek=1
 
 You can partition the microSD card, but leave the first MB unallocated (most
Signature · 1 line
2.16.1
#5 lore raw

RFC PATCH 2/2 ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

Hi,

Quoted 6 lines · Tuomas Tynkkynen

In README.sunxi64 we tell the user how to optionally create u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the build system create the file automatically just like it does for 32-bit sunxi boards.

Cheers,
Andre.

Quoted 39 lines
---
 Makefile                   | 5 +++++
 board/sunxi/README.sunxi64 | 3 +--
 2 files changed, 6 insertions(+), 2 deletions(-)
Makefile +5 -0
index 24a79446d8..4b203a0155 100644
@@ -1191,8 +1191,13 @@ u-boot-x86-16bit.bin: u-boot FORCE
 endif
 
 ifneq ($(CONFIG_ARCH_SUNXI),)
+ifeq ($(CONFIG_ARM64),)
 u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE
 	$(call if_changed,binman)
+else
+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.itb FORCE
+	$(call if_changed,cat)
+endif
 endif
 
 ifneq ($(CONFIG_TEGRA),)
board/sunxi/README.sunxi64 +1 -2
index c492f749b8..5a363d27b8 100644
@@ -95,9 +95,8 @@ Transfer the SPL and the U-Boot FIT image directly to an uSD card:
 (replace /dev/sdx with you SD card device file name, which could be
 /dev/mmcblk[x] as well).
 
-Alternatively you can concatenate the SPL and the U-Boot FIT image into a
+Alternatively you can use the SPL and the U-Boot FIT image combined into a
 single file and transfer that instead:
-$ cat spl/sunxi-spl.bin u-boot.itb > u-boot-sunxi-with-spl.bin
 # dd if=u-boot-sunxi-with-spl.bin of=/dev/sdx bs=8k seek=1
 
 You can partition the microSD card, but leave the first MB unallocated (most
#6 lore raw

RFC PATCH 2/2 ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

Quoted 11 lines · André Przywara

Hi,

Quoted 6 lines · Tuomas Tynkkynen

In README.sunxi64 we tell the user how to optionally create u-boot-sunxi-with-spl.bin by manually running cat. Instead, have the build system create the file automatically just like it does for 32-bit sunxi boards.

#7 lore raw

cover sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

In reply to Tuomas Tynkkynen

Hi,

Quoted 4 lines · Tuomas Tynkkynen

For some reason we seem to have documented how to build u-boot-sunxi-with-spl.bin manually with cat but not have a build system rule for it. Let's fix this to have the file built by default just like it is on 32-bit sunxi boards.

Ah, thanks a lot! Admittedly I was just too lazy to find out how this works for the 32-bit boards, and how to pull this into the 64 bit builds as well.

Quoted 1 line

Build-tested only.

I actually booted from an SD card and it works like a charm! So thanks again for pulling this together.

Cheers,
Andre.

Quoted 11 lines

Tuomas Tynkkynen (2):
ARM: sunxi: Move u-boot-sunxi-with-spl.bin rule to Makefile
ARM: sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

 Makefile                           | 10 ++++++++++
 arch/arm/cpu/armv7/sunxi/config.mk |  6 ------
 board/sunxi/README.sunxi64         |  3 +--
 3 files changed, 11 insertions(+), 8 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/sunxi/config.mk
#8 lore raw

cover sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

In reply to Tuomas Tynkkynen
Quoted 6 lines · Tuomas Tynkkynen

For some reason we seem to have documented how to build u-boot-sunxi-with-spl.bin manually with cat but not have a build system rule for it. Let's fix this to have the file built by default just like it is on 32-bit sunxi boards.

Build-tested only.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180307/77808c79/attachment.sig>
#9 lore raw

cover sunxi: Build u-boot-sunxi-with-spl.bin on ARM64 as well

Quoted 9 lines · Maxime Ripard
Quoted 6 lines · Tuomas Tynkkynen

For some reason we seem to have documented how to build u-boot-sunxi-with-spl.bin manually with cat but not have a build system rule for it. Let's fix this to have the file built by default just like it is on 32-bit sunxi boards.

Build-tested only.

Applied to u-boot-sunxi/master