[PATCH 0/2] 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(-)

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") Signed-off-by: Pali Rohár pali@kernel.org --- arch/powerpc/dts/u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/dts/u-boot.dtsi b/arch/powerpc/dts/u-boot.dtsi index 9661f4dc88d3..67de476a45ed 100644 --- a/arch/powerpc/dts/u-boot.dtsi +++ b/arch/powerpc/dts/u-boot.dtsi @@ -20,7 +20,7 @@
u-boot-dtb-with-ucode { #ifdef CONFIG_MPC85xx - align = <256>; + align = <4>; #endif }; #ifdef CONFIG_MPC85XX_HAVE_RESET_VECTOR

On Mon, May 02, 2022 at 06:36:38PM +0200, Pali Rohár wrote:
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") Signed-off-by: Pali Rohár pali@kernel.org
Applied to u-boot/master, thanks!

On Monday 23 May 2022 13:57:07 Tom Rini wrote:
On Mon, May 02, 2022 at 06:36:38PM +0200, Pali Rohár wrote:
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") Signed-off-by: Pali Rohár pali@kernel.org
Applied to u-boot/master, thanks!
Perfect!!!

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.
Signed-off-by: Pali Rohár pali@kernel.org --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index ad83d60dc39d..631de02b55f2 100644 --- a/Makefile +++ b/Makefile @@ -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}') ; \

On Mon, May 02, 2022 at 06:36:39PM +0200, Pali Rohár wrote:
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.
Signed-off-by: Pali Rohár pali@kernel.org
Applied to u-boot/master, thanks!

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!
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(-)
-- 2.20.1
participants (2)
-
Pali Rohár
-
Tom Rini