forked from Imagelibrary/rtems
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.
This commit is contained in:
@@ -56,6 +56,10 @@ extern char imxrt_memory_peripheral_begin[];
|
||||
extern char imxrt_memory_peripheral_end[];
|
||||
extern char imxrt_memory_peripheral_size[];
|
||||
|
||||
extern char imxrt_memory_flash_raw_begin[];
|
||||
extern char imxrt_memory_flash_raw_end[];
|
||||
extern char imxrt_memory_flash_raw_size[];
|
||||
|
||||
extern char imxrt_memory_flash_config_begin[];
|
||||
extern char imxrt_memory_flash_config_end[];
|
||||
extern char imxrt_memory_flash_config_size[];
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -25,6 +25,7 @@ links:
|
||||
source:
|
||||
- bsps/arm/imxrt/boards/evkbimxrt1050/clock_config.c
|
||||
- bsps/arm/imxrt/boards/evkbimxrt1050/flash-dcd.c
|
||||
- bsps/arm/imxrt/boards/evkbimxrt1050/flash-flexspi-config.c
|
||||
- bsps/arm/imxrt/boards/evkbimxrt1050/pin_mux.c
|
||||
- bsps/arm/imxrt/boards/evkbimxrt1050/clock-arm-pll-config.c
|
||||
- bsps/arm/imxrt/dts/imxrt1050-evkb.c
|
||||
|
||||
@@ -33,7 +33,9 @@ links:
|
||||
- role: build-dependency
|
||||
uid: optmemextramsz
|
||||
- role: build-dependency
|
||||
uid: optmemflashcfgsz
|
||||
uid: optmemflashcfgoffset
|
||||
- role: build-dependency
|
||||
uid: optmemflashivtoffset
|
||||
- role: build-dependency
|
||||
uid: optmemflashivtsz
|
||||
- role: build-dependency
|
||||
|
||||
@@ -5,12 +5,13 @@ content: |
|
||||
NULL : ORIGIN = 0x00000000, LENGTH = ${IMXRT_MEMORY_NULL_SIZE:#010x}
|
||||
ITCM : ORIGIN = ${IMXRT_MEMORY_NULL_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_ITCM_SIZE:#010x}
|
||||
DTCM : ORIGIN = 0x20000000, LENGTH = ${IMXRT_MEMORY_DTCM_SIZE:#010x}
|
||||
OCRAM : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN}, LENGTH = ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}
|
||||
OCRAM_NOCACHE : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN} + ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}
|
||||
OCRAM : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN:#010x}, LENGTH = ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}
|
||||
OCRAM_NOCACHE : ORIGIN = ${IMXRT_MEMORY_OCRAM_ORIGIN:#010x} + ${IMXRT_MEMORY_OCRAM_SIZE:#010x} - ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_OCRAM_NOCACHE_SIZE:#010x}
|
||||
PERIPHERAL : ORIGIN = 0x40000000, LENGTH = 0x20000000
|
||||
FLASH_CONFIG : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x}
|
||||
FLASH_IVT : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}
|
||||
FLASH : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x} + ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_SIZE:#010x} - ${IMXRT_MEMORY_FLASH_CFG_SIZE:#010x} - ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}
|
||||
FLASH_RAW : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_SIZE:#010x}
|
||||
FLASH_CONFIG : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_CFG_OFFSET:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_IVT_OFFSET:#010x} - ${IMXRT_MEMORY_FLASH_CFG_OFFSET:#010x}
|
||||
FLASH_IVT : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_IVT_OFFSET:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}
|
||||
FLASH : ORIGIN = ${IMXRT_MEMORY_FLASH_ORIGIN:#010x} + ${IMXRT_MEMORY_FLASH_IVT_OFFSET:#010x} + ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_FLASH_SIZE:#010x} - ${IMXRT_MEMORY_FLASH_IVT_OFFSET:#010x} - ${IMXRT_MEMORY_FLASH_IVT_SIZE:#010x}
|
||||
EXTRAM : ORIGIN = ${IMXRT_MEMORY_EXTRAM_ORIGIN:#010x}, LENGTH = ${IMXRT_MEMORY_EXTRAM_SIZE:#010x} - ${IMXRT_MEMORY_EXTRAM_NOCACHE_SIZE:#010x}
|
||||
EXTRAM_NOCACHE : ORIGIN = ${IMXRT_MEMORY_EXTRAM_ORIGIN:#010x} + ${IMXRT_MEMORY_EXTRAM_SIZE:#010x} - ${IMXRT_MEMORY_EXTRAM_NOCACHE_SIZE:#010x}, LENGTH = ${IMXRT_MEMORY_EXTRAM_NOCACHE_SIZE:#010x}
|
||||
}
|
||||
@@ -39,6 +40,10 @@ content: |
|
||||
imxrt_memory_peripheral_end = ORIGIN (PERIPHERAL) + LENGTH (PERIPHERAL);
|
||||
imxrt_memory_peripheral_size = LENGTH (PERIPHERAL);
|
||||
|
||||
imxrt_memory_flash_raw_begin = ORIGIN (FLASH_RAW);
|
||||
imxrt_memory_flash_raw_end = ORIGIN (FLASH_RAW) + LENGTH (FLASH_RAW);
|
||||
imxrt_memory_flash_raw_size = LENGTH (FLASH_RAW);
|
||||
|
||||
imxrt_memory_flash_config_begin = ORIGIN (FLASH_CONFIG);
|
||||
imxrt_memory_flash_config_end = ORIGIN (FLASH_CONFIG) + LENGTH (FLASH_CONFIG);
|
||||
imxrt_memory_flash_config_size = LENGTH (FLASH_CONFIG);
|
||||
|
||||
@@ -41,7 +41,6 @@ source:
|
||||
- bsps/arm/imxrt/start/bspstart.c
|
||||
- bsps/arm/imxrt/start/bspstarthooks.c
|
||||
- bsps/arm/imxrt/start/flash-boot-data.c
|
||||
- bsps/arm/imxrt/start/flash-flexspi-config.c
|
||||
- bsps/arm/imxrt/start/flash-ivt.c
|
||||
- bsps/arm/imxrt/start/imxrt-ffec-init.c
|
||||
- bsps/arm/imxrt/start/mpu-config.c
|
||||
|
||||
21
spec/build/bsps/arm/imxrt/optmemflashcfgoffset.yml
Normal file
21
spec/build/bsps/arm/imxrt/optmemflashcfgoffset.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
actions:
|
||||
- get-integer: null
|
||||
- env-assign: null
|
||||
build-type: option
|
||||
copyrights:
|
||||
- Copyright (C) 2023 embedded brains GmbH (http://www.embedded-brains.de)
|
||||
default:
|
||||
- enabled-by: arm/imxrt1166-cm7-saltshaker
|
||||
value: 0x00000400
|
||||
- enabled-by: true
|
||||
value: 0x00000000
|
||||
description: |
|
||||
Ofset of the flash configuration area from the start of the FlexSPI / SEMC
|
||||
flash in bytes. The example link files for the i.MX RT1050 set that to 0. On
|
||||
the i.MX RT1166, it's 0x400.
|
||||
enabled-by: true
|
||||
format: '{:#010x}'
|
||||
links: []
|
||||
name: IMXRT_MEMORY_FLASH_CFG_OFFSET
|
||||
type: build
|
||||
@@ -1,20 +0,0 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
actions:
|
||||
- get-integer: null
|
||||
- env-assign: null
|
||||
build-type: option
|
||||
copyrights:
|
||||
- Copyright (C) 2020 embedded brains GmbH & Co. KG
|
||||
default:
|
||||
- enabled-by: true
|
||||
value: 0x00001000
|
||||
description: |
|
||||
Size of the flash configuration area at the start of the FlexSPI / SEMC flash
|
||||
in bytes. Either 4 KByte for FlexSPI NOR / SEMC NOR or 1 Kbyte for most other.
|
||||
Take a look at the i.MX RT1050 Processor Reference Manual chapter 9.7 "Program
|
||||
image" for details.
|
||||
enabled-by: true
|
||||
format: '{:#010x}'
|
||||
links: []
|
||||
name: IMXRT_MEMORY_FLASH_CFG_SIZE
|
||||
type: build
|
||||
20
spec/build/bsps/arm/imxrt/optmemflashivtoffset.yml
Normal file
20
spec/build/bsps/arm/imxrt/optmemflashivtoffset.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
|
||||
actions:
|
||||
- get-integer: null
|
||||
- env-assign: null
|
||||
build-type: option
|
||||
copyrights:
|
||||
- Copyright (C) 2023 embedded brains GmbH (http://www.embedded-brains.de)
|
||||
default:
|
||||
- enabled-by: true
|
||||
value: 0x00001000
|
||||
description: |
|
||||
Offset of the image vector table in flash in bytes. Either 4 KByte for FlexSPI
|
||||
NOR / SEMC NOR or 1 KByte for most others (on i.MXRT1050). Take a look at the
|
||||
i.MXRT1050 / i.MXRT1166 Processor Reference Manual chapter "System Boot" /
|
||||
"Program image" for details.
|
||||
enabled-by: true
|
||||
format: '{:#010x}'
|
||||
links: []
|
||||
name: IMXRT_MEMORY_FLASH_IVT_OFFSET
|
||||
type: build
|
||||
Reference in New Issue
Block a user