Skip to contentSkip to conversation

powerpc: mpc85xx: Fix NOR booting

PATCH In review Pali Rohár 2 participants 7 messages May 2, 2022 – May 23, 2022

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

cover powerpc: mpc85xx: Fix NOR booting

NOR version of U-Boot for mpc85xx is currently broken.

NOR booting with CONFIG_OF_SEPARATE is broken since my commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support") which was merged into master few days ago and was fixing SD card booting.

NOR booting with CONFIG_OF_EMBED seems to be broken for a longer time.

This patch series fix it. Tested on P2020 board, both SD and NOR booting with CONFIG_OF_SEPARATE and also with CONFIG_OF_EMBED.

Pali Rohár (2):
powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting

 Makefile                     | 2 +-
 arch/powerpc/dts/u-boot.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#4 lore raw

PATCH 2/2 powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting

mpc85xx NOR binary contains also reset vector and therefore option CONFIG_MPC85XX_HAVE_RESET_VECTOR must be defined.

When build system uses binman, it takes care of constructing final image which consist of u-boot-without-reset-vector, DTB and reset-vector.

CONFIG_OF_EMBED does not use binman, there is no external DTB and Makefile produce directly final u-boot.bin binary.

So in this case mpc85xx reset vector must not be stripped from the final u-boot.bin binary. Fix it.

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index ad83d60dc39d..631de02b55f2 100644
@@ -1249,7 +1249,7 @@ spl/u-boot-spl.srec: spl/u-boot-spl FORCE
 
 OBJCOPYFLAGS_u-boot-nodtb.bin := -O binary \
 		$(if $(CONFIG_X86_16BIT_INIT),-R .start16 -R .resetvec) \
-		$(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),-R .bootpg -R .resetvec)
+		$(if $(CONFIG_MPC85XX_HAVE_RESET_VECTOR),$(if $(CONFIG_OF_EMBED),,-R .bootpg -R .resetvec))
 
 binary_size_check: u-boot-nodtb.bin FORCE
 	@file_size=$(shell wc -c u-boot-nodtb.bin | awk '{print $$1}') ; \
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting

In reply to Pali Rohár

Commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support") fixed SD card booting on mpc85xx boards but broke NOR booting on these boards. Reason is that U-Boot build system for NOR images uses binman and this binman ignores alignment defined in linker script. Instead it has own config file where is alignment defined.

Fix binman alignment for mpc85xx boards to match what is _now_ defined in linker script.

This change fixes building of U-Boot for NOR booting on P2020 board.

Fixes e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support")
---
 arch/powerpc/dts/u-boot.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/dts/u-boot.dtsi +1 -1
index 9661f4dc88d3..67de476a45ed 100644
@@ -20,7 +20,7 @@
 
 		u-boot-dtb-with-ucode {
 #ifdef CONFIG_MPC85xx
-			align = <256>;
+			align = <4>;
 #endif
 		};
 #ifdef CONFIG_MPC85XX_HAVE_RESET_VECTOR
Signature · 1 line
2.20.1
#6 lore raw
In reply to Pali Rohár
Quoted 5 lines · On Monday 02 May 2022 18:36:37 Pali Rohár wrote:

NOR version of U-Boot for mpc85xx is currently broken.

NOR booting with CONFIG_OF_SEPARATE is broken since my commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support") which was merged into master few days ago and was fixing SD card booting.

PING. v2022.07-rc2 was already released with with above commit!

Quoted 16 lines

NOR booting with CONFIG_OF_EMBED seems to be broken for a longer time.

This patch series fix it. Tested on P2020 board, both SD and NOR booting with CONFIG_OF_SEPARATE and also with CONFIG_OF_EMBED.

Pali Rohár (2):
powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting

 Makefile                     | 2 +-
 arch/powerpc/dts/u-boot.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH 1/2] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting

In reply to Pali Rohár
Quoted 6 lines · Pali Rohár

Commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support") fixed SD card booting on mpc85xx boards but broke NOR booting on these boards. Reason is that U-Boot build system for NOR images uses binman and this binman ignores alignment defined in linker script. Instead it has own config file where is alignment defined.

Quoted 7 lines

Fix binman alignment for mpc85xx boards to match what is _now_ defined in linker script.

This change fixes building of U-Boot for NOR booting on P2020 board.

Fixes e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH 2/2] powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting

In reply to Pali Rohár
Quoted 6 lines · Pali Rohár

mpc85xx NOR binary contains also reset vector and therefore option CONFIG_MPC85XX_HAVE_RESET_VECTOR must be defined.

When build system uses binman, it takes care of constructing final image which consist of u-boot-without-reset-vector, DTB and reset-vector.

Quoted 7 lines

CONFIG_OF_EMBED does not use binman, there is no external DTB and Makefile produce directly final u-boot.bin binary.

So in this case mpc85xx reset vector must not be stripped from the final u-boot.bin binary. Fix it.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom
#3 lore raw

Re: [PATCH 1/2] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting

In reply to Tom Rini
Quoted 11 lines · On Monday 23 May 2022 13:57:07 Tom Rini wrote:
Quoted 9 lines · Pali Rohár

Commit e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support") fixed SD card booting on mpc85xx boards but broke NOR booting on these boards. Reason is that U-Boot build system for NOR images uses binman and this binman ignores alignment defined in linker script. Instead it has own config file where is alignment defined.

Fix binman alignment for mpc85xx boards to match what is _now_ defined in linker script.

Quoted 6 lines
Quoted 4 lines

This change fixes building of U-Boot for NOR booting on P2020 board.

Fixes e8c0e0064c8a ("powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support")

Applied to u-boot/master, thanks!

Perfect!!!