Skip to content

Commit e22ea3c

Browse files
committed
targets:MIMXRT1050: Add QSPI Flash boot support
NXP MIMXRT1050 EVK can support Hyper Flash or QSPI Flash with small hardware reworks. Modify the XIP file to support boot from the two kinds of Flash device. The Hyper Flash should be the default device and defined in tartgets.json with the macro "HYPERFLASH_BOOT". To select the QSPI Flash, just remove the macro with the below line in any overriding json file. "target.macros_remove" : ["HYPERFLASH_BOOT"] Signed-off-by: Gavin Liu <[email protected]>
1 parent 8392613 commit e22ea3c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/xip/evkbimxrt1050_flexspi_nor_config.c

+29
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ __attribute__((section(".boot_hdr.conf"), used))
2222
#pragma location = ".boot_hdr.conf"
2323
#endif
2424

25+
#ifdef HYPERFLASH_BOOT
2526
const flexspi_nor_config_t hyperflash_config = {
2627
.memConfig =
2728
{
@@ -52,4 +53,32 @@ const flexspi_nor_config_t hyperflash_config = {
5253
.blockSize = 256u * 1024u,
5354
.isUniformBlockSize = true,
5455
};
56+
#else
57+
const flexspi_nor_config_t qspiflash_config = {
58+
.memConfig =
59+
{
60+
.tag = FLEXSPI_CFG_BLK_TAG,
61+
.version = FLEXSPI_CFG_BLK_VERSION,
62+
.readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
63+
.csHoldTime = 3u,
64+
.csSetupTime = 3u,
65+
.columnAddressWidth = 0u,
66+
.configCmdEnable = 0u,
67+
.controllerMiscOption = 0u,
68+
.deviceType = kFlexSpiDeviceType_SerialNOR,
69+
.sflashPadType = kSerialFlash_4Pads,
70+
.serialClkFreq = kFlexSpiSerialClk_133MHz,
71+
.lutCustomSeqEnable = 0u,
72+
.sflashA1Size = 0x00800000u, /* 8MB/64Mbit */
73+
.lookupTable =
74+
{
75+
// Fast read sequence
76+
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
77+
[1] = FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x02),
78+
[2] = FLEXSPI_LUT_SEQ(STOP, 0, 0, STOP, 0, 0),
79+
[3] = FLEXSPI_LUT_SEQ(STOP, 0, 0, STOP, 0, 0),
80+
},
81+
},
82+
};
83+
#endif
5584
#endif /* XIP_BOOT_HEADER_ENABLE */

targets/targets.json

+1
Original file line numberDiff line numberDiff line change
@@ -2890,6 +2890,7 @@
28902890
"XIP_BOOT_HEADER_ENABLE=1",
28912891
"XIP_EXTERNAL_FLASH=1",
28922892
"XIP_BOOT_HEADER_DCD_ENABLE=1",
2893+
"HYPERFLASH_BOOT",
28932894
"FSL_SDK_DRIVER_QUICK_ACCESS_ENABLE=1",
28942895
"SKIP_SYSCLK_INIT",
28952896
"FSL_FEATURE_PHYKSZ8081_USE_RMII50M_MODE",

0 commit comments

Comments
 (0)