diff mbox series

[U-Boot,v2,2/4] arm64: zynqmp: Align u-boot-spl.bin for boot.bin creation

Message ID 9f9f6ebcd85448552b1287feec4c4425a1442295.1547637828.git.michal.simek@xilinx.com
State Accepted
Commit a903dcf7dee787320d7cfee969de322ac7a30ee1
Delegated to: Michal Simek
Headers show
Series [U-Boot,v2,1/4] tools: zynqmpimage: Align image_size/image_stored_size | expand

Commit Message

Michal Simek Jan. 16, 2019, 11:23 a.m. UTC
Bootrom is not capable to work with non align bootloader partition
that's why it is necessary to align it before boot.bin creation.
The patch is creating new spl/u-boot-spl-align.bin which is used only
for boot.bin.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

Changes in v2:
- New patch for solving issue with zynqmpimage.c

 scripts/Makefile.spl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Simon Glass Jan. 16, 2019, 9:34 p.m. UTC | #1
On Wed, 16 Jan 2019 at 04:24, Michal Simek <michal.simek@xilinx.com> wrote:
>
> Bootrom is not capable to work with non align bootloader partition
> that's why it is necessary to align it before boot.bin creation.
> The patch is creating new spl/u-boot-spl-align.bin which is used only
> for boot.bin.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> Changes in v2:
> - New patch for solving issue with zynqmpimage.c
>
>  scripts/Makefile.spl | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Can we use binman for zynq? Also, why not always align?

Reviewed-by: Simon Glass <sjg@chromium.org>
Michal Simek Jan. 17, 2019, 6:45 a.m. UTC | #2
On 16. 01. 19 22:34, Simon Glass wrote:
> On Wed, 16 Jan 2019 at 04:24, Michal Simek <michal.simek@xilinx.com> wrote:
>>
>> Bootrom is not capable to work with non align bootloader partition
>> that's why it is necessary to align it before boot.bin creation.
>> The patch is creating new spl/u-boot-spl-align.bin which is used only
>> for boot.bin.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> Changes in v2:
>> - New patch for solving issue with zynqmpimage.c
>>
>>  scripts/Makefile.spl | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> Can we use binman for zynq? Also, why not always align?

First of all this is for zynqmp/arm64 only. Zynq/arm32 doesn't have this
issue based on my testing.

I wanted to look at binman but didn't have a time.

u-boot-spl.bin is align already but dtbs are not. That's why when DT is
appended we get non aligned u-boot-spl.bin.

I don't know if this is an issue for others but I would say that
aligning of this new generated image make sense even for others.

> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 

Thanks,
Michal
diff mbox series

Patch

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 29626e002555..e5b604e2d269 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -190,7 +190,10 @@  MKIMAGEFLAGS_boot.bin = -T zynqmpimage -R $(srctree)/$(CONFIG_BOOT_INIT_FILE) \
 	-n "$(shell cd $(srctree); readlink -f $(CONFIG_PMUFW_INIT_FILE))"
 endif
 
-spl/boot.bin: $(obj)/u-boot-spl.bin FORCE
+$(obj)/$(SPL_BIN)-align.bin: $(obj)/$(SPL_BIN).bin
+	@dd if=$< of=$@ conv=block,sync bs=4 2>/dev/null;
+
+spl/boot.bin: $(obj)/$(SPL_BIN)-align.bin FORCE
 	$(call if_changed,mkimage)
 endif