summaryrefslogtreecommitdiffstats
path: root/bsps/arm/imxrt/start
diff options
context:
space:
mode:
authorChristian Mauderer <christian.mauderer@embedded-brains.de>2023-07-13 10:53:34 +0200
committerChristian Mauderer <christian.mauderer@embedded-brains.de>2023-07-24 14:40:59 +0200
commit780149bc385b2b7670012e6b46bbd172cbbebd65 (patch)
tree93847f3c4c41eaf758a1cdc7c503b297ec8f7bf2 /bsps/arm/imxrt/start
parentbsps/imx*: Support more GPIO controllers (diff)
downloadrtems-780149bc385b2b7670012e6b46bbd172cbbebd65.tar.bz2
bsps/imsrt: Make flash config more flexible
The flash configuration is something very board specific. So move the file to a board specific location. Beneath that, not all controllers and configurations need the flash config right at the address 0 of the flash. For example on the i.MXRT11xx, the config has an offset for some flash types.
Diffstat (limited to 'bsps/arm/imxrt/start')
-rw-r--r--bsps/arm/imxrt/start/flash-boot-data.c2
-rw-r--r--bsps/arm/imxrt/start/flash-flexspi-config.c60
-rw-r--r--bsps/arm/imxrt/start/mpu-config.c4
3 files changed, 3 insertions, 63 deletions
diff --git a/bsps/arm/imxrt/start/flash-boot-data.c b/bsps/arm/imxrt/start/flash-boot-data.c
index 485f91c8ec..2186fc08bf 100644
--- a/bsps/arm/imxrt/start/flash-boot-data.c
+++ b/bsps/arm/imxrt/start/flash-boot-data.c
@@ -30,7 +30,7 @@
#include <bspopts.h>
const BOOT_DATA_T imxrt_boot_data = {
- .start = (uint32_t) imxrt_memory_flash_config_begin,
+ .start = (uint32_t) imxrt_memory_flash_raw_begin,
.size = IMXRT_MEMORY_FLASH_SIZE,
.plugin = PLUGIN_FLAG,
.placeholder = 0xFFFFFFFF,
diff --git a/bsps/arm/imxrt/start/flash-flexspi-config.c b/bsps/arm/imxrt/start/flash-flexspi-config.c
deleted file mode 100644
index 4aa10344a9..0000000000
--- a/bsps/arm/imxrt/start/flash-flexspi-config.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/* SPDX-License-Identifier: BSD-2-Clause */
-
-/*
- * Copyright (C) 2020 embedded brains GmbH & Co. KG
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <bsp/flash-headers.h>
-#include <bspopts.h>
-
-const flexspi_nor_config_t imxrt_flexspi_config = {
- .memConfig = {
- .tag = FLEXSPI_CFG_BLK_TAG,
- .version = FLEXSPI_CFG_BLK_VERSION,
- .readSampleClkSrc = kFlexSPIReadSampleClk_ExternalInputFromDqsPad,
- .csHoldTime = 3u,
- .csSetupTime = 3u,
- .columnAddressWidth = 3u,
- .controllerMiscOption = (1 << kFlexSpiMiscOffset_DdrModeEnable) |
- (1 << kFlexSpiMiscOffset_WordAddressableEnable) |
- (1 << kFlexSpiMiscOffset_SafeConfigFreqEnable) |
- (1 << kFlexSpiMiscOffset_DiffClkEnable),
- .deviceType = kFlexSpiDeviceType_SerialRAM,
- .sflashPadType = kSerialFlash_8Pads,
- .serialClkFreq = kFlexSpiSerialClk_133MHz,
- .sflashA1Size = IMXRT_MEMORY_FLASH_SIZE,
- .dataValidTime = {16u, 16u},
- .lookupTable = {
- FLEXSPI_LUT_SEQ(CMD_DDR, FLEXSPI_8PAD, 0xA0, RADDR_DDR, FLEXSPI_8PAD, 0x18),
- FLEXSPI_LUT_SEQ(CADDR_DDR, FLEXSPI_8PAD, 0x10, DUMMY_DDR, FLEXSPI_8PAD, 0x06),
- FLEXSPI_LUT_SEQ(READ_DDR, FLEXSPI_8PAD, 0x04, STOP, FLEXSPI_1PAD, 0x0),
- },
- .lutCustomSeq = {{0,0},{0,0},{0,0},{0,0},{0,0},{0,0},
- {0,0},{0,0},{0,0},{0,0},{0,0},{0,0}},
- },
- .pageSize = 0x200,
- .sectorSize = 0x40000,
- .blockSize = 0x40000,
- .isUniformBlockSize = 1,
-};
diff --git a/bsps/arm/imxrt/start/mpu-config.c b/bsps/arm/imxrt/start/mpu-config.c
index 8928980445..a8f98f1c81 100644
--- a/bsps/arm/imxrt/start/mpu-config.c
+++ b/bsps/arm/imxrt/start/mpu-config.c
@@ -44,8 +44,8 @@ BSP_START_DATA_SECTION const ARMV7M_MPU_Region_config
| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
| ARMV7M_MPU_RASR_ENABLE,
}, {
- .begin = imxrt_memory_flash_config_begin,
- .end = imxrt_memory_flash_end,
+ .begin = imxrt_memory_flash_raw_begin,
+ .end = imxrt_memory_flash_raw_end,
.rasr = ARMV7M_MPU_RASR_AP(0x3)
| ARMV7M_MPU_RASR_TEX(0x1) | ARMV7M_MPU_RASR_C | ARMV7M_MPU_RASR_B
| ARMV7M_MPU_RASR_ENABLE,