powerpc: mpc85xx: Fix NOR booting
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
PATCH 1/2 powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
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.
--- arch/powerpc/dts/u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/dts/u-boot.dtsi +1 -1
@@ -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
Re: [PATCH 1/2] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
Quoted 6 lines · Pali Rohár
Commit
e8c0e0064c8a("powerpc: mpc85xx: FixCONFIG_OF_SEPARATEsupport") 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")Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
Re: [PATCH 1/2] powerpc: mpc85xx: Fix CONFIG_OF_SEPARATE support for NOR booting
Quoted 11 lines · On Monday 23 May 2022 13:57:07 Tom Rini wrote:
Quoted 9 lines · Pali Rohár
Commit
e8c0e0064c8a("powerpc: mpc85xx: FixCONFIG_OF_SEPARATEsupport") 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")Signed-off-by Pali Rohár <[email protected]>Applied to u-boot/master, thanks!
Perfect!!!
PATCH 2/2 powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting
In reply to Pali Rohármpc85xx 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
@@ -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
Re: [PATCH 2/2] powerpc: mpc85xx: Fix CONFIG_OF_EMBED support for NOR booting
Quoted 6 lines · Pali Rohár
mpc85xx NOR binary contains also reset vector and therefore option
CONFIG_MPC85XX_HAVE_RESET_VECTORmust 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_EMBEDdoes not use binman, there is no external DTB andMakefileproduce 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.
Signed-off-by Pali Rohár <[email protected]>
Applied to u-boot/master, thanks!
Signature · 1 line
Tom
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_SEPARATEis broken since my commite8c0e0064c8a("powerpc: mpc85xx: FixCONFIG_OF_SEPARATEsupport") 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_EMBEDseems to be broken for a longer time.This patch series fix it. Tested on P2020 board, both SD and NOR booting with
CONFIG_OF_SEPARATEand also withCONFIG_OF_EMBED.Pali Rohár (2):
powerpc: mpc85xx: FixCONFIG_OF_SEPARATEsupport for NOR booting
powerpc: mpc85xx: FixCONFIG_OF_EMBEDsupport for NOR bootingMakefile | 2 +- arch/powerpc/dts/u-boot.dtsi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Signature · 1 line
2.20.1