Skip to contentSkip to conversation

arm: mx6: specify SPL padding

PATCH New Stefan Agner 2 participants 2 messages Nov 15, 2016 – Nov 29, 2016 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: mx6: specify SPL padding

From: Stefan Agner <[email protected]>

Specify standard padding for payload to 68KB. This is derived from the maximum header size plus maximum SPL size. It matches the already defined offset for SD/eMMC devices (69KB) too. This allows to use the u-boot-with-spl.imx build target to generate a directly flashable image which can be flashed using:

dd if=u-boot-with-spl.imx of=/dev/mmcblk0 bs=512 skip=2

While the patch has been created with SD/eMMC in mind, this also works with other boot media. The board file needs to configure the media specific (absolute) payload offset accordingly. Especially the IVT offset is boot media specific and can be retrieved from the reference manual (Table 8-25. Image Vector Table Offset and Initial Load Region Size). For NAND boot a define like this should do the job:

#define CONFIG_SYS_NAND_U_BOOT_OFFS (SPL_PAD_TO + 0x400)

---

Changes in v2:
- Move outside of MMC support guarded zone
- Update comments and commit message to be more clear about implications for different boot media types

 include/configs/imx6_spl.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/configs/imx6_spl.h +6 -0
index 76d1ca0..c0af2bc 100644
@@ -29,6 +29,12 @@
 #define CONFIG_SPL_TEXT_BASE		0x00908000
 #define CONFIG_SPL_MAX_SIZE		0x10000
 #define CONFIG_SPL_STACK		0x0091FFB8
+/*
+ * Pad SPL to 68KB (4KB header + 64KB max size). This allows to write the
+ * SPL/U-Boot combination generated with u-boot-with-spl.imx directly to a
+ * boot media (given that boot media specific offset is configured properly).
+ */
+#define CONFIG_SPL_PAD_TO		0x11000
 
 /* NAND support */
 #if defined(CONFIG_SPL_NAND_SUPPORT)
Signature · 1 line
2.10.2
#1 lore raw

PATCH v2 1/1 arm: mx6: specify SPL padding

Quoted 18 lines · Stefan Agner

From: Stefan Agner <[email protected]>

Specify standard padding for payload to 68KB. This is derived from the maximum header size plus maximum SPL size. It matches the already defined offset for SD/eMMC devices (69KB) too. This allows to use the u-boot-with-spl.imx build target to generate a directly flashable image which can be flashed using:

dd if=u-boot-with-spl.imx of=/dev/mmcblk0 bs=512 skip=2

While the patch has been created with SD/eMMC in mind, this also works with other boot media. The board file needs to configure the media specific (absolute) payload offset accordingly. Especially the IVT offset is boot media specific and can be retrieved from the reference manual (Table 8-25. Image Vector Table Offset and Initial Load Region Size). For NAND boot a define like this should do the job:

Quoted 5 lines

#define CONFIG_SYS_NAND_U_BOOT_OFFS (SPL_PAD_TO + 0x400)

---

Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================