Commit 1f3aebcd52850235a29065c6a1d364907c5f9c80

Authored by Ye Li
1 parent cb72301d65

MLK-23820 imx8mq/mm: Add config to support secondary image boot

When primary image boot is failed, ROM will select secondary image to
boot if SIT (secondary image table) exists. However, SPL does not know
the secondary boot, still loads the FIT from the position of primary image.

Introduce a config to add secondary image sector offset to FIT sector
offset. This config is default set to 0. Secondary image should configure
it to the same value of firstSectorNumber field in SIT.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 665972355dfe8156b3aa7bce52845722b15d9922)

Showing 5 changed files with 13 additions and 4 deletions Side-by-side Diff

arch/arm/mach-imx/imx8m/Kconfig
... ... @@ -27,6 +27,15 @@
27 27 config SYS_SOC
28 28 default "imx8m"
29 29  
  30 +config SECONDARY_BOOT_SECTOR_OFFSET
  31 + hex "SD/MMC sector offset used for ROM secondary boot"
  32 + default 0x0
  33 + depends on IMX8MQ || IMX8MM
  34 + help
  35 + Set the sector offset to non-zero value in SPL used for
  36 + secondary boot image. This value should be same as the
  37 + firstSectorNumber in secondary image table.
  38 +
30 39 config SECURE_STICKY_BITS_LOCKUP
31 40 bool "Enable workaround to fix sticky bits lock up issue"
32 41 depends on IMX8MQ && IMX_HAB
include/configs/imx8mm_evk.h
... ... @@ -13,7 +13,7 @@
13 13 #define CONFIG_SPL_MAX_SIZE (148 * 1024)
14 14 #define CONFIG_SYS_MONITOR_LEN SZ_512K
15 15 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
16   -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
  16 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (0x300 + CONFIG_SECONDARY_BOOT_SECTOR_OFFSET)
17 17 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
18 18 #define CONFIG_SYS_UBOOT_BASE \
19 19 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
include/configs/imx8mm_val.h
... ... @@ -14,7 +14,7 @@
14 14 #define CONFIG_SPL_MAX_SIZE (148 * 1024)
15 15 #define CONFIG_SYS_MONITOR_LEN SZ_512K
16 16 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
17   -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
  17 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (0x300 + CONFIG_SECONDARY_BOOT_SECTOR_OFFSET)
18 18 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
19 19 #define CONFIG_SYS_UBOOT_BASE \
20 20 (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)
include/configs/imx8mq_evk.h
... ... @@ -13,7 +13,7 @@
13 13 #define CONFIG_SPL_MAX_SIZE (148 * 1024)
14 14 #define CONFIG_SYS_MONITOR_LEN (512 * 1024)
15 15 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
16   -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
  16 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (0x300 + CONFIG_SECONDARY_BOOT_SECTOR_OFFSET)
17 17 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
18 18  
19 19 #ifdef CONFIG_SPL_BUILD
include/configs/imx8mq_val.h
... ... @@ -14,7 +14,7 @@
14 14 #define CONFIG_SPL_MAX_SIZE (148 * 1024)
15 15 #define CONFIG_SYS_MONITOR_LEN (512 * 1024)
16 16 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR
17   -#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300
  17 +#define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR (0x300 + CONFIG_SECONDARY_BOOT_SECTOR_OFFSET)
18 18 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION 1
19 19  
20 20 #ifdef CONFIG_SPL_BUILD