Go to the documentation of this file.
9 #ifndef __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__
10 #define __EVKBIMXRT1050_FLEXSPI_NOR_CONFIG__
19 #define FSL_XIP_BOARD_DRIVER_VERSION (MAKE_VERSION(2, 0, 0))
23 #define FLEXSPI_CFG_BLK_TAG (0x42464346UL) // ascii "FCFB" Big Endian
24 #define FLEXSPI_CFG_BLK_VERSION (0x56010400UL) // V1.4.0
25 #define FLEXSPI_CFG_BLK_SIZE (512)
28 #define FLEXSPI_FEATURE_HAS_PARALLEL_MODE 1
31 #define CMD_INDEX_READ 0
32 #define CMD_INDEX_READSTATUS 1
33 #define CMD_INDEX_WRITEENABLE 2
34 #define CMD_INDEX_WRITE 4
36 #define CMD_LUT_SEQ_IDX_READ 0
37 #define CMD_LUT_SEQ_IDX_READSTATUS 1
38 #define CMD_LUT_SEQ_IDX_WRITEENABLE 3
39 #define CMD_LUT_SEQ_IDX_WRITE 9
43 #define RADDR_SDR 0x02
44 #define RADDR_DDR 0x22
45 #define CADDR_SDR 0x03
46 #define CADDR_DDR 0x23
47 #define MODE1_SDR 0x04
48 #define MODE1_DDR 0x24
49 #define MODE2_SDR 0x05
50 #define MODE2_DDR 0x25
51 #define MODE4_SDR 0x06
52 #define MODE4_DDR 0x26
53 #define MODE8_SDR 0x07
54 #define MODE8_DDR 0x27
55 #define WRITE_SDR 0x08
56 #define WRITE_DDR 0x28
59 #define LEARN_SDR 0x0A
60 #define LEARN_DDR 0x2A
61 #define DATSZ_SDR 0x0B
62 #define DATSZ_DDR 0x2B
63 #define DUMMY_SDR 0x0C
64 #define DUMMY_DDR 0x2C
65 #define DUMMY_RWDS_SDR 0x0D
66 #define DUMMY_RWDS_DDR 0x2D
67 #define JMP_ON_CS 0x1F
70 #define FLEXSPI_1PAD 0
71 #define FLEXSPI_2PAD 1
72 #define FLEXSPI_4PAD 2
73 #define FLEXSPI_8PAD 3
75 #define FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) \
76 (FLEXSPI_LUT_OPERAND0(op0) | FLEXSPI_LUT_NUM_PADS0(pad0) | FLEXSPI_LUT_OPCODE0(cmd0) | FLEXSPI_LUT_OPERAND1(op1) | \
77 FLEXSPI_LUT_NUM_PADS1(pad1) | FLEXSPI_LUT_OPCODE1(cmd1))
213 #define NOR_CMD_INDEX_READ CMD_INDEX_READ
214 #define NOR_CMD_INDEX_READSTATUS CMD_INDEX_READSTATUS
215 #define NOR_CMD_INDEX_WRITEENABLE CMD_INDEX_WRITEENABLE
216 #define NOR_CMD_INDEX_ERASESECTOR 3
217 #define NOR_CMD_INDEX_PAGEPROGRAM CMD_INDEX_WRITE
218 #define NOR_CMD_INDEX_CHIPERASE 5
219 #define NOR_CMD_INDEX_DUMMY 6
220 #define NOR_CMD_INDEX_ERASEBLOCK 7
222 #define NOR_CMD_LUT_SEQ_IDX_READ CMD_LUT_SEQ_IDX_READ
223 #define NOR_CMD_LUT_SEQ_IDX_READSTATUS \
224 CMD_LUT_SEQ_IDX_READSTATUS
225 #define NOR_CMD_LUT_SEQ_IDX_READSTATUS_XPI \
227 #define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE \
228 CMD_LUT_SEQ_IDX_WRITEENABLE
229 #define NOR_CMD_LUT_SEQ_IDX_WRITEENABLE_XPI \
231 #define NOR_CMD_LUT_SEQ_IDX_ERASESECTOR 5
232 #define NOR_CMD_LUT_SEQ_IDX_ERASEBLOCK 8
233 #define NOR_CMD_LUT_SEQ_IDX_PAGEPROGRAM \
234 CMD_LUT_SEQ_IDX_WRITE
235 #define NOR_CMD_LUT_SEQ_IDX_CHIPERASE 11
236 #define NOR_CMD_LUT_SEQ_IDX_READ_SFDP 13
237 #define NOR_CMD_LUT_SEQ_IDX_RESTORE_NOCMD \
239 #define NOR_CMD_LUT_SEQ_IDX_EXIT_NOCMD \
uint32_t csPadSettingOverride
[0x060-0x063] CS pad setting override value
uint8_t seqNum
Sequence Number, valid number: 1-16.
uint8_t ipcmdSerialClkFreq
Clock frequency for IP command.
_FlashReadSampleClkSource
FlexSPI Read Sample Clock Source definition.
@ kFlexSpiMiscOffset_PadSettingOverrideEnable
Bit for Pad setting override enable.
uint8_t halfClkForNonReadCmd
Half the Serial Clock for non-read command: true/false.
uint32_t sflashB2Size
[0x05c-0x05f] Size of Flash connected to B2
uint8_t sflashPadType
[0x045-0x045] Serial Flash Pad Type: 1 - Single, 2 - Dual, 4 - Quad, 8 - Octal
uint32_t version
[0x004-0x007] Version,[31:24] -'V', [23:16] - Major, [15:8] - Minor, [7:0] - bugfix
uint32_t dataPadSettingOverride
[0x068-0x06b] data pad setting override value
@ kFlexSpiDeviceType_SerialNAND
Flash devices are Serial NAND.
@ kFlexSpiMiscOffset_WordAddressableEnable
Bit for Word Addressable enable.
flexspi_lut_seq_t lutCustomSeq[12]
[0x180-0x1af] Customizable LUT Sequences
uint8_t seqId
Sequence Index, valid number: 0-15.
uint8_t deviceType
details
uint16_t waitTimeCfgCommands
Generic configuration, etc.
uint8_t lutCustomSeqEnable
Chapter for more details.
@ kFlexSpiSerialClk_75MHz
@ kDeviceConfigCmdType_Spi2NoCmd
Switch to 0-4-4/0-8-8 mode.
uint32_t blockSize
Block size.
@ kDeviceConfigCmdType_Xpi2Spi
Switch from DPI/QPI/OPI to SPI mode.
uint8_t serialNorType
Serial NOR Flash type: 0/1/2/3.
@ kFlexSpiSerialClk_133MHz
@ kFlexSpiSerialClk_30MHz
uint8_t configModeType[3]
[0x01d-0x01f] Configure Mode Type, similar as deviceModeTpe
uint8_t csSetupTime
[0x00e-0x00e] CS setup time, default value: 3
uint32_t lookupTable[64]
busy flag is 0 when flash device is busy
@ kFlexSpiClk_DDR
Clock configurat for DDR mode.
enum _FlexSpiSerialClockFreq flexspi_serial_clk_freq_t
Definitions for FlexSPI Serial Clock Frequency.
@ kFlexSpiDeviceType_SerialRAM
Flash devices are Serial RAM/HyperFLASH.
@ kFlexSPIReadSampleClk_LoopbackFromSckPad
uint8_t needExitNoCmdMode
Need to exit NoCmd mode before other IP command.
uint32_t deviceModeArg
sequence number, [31:16] Reserved
uint8_t needRestoreNoCmdMode
Need to Restore NoCmd mode after IP commmand execution.
@ kFlexSpiSerialClk_80MHz
_FlexSpiSerialClockFreq
Definitions for FlexSPI Serial Clock Frequency.
@ kFlexSpiClk_SDR
Clock configure for SDR mode.
@ kFlexSpiMiscOffset_DdrModeEnable
Bit for DDR clock confiuration indication.
uint32_t reserved2
[0x03c-0x03f] Reserved for future use
uint8_t csHoldTime
[0x00d-0x00d] CS hold time, default value: 3
uint8_t isUniformBlockSize
Sector/Block size is the same.
uint8_t reserved0[2]
Reserved for future use.
@ kFlexSpiMiscOffset_Ck2Enable
Bit for CK2 enable.
flexspi_lut_seq_t configCmdSeqs[3]
[0x020-0x02b] Sequence info for Device Configuration command, similar as deviceModeSeq
@ kFlexSPIReadSampleClk_LoopbackInternally
uint32_t pageSize
Page size of Serial NOR.
@ kDeviceConfigCmdType_Generic
Generic command, for example: configure dummy cycles, drive strength, etc.
uint32_t reserved3[2]
be done using 1 LUT sequence, currently, only applicable to HyperFLASH
@ kFlexSpiDeviceType_MCP_NOR_RAM
Flash deivce is MCP device, A1 is Serial NOR, A2 is Serial RAMs.
uint32_t timeoutInMs
[0x070-0x073] Timeout threshold for read status command
enum _FlashReadSampleClkSource flexspi_read_sample_clk_t
FlexSPI Read Sample Clock Source definition.
uint32_t sflashB1Size
[0x058-0x05b] Size of Flash connected to B1
@ kFlexSpiSerialClk_166MHz
flexspi_mem_config_t memConfig
Common memory configuration info via FlexSPI.
@ kFlexSPIReadSampleClk_LoopbackFromDqsPad
struct _FlexSPIConfig flexspi_mem_config_t
FlexSPI Memory Configuration Block.
@ kDeviceConfigCmdType_Reset
Reset device command.
uint32_t reserved0
[0x008-0x00b] Reserved for future use
@ kFlexSpiDeviceType_SerialNOR
Flash devices are Serial NOR.
@ kFlexSpiSerialClk_60MHz
@ kFlexSpiDeviceType_MCP_NOR_NAND
Flash device is MCP device, A1 is Serial NOR, A2 is Serial NAND.
uint32_t configCmdArgs[3]
[0x030-0x03b] Arguments/Parameters for device Configuration commands
uint32_t commandInterval
[0x074-0x077] CS deselect interval between two commands
@ kFlexSpiMiscOffset_ParallelEnable
Bit for Parallel mode enable.
uint32_t controllerMiscOption
@ kFlexSPIReadSampleClk_ExternalInputFromDqsPad
uint16_t dataValidTime[2]
[0x078-0x07b] CLK edge to data valid time for PORT A and PORT B, in terms of 0.1ns
struct _flexspi_nor_config flexspi_nor_config_t
uint32_t sectorSize
Sector size of Serial NOR.
uint32_t sflashA1Size
[0x050-0x053] Size of Flash connected to A1
uint32_t dqsPadSettingOverride
[0x06c-0x06f] DQS pad setting override value
uint8_t configCmdEnable
[0x01c-0x01c] Configure command Enable Flag, 1 - Enable, 0 - Disable
@ kDeviceConfigCmdType_Spi2Xpi
Switch from SPI to DPI/QPI/OPI mode.
FlexSPI Memory Configuration Block.
@ kFlexSpiMiscOffset_SafeConfigFreqEnable
Bit for Safe Configuration Frequency enable.
uint32_t reserved4[4]
[0x1b0-0x1bf] Reserved for future use
@ kFlexSpiSerialClk_50MHz
@ kFlexSpiSerialClk_100MHz
struct _lut_sequence flexspi_lut_seq_t
FlexSPI LUT Sequence structure.
uint32_t reserve2[11]
Reserved for future use.
uint8_t deviceModeCfgEnable
Serial NAND, need to refer to datasheet.
uint16_t busyOffset
[0x07c-0x07d] Busy offset, valid value: 0-31
@ kDeviceConfigCmdType_QuadEnable
Quad Enable command.
FlexSPI LUT Sequence structure.
uint8_t columnAddressWidth
uint8_t readSampleClkSrc
[0x00c-0x00c] Read Sample Clock Source, valid value: 0/1/3
uint32_t sclkPadSettingOverride
[0x064-0x067] SCK pad setting override value
flexspi_lut_seq_t deviceModeSeq
DPI/QPI/OPI switch or reset command.
uint32_t tag
[0x000-0x003] Tag, fixed value 0x42464346UL
uint32_t sflashA2Size
[0x054-0x057] Size of Flash connected to A2
uint32_t reserved1
[0x02c-0x02f] Reserved for future use
@ kFlexSpiMiscOffset_DiffClkEnable
Bit for Differential clock enable.