diff options
author | Jesse Taube | 2024-02-19 18:00:59 -0500 |
---|---|---|
committer | Fabio Estevam | 2024-02-24 16:21:02 -0300 |
commit | 7079eeb72fc36b809a6e9c7417aff3bf19b6d3f1 (patch) | |
tree | 41800b8c6179b311d152f6c8296516a045311bf0 /board | |
parent | bb9d6c7f4f6a598e8856b2e19e58c7de078a0d6e (diff) |
imx: imxrt1050-evk: Add support for SPI flash booting
Add support for booting the imxrt1050-evk from spi.
Add imximage config and the ability for SPL to boot from NOR.
Enable binman in Kconfig and device tree for imxrt* as it is used to
prepend fspi_header.bin to SPL and u-boot.img.
Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/freescale/imxrt1050-evk/MAINTAINERS | 1 | ||||
-rw-r--r-- | board/freescale/imxrt1050-evk/imximage-nor.cfg | 41 | ||||
-rw-r--r-- | board/freescale/imxrt1050-evk/imximage.cfg | 10 | ||||
-rw-r--r-- | board/freescale/imxrt1050-evk/imxrt1050-evk.c | 7 |
4 files changed, 56 insertions, 3 deletions
diff --git a/board/freescale/imxrt1050-evk/MAINTAINERS b/board/freescale/imxrt1050-evk/MAINTAINERS index a8728554525..890825b39ae 100644 --- a/board/freescale/imxrt1050-evk/MAINTAINERS +++ b/board/freescale/imxrt1050-evk/MAINTAINERS @@ -4,3 +4,4 @@ S: Maintained F: board/freescale/imxrt1050-evk F: include/configs/imxrt1050-evk.h F: configs/imxrt1050-evk_defconfig +F: configs/imxrt1050-evk_fspi_defconfig diff --git a/board/freescale/imxrt1050-evk/imximage-nor.cfg b/board/freescale/imxrt1050-evk/imximage-nor.cfg new file mode 100644 index 00000000000..829be6cbe2b --- /dev/null +++ b/board/freescale/imxrt1050-evk/imximage-nor.cfg @@ -0,0 +1,41 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2024 + * Author(s): Jesse Taube <Mr.Bossman075@gmail.com> + */ + +#include <config.h> + +/* image version */ + +IMAGE_VERSION 2 + +/* + * Boot Device : one of + * spi/sd/nand/onenand, qspi/nor + */ + +BOOT_FROM nor + +/* + * Device Configuration Data (DCD) + * + * Each entry must have the format: + * Addr-type Address Value + * + * where: + * Addr-type register length (1,2 or 4 bytes) + * Address absolute address of the register + * value value to be stored in the register + */ + +/* + * 0x400AC044 is used to configure the flexram. + * Unfortunately setting all to OCRAM only works for MMC + * and setting all to DTCM only works for FLEXSPI NOR. + * This configuration fortunately works for both SPI and MMC. +*/ +/* Set first two banks FlexRAM as OCRAM(01b) and the rest to DTCM(10b) */ +DATA 4 0x400AC044 0x55aaaaaa +/* Use FLEXRAM_BANK_CFG to config FlexRAM */ +SET_BIT 4 0x400AC040 0x4 diff --git a/board/freescale/imxrt1050-evk/imximage.cfg b/board/freescale/imxrt1050-evk/imximage.cfg index f1f09fd7ebb..b30d8521947 100644 --- a/board/freescale/imxrt1050-evk/imximage.cfg +++ b/board/freescale/imxrt1050-evk/imximage.cfg @@ -29,7 +29,13 @@ BOOT_FROM sd * value value to be stored in the register */ -/* Set all FlexRAM as OCRAM(01b) */ -DATA 4 0x400AC044 0x55555555 +/* + * 0x400AC044 is used to configure the flexram. + * Unfortunately setting all to OCRAM only works for MMC + * and setting all to DTCM only works for FLEXSPI NOR. + * This configuration fortunately works for both SPI and MMC. +*/ +/* Set first two banks FlexRAM as OCRAM(01b) and the rest to DTCM(10b) */ +DATA 4 0x400AC044 0x55aaaaaa /* Use FLEXRAM_BANK_CFG to config FlexRAM */ SET_BIT 4 0x400AC040 0x4 diff --git a/board/freescale/imxrt1050-evk/imxrt1050-evk.c b/board/freescale/imxrt1050-evk/imxrt1050-evk.c index 4b82ee5e9ce..4cc3defc882 100644 --- a/board/freescale/imxrt1050-evk/imxrt1050-evk.c +++ b/board/freescale/imxrt1050-evk/imxrt1050-evk.c @@ -68,7 +68,12 @@ void spl_board_init(void) u32 spl_boot_device(void) { - return BOOT_DEVICE_MMC1; + /* There is no way to find the boot device so look if there is a valid IVT in RAM for MMC */ + u32 nor_ivt = *(u32 *)(CONFIG_SYS_LOAD_ADDR - 0xC00); + + if (nor_ivt == 0x402000d1) + return BOOT_DEVICE_MMC1; + return BOOT_DEVICE_NOR; } #endif |