From a39dbfefc10f4aa5318094235c3e5e16196b9d1e Mon Sep 17 00:00:00 2001 From: Jamie Smith Date: Fri, 29 Sep 2023 01:38:01 -0700 Subject: [PATCH] Use BOARD_FLASH_SIZE in boot headers --- .../TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c | 6 ++++-- .../TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c | 3 ++- .../TARGET_MIMXRT105x/TARGET_TEENSY_4X/bootdata.c | 1 - 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c index 104479ff825..610219fd678 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1050_EVK/xip/evkbimxrt1050_flexspi_nor_config.c @@ -12,6 +12,8 @@ #define FSL_COMPONENT_ID "platform.drivers.xip_board" #endif +#include "mimxrt_memory_info.h" + /******************************************************************************* * Code ******************************************************************************/ @@ -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 @@ -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), diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c index e552f118d0e..fc5d2a35380 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_EVK/TARGET_1060_EVK/xip/evkbmimxrt1060_flexspi_nor_config.c @@ -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 @@ -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 diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/bootdata.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/bootdata.c index 7b4506d11f8..dc5c4271b67 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/bootdata.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/TARGET_TEENSY_4X/bootdata.c @@ -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/