1 /*
2  * Copyright 2018-2020 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "evkmimxrt1015_flexspi_nor_config.h"
9 
10 /* Component ID definition, used by tools. */
11 #ifndef FSL_COMPONENT_ID
12 #define FSL_COMPONENT_ID "platform.drivers.xip_board"
13 #endif
14 
15 /*******************************************************************************
16  * Code
17  ******************************************************************************/
18 #if defined(XIP_BOOT_HEADER_ENABLE) && (XIP_BOOT_HEADER_ENABLE == 1)
19 #if defined(__CC_ARM) || defined(__ARMCC_VERSION) || defined(__GNUC__)
20 __attribute__((section(".boot_hdr.conf"), used))
21 #elif defined(__ICCARM__)
22 #pragma location = ".boot_hdr.conf"
23 #endif
24 
25 const flexspi_nor_config_t qspiflash_config = {
26     .memConfig =
27         {
28             .tag              = FLEXSPI_CFG_BLK_TAG,
29             .version          = FLEXSPI_CFG_BLK_VERSION,
30             .readSampleClkSrc = kFlexSPIReadSampleClk_LoopbackFromDqsPad,
31             .csHoldTime       = 3u,
32             .csSetupTime      = 3u,
33             .sflashPadType    = kSerialFlash_4Pads,
34             .serialClkFreq    = kFlexSpiSerialClk_100MHz,
35             .sflashA1Size     = 16u * 1024u * 1024u,
36             .lookupTable =
37                 {
38                     // Read LUTs
39                     FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
40                     FLEXSPI_LUT_SEQ(DUMMY_SDR, FLEXSPI_4PAD, 0x06, READ_SDR, FLEXSPI_4PAD, 0x04),
41                 },
42         },
43     .pageSize           = 256u,
44     .sectorSize         = 4u * 1024u,
45     .blockSize          = 64u * 1024u,
46     .isUniformBlockSize = false,
47 };
48 #endif /* XIP_BOOT_HEADER_ENABLE */
49