-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rt1180 flexspi support #77656
base: main
Are you sure you want to change the base?
Add rt1180 flexspi support #77656
Conversation
5f4d8cc
to
f6f3b92
Compare
if(CONFIG_MEMC_MCUX_FLEXSPI) | ||
zephyr_sources(./../imxrt11xx/flexspi.c) | ||
if(CONFIG_FLASH_MCUX_FLEXSPI_XIP) | ||
zephyr_code_relocate(FILES ./../imxrt11xx/flexspi.c LOCATION ${CONFIG_FLASH_MCUX_FLEXSPI_XIP_MEM}_TEXT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this dependency is not going to be obvious to someone only looking at rt1170 is my observation about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have prepared standalone flexspi.c file for RT118x series.
f6f3b92
to
202fd17
Compare
202fd17
to
3191451
Compare
board testing pass for tests/drivers/flash/common |
soc/nxp/imxrt/imxrt118x/soc.h
Outdated
@@ -20,6 +20,10 @@ | |||
extern "C" { | |||
#endif | |||
|
|||
#ifdef CONFIG_MEMC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#ifdef CONFIG_MEMC | |
#ifdef CONFIG_MEMC_MCUX_FLEXSPI |
Let's use the same dependency between the CMake file where we pull in the C code for this function, and the function prototype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
0df958b
to
111e909
Compare
111e909
to
baacf7e
Compare
baacf7e
to
1f395f2
Compare
Just a note here- as this board has a large flash, we will probably need a change similar to mcu-tools/mcuboot#1918 in order to get MCUboot support working |
1f395f2
to
d733109
Compare
@@ -2,6 +2,7 @@ | |||
# SPDX-License-Identifier: Apache-2.0 | |||
|
|||
config SOC_SERIES_IMXRT118X | |||
select CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS if SOC_MIMXRT1189_CM7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do we pull in a custom MPU region definition for the RT1180 CM7 core?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry. I've been multi-threading lately, and I got this question wrong.
Here need to use common mpu_regions.c files here to re-configure mpu section for cm7 cores. Due to cm7 speculative prefetches feature, we need to forbid cm7 core to access some memory we don't configure. So I use common mpu_regions.c file under imxrt folder to re-config mpu regions.
f825996
to
ad514b8
Compare
add flexspi.c file to get flexspi clock rate. Enable flexspi1 clock if don't boot from flash. Use custom fixed mpu_regions.c file to config MPU for CM7 Signed-off-by: Lucien Zhao <[email protected]>
add flexspi2 and rename flexspi1 to flexspi to adapt flexspi.c driver under soc/nxp/rt118x folder. Signed-off-by: Lucien Zhao <[email protected]>
flexspi_clock_set_freq can be applied for RT118X series. Signed-off-by: Lucien Zhao <[email protected]>
USE_HYPERRAM macro defined shouldn't be placed under CONFIG_BOOT_FLEXSPI_NOR. Add flexspi1 pinmux pinctrl and flash partitions Add flash partitions and correct flash parameter. This commit was tested with samples: flash_shell on cm33/cm7 cores Signed-off-by: Lucien Zhao <[email protected]>
ad514b8
to
87fca2a
Compare
pinctrl-names = "default"; | ||
}; | ||
|
||
&flexspi { | ||
status = "okay"; | ||
ahb-prefetch; | ||
ahb-read-addr-opt; | ||
rx-clock-source = <1>; | ||
w25q128jw: w25q128jw@0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
w25q128jw: w25q128jw@0 { | |
w25q128jw: w25q128jw@2 { |
Reg address should match here, otherwise we'll get a DTC warning
Support flexspi to operate external nor flash.
FLASH_SHELL case have been tested on RT1180 CM33/CM7 cores.