Skip to contentSkip to conversation

boston: Pad binary in .mcs to a multiple of 16 bytes

PATCH New Paul Burton 2 participants 2 messages Jan 18, 2018 – Jan 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 boston: Pad binary in .mcs to a multiple of 16 bytes

When flashing U-Boot on a Boston board using Xilinx Vivado tools, the final 0x00 byte which ends the .relocs section seems to be skipped & left in flash as 0xff unless the data contained in the .mcs is padded out to a 16 byte boundary. Without our final zero byte relocation will fail with an error about a spurious reloc:

Avoid this problem by padding out the data in the .mcs file to a 16 byte boundary using srec_cat's -range-pad functionality.

Cc Daniel Schwierzeck <[email protected]>

---

 board/imgtec/boston/config.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
board/imgtec/boston/config.mk +4 -1
index 2775727744..0ba8802da0 100644
@@ -3,7 +3,10 @@
 #
 
 quiet_cmd_srec_cat = SRECCAT $@
-      cmd_srec_cat = srec_cat -output $@ -$2 $< -binary -offset $3
+      cmd_srec_cat = srec_cat -output $@ -$2 \
+			$< -binary \
+			-fill 0x00 -within $< -binary -range-pad 16 \
+			-offset $3
 
 u-boot.mcs: u-boot.bin
 	$(call cmd,srec_cat,intel,0x7c00000)
Signature · 1 line
2.15.1
#1 lore raw

PATCH 1/1 boston: Pad binary in .mcs to a multiple of 16 bytes

Quoted 9 lines · Paul Burton

When flashing U-Boot on a Boston board using Xilinx Vivado tools, the final 0x00 byte which ends the .relocs section seems to be skipped & left in flash as 0xff unless the data contained in the .mcs is padded out to a 16 byte boundary. Without our final zero byte relocation will fail with an error about a spurious reloc:

Avoid this problem by padding out the data in the .mcs file to a 16 byte boundary using srec_cat's -range-pad functionality.

Quoted 8 lines
Cc Daniel Schwierzeck <[email protected]>

---

 board/imgtec/boston/config.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

applied to u-boot-mips, thanks.

Signature · 9 lines
- Daniel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180119/97f24c90/attachment.sig>