diff mbox series

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

Message ID 20220502163639.10773-3-pali@kernel.org
State Accepted
Commit 827a232623e9b00e7d1b4b62b46e803d7168bbf5
Delegated to: Priyanka Jain
Headers show
Series powerpc: mpc85xx: Fix NOR booting | expand

Commit Message

Pali Rohár May 2, 2022, 4:36 p.m. UTC
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(-)

Comments

Tom Rini May 23, 2022, 5:57 p.m. UTC | #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!
diff mbox series

Patch

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}') ; \