Skip to contentSkip to conversation

spl, Makefile: Take external offset into account for fit images

PATCH New Sjoerd Simons 2 participants 3 messages Jun 18, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl, Makefile: Take external offset into account for fit images

When building a FIT image for SPL to load also take into account the configured external offset. This allows the SPL to load the u-boot FIT image correctly when configuring SECURE_BOOT on i.mx6 is enabled (with CONFIG_FIT_EXTERNAL_OFFSET=0x3000).

Note this doesn't allow secure booting; but it does allow an unsigned SPL/u-boot with secure boot support eanbled to boot on open device.

---

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index c55ffa265f..a8808aeefd 100644
@@ -1240,6 +1240,7 @@ endif
 ifdef CONFIG_SPL_LOAD_FIT
 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
+	-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST)))
 else
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 spl, Makefile: Take external offset into account for fit images

Quoted 7 lines · Sjoerd Simons

When building a FIT image for SPL to load also take into account the configured external offset. This allows the SPL to load the u-boot FIT image correctly when configuring SECURE_BOOT on i.mx6 is enabled (with CONFIG_FIT_EXTERNAL_OFFSET=0x3000).

Note this doesn't allow secure booting; but it does allow an unsigned SPL/u-boot with secure boot support eanbled to boot on open device.

Does this change behavior on systems which don't use CONFIG_FIT_EXTERNAL_OFFSET ?

Quoted 20 lines

---

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index c55ffa265f..a8808aeefd 100644
@@ -1240,6 +1240,7 @@ endif
 ifdef CONFIG_SPL_LOAD_FIT
 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none -O u-boot \
 	-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
+	-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST)))
 else
Signature · 2 lines
Best regards,
Marek Vasut
#2 lore raw

PATCH 1/1 spl, Makefile: Take external offset into account for fit images

Quoted 8 lines · Marek Vasut
Quoted 7 lines · Sjoerd Simons

When building a FIT image for SPL to load also take into account the
configured external offset. This allows the SPL to load the u-boot FIT
image correctly when configuring SECURE_BOOT on i.mx6 is enabled (with CONFIG_FIT_EXTERNAL_OFFSET=0x3000).

Quoted 6 lines
Quoted 3 lines

Note this doesn't allow secure booting; but it does allow an unsigned
SPL/u-boot with secure boot support eanbled to boot on open device.

Does this change behavior on systems which don't use CONFIG_FIT_EXTERNAL_OFFSET ?

Nope; in that case the default CONFIG_FIT_EXTERNAL_OFFSET is 0x0, which gets essentially ignored if passed as a argument to -p

Quoted 25 lines
Quoted 23 lines

---

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -1
index c55ffa265f..a8808aeefd 100644
@@ -1240,6 +1240,7 @@ endif
 ifdef CONFIG_SPL_LOAD_FIT
 MKIMAGEFLAGS_u-boot.img = -f auto -A $(ARCH) -T firmware -C none
-O u-boot \
 	-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_UBOOT_START) \
+	-p $(CONFIG_FIT_EXTERNAL_OFFSET) \
 	-n "U-Boot $(UBOOTRELEASE) for $(BOARD) board" -E \
 	$(patsubst %,-b arch/$(ARCH)/dts/%.dtb,$(subst

",,$(CONFIG_OF_LIST)))
else

Signature · 2 lines
Sjoerd Simons
Collabora Ltd.