Skip to contentSkip to conversation

config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot

PATCH Superseded Lukasz Majewski 2 participants 2 messages Aug 15, 2024 Arm i.MX and Layerscape

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config: imx: Define CFG_SYS_UBOOT_BASE for Phytec's imx8mm SoM QSPI boot

The image offset when booting from SPI-NOR (QSPI, FSPI driver) is different than one for SD card / eMMC as extra space (0x1000) is consumed by FSPI configuration header (CONFIG_FSPI_CONF_HEADER).

---
 include/configs/phycore_imx8mm.h | 9 +++++++++
 1 file changed, 9 insertions(+)
include/configs/phycore_imx8mm.h +9 -0
index 0910ae2d87..92c30022a8 100644
@@ -11,8 +11,17 @@
 #include <linux/stringify.h>
 #include <asm/arch/imx-regs.h>
 
+#define UBOOT_ITB_OFFSET			0x57C00
+#define FSPI_CONF_BLOCK_SIZE		0x1000
+#define UBOOT_ITB_OFFSET_FSPI  \
+	(UBOOT_ITB_OFFSET + FSPI_CONF_BLOCK_SIZE)
+#ifdef CONFIG_FSPI_CONF_HEADER
+#define CFG_SYS_UBOOT_BASE  \
+	(QSPI0_AMBA_BASE + UBOOT_ITB_OFFSET_FSPI)
+#else
 #define CFG_SYS_UBOOT_BASE \
 		(QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
+#endif
 
 #ifdef CONFIG_SPL_BUILD
 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
Signature · 1 line
2.39.2
reviewer
#1 lore raw

Hi Lukasz,

include/configs/phycore_imx8mm.h line 17

Quoted 4 lines · Lukasz Majewski
include/configs/phycore_imx8mm.h +4 -0
+#define UBOOT_ITB_OFFSET                       0x57C00
+#define FSPI_CONF_BLOCK_SIZE           0x1000
+#define UBOOT_ITB_OFFSET_FSPI  \
+       (UBOOT_ITB_OFFSET + FSPI_CONF_BLOCK_SIZE)

Putting it in a single line helps readability.

include/configs/phycore_imx8mm.h line 20

Quoted 3 lines
include/configs/phycore_imx8mm.h +3 -0
+#ifdef CONFIG_FSPI_CONF_HEADER
+#define CFG_SYS_UBOOT_BASE  \
+       (QSPI0_AMBA_BASE + UBOOT_ITB_OFFSET_FSPI)

Same here.