Skip to content

Commit

Permalink
Use BOARD_FLASH_SIZE in boot headers
Browse files Browse the repository at this point in the history
  • Loading branch information
multiplemonomials committed Sep 29, 2023
1 parent 88fcdd6 commit a39dbfe
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#define FSL_COMPONENT_ID "platform.drivers.xip_board"
#endif

#include "mimxrt_memory_info.h"

/*******************************************************************************
* Code
******************************************************************************/
Expand All @@ -37,7 +39,7 @@ const flexspi_nor_config_t hyperflash_config = {
(1u << kFlexSpiMiscOffset_SafeConfigFreqEnable) | (1u << kFlexSpiMiscOffset_DiffClkEnable),
.sflashPadType = kSerialFlash_8Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.sflashA1Size = 64u * 1024u * 1024u,
.sflashA1Size = BOARD_FLASH_SIZE,
.dataValidTime = {16u, 16u},
.lookupTable = {
// Read LUTs
Expand Down Expand Up @@ -66,7 +68,7 @@ const flexspi_nor_config_t qspiflash_config = {
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_133MHz,
.lutCustomSeqEnable = 0u,
.sflashA1Size = 0x00800000u, /* 8MB/64Mbit */
.sflashA1Size = BOARD_FLASH_SIZE,
.lookupTable = {
// Fast read sequence
[0] = FLEXSPI_LUT_SEQ(CMD_SDR, FLEXSPI_1PAD, 0xEB, RADDR_SDR, FLEXSPI_4PAD, 0x18),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include "evkbmimxrt1060_flexspi_nor_config.h"
#include "mimxrt_memory_info.h"

/* Component ID definition, used by tools. */
#ifndef FSL_COMPONENT_ID
Expand Down Expand Up @@ -34,7 +35,7 @@ const flexspi_nor_config_t qspiflash_config = {
.deviceType = kFlexSpiDeviceType_SerialNOR,
.sflashPadType = kSerialFlash_4Pads,
.serialClkFreq = kFlexSpiSerialClk_120MHz,
.sflashA1Size = 8u * 1024u * 1024u,
.sflashA1Size = BOARD_FLASH_SIZE,
.lookupTable =
{
// Read LUTs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// - #define names had to be modified to match Mbed
// - _flashimagelen replaced with __USED_FLASH_SIZE
// - ResetHandler replaced with Reset_Handler
// - hardcoded flash size replaced with BOARD_FLASH_SIZE

/* Teensyduino Core Library
* http://www.pjrc.com/teensy/
Expand Down

0 comments on commit a39dbfe

Please sign in to comment.