Commit 58629b7f37c8d51cec202d69a017c7e390b1fbf0

Authored by Ye Li
Committed by guoyin.chen
1 parent ff3e3deb09

MLK-12296 imx: mx7dsabresd: Change default env for M4 boot to TCM

Since the QSPI needs to rework on this board, at default the QSPI is disabled.
So bind the M4 QSPI boot with QSPI enabled u-boot image, set default
M4 boot to TCM. Need to use TCM m4 image at default.

Additional, on SDB there is only one QSPI flash. Considering the A7 QSPI boot
case, we have to move M4 image to 1M offset to give enough space for u-boot
and env.

Signed-off-by: Ye Li <ye.li@nxp.com>

Showing 1 changed file with 24 additions and 13 deletions Side-by-side Diff

include/configs/mx7dsabresd.h
... ... @@ -125,13 +125,28 @@
125 125 #define CONFIG_LOADADDR 0x80800000
126 126 #define CONFIG_SYS_TEXT_BASE 0x87800000
127 127  
128   -#define CONFIG_SYS_AUXCORE_BOOTDATA 0x60000000 /* Set to QSPI1 A flash at default */
  128 +#ifdef CONFIG_SYS_BOOT_QSPI
  129 +#define CONFIG_SYS_USE_QSPI
  130 +#define CONFIG_ENV_IS_IN_SPI_FLASH
  131 +#elif defined CONFIG_SYS_BOOT_NAND
  132 +#define CONFIG_SYS_USE_NAND
  133 +#define CONFIG_ENV_IS_IN_NAND
  134 +#else
  135 +#define CONFIG_ENV_IS_IN_MMC
  136 +#endif
  137 +
  138 +#ifdef CONFIG_SYS_USE_QSPI
  139 +#define CONFIG_SYS_AUXCORE_BOOTDATA 0x60100000 /* Set to QSPI1 A flash, offset 1M */
  140 +#else
  141 +#define CONFIG_SYS_AUXCORE_BOOTDATA 0x7F8000 /* Set to TCML address */
  142 +#endif
129 143 #define CONFIG_CMD_BOOTAUX /* Boot M4 */
130 144 #define CONFIG_CMD_SETEXPR
131 145  
132 146 #ifdef CONFIG_CMD_BOOTAUX
133 147 #define CONFIG_MXC_RDC /* Enable RDC to isolate the peripherals for A7 and M4 */
134 148  
  149 +#ifdef CONFIG_SYS_USE_QSPI
135 150 #define UPDATE_M4_ENV \
136 151 "m4image=m4_qspi.bin\0" \
137 152 "loadm4image=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4image}\0" \
138 153  
... ... @@ -141,12 +156,18 @@
141 156 "setexpr fw_sz ${filesize} + 0xffff; " \
142 157 "setexpr fw_sz ${fw_sz} / 0x10000; " \
143 158 "setexpr fw_sz ${fw_sz} * 0x10000; " \
144   - "sf erase 0x0 ${fw_sz}; " \
145   - "sf write ${loadaddr} 0x0 ${filesize}; " \
  159 + "sf erase 0x100000 ${fw_sz}; " \
  160 + "sf write ${loadaddr} 0x100000 ${filesize}; " \
146 161 "fi; " \
147 162 "fi\0" \
148 163 "m4boot=sf probe 0:0; bootaux "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)"\0"
149 164 #else
  165 +#define UPDATE_M4_ENV \
  166 + "m4image=m4_qspi.bin\0" \
  167 + "loadm4image=fatload mmc ${mmcdev}:${mmcpart} "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)" ${m4image}\0" \
  168 + "m4boot=run loadm4image; bootaux "__stringify(CONFIG_SYS_AUXCORE_BOOTDATA)"\0"
  169 +#endif
  170 +#else
150 171 #define UPDATE_M4_ENV ""
151 172 #endif
152 173  
... ... @@ -311,16 +332,6 @@
311 332 #define CONFIG_SYS_NO_FLASH
312 333  
313 334 #define CONFIG_ENV_SIZE SZ_8K
314   -
315   -#ifdef CONFIG_SYS_BOOT_QSPI
316   -#define CONFIG_SYS_USE_QSPI
317   -#define CONFIG_ENV_IS_IN_SPI_FLASH
318   -#elif defined CONFIG_SYS_BOOT_NAND
319   -#define CONFIG_SYS_USE_NAND
320   -#define CONFIG_ENV_IS_IN_NAND
321   -#else
322   -#define CONFIG_ENV_IS_IN_MMC
323   -#endif
324 335  
325 336 #ifdef CONFIG_SYS_USE_NAND
326 337 #define CONFIG_CMD_NAND