-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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 Support for XIP from FlexSPI on MCXN947 #72905
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
59c66b4
to
e3c6e69
Compare
it does not work on my board, see below steps:
reset the boards, no console output
and flash again reset board still no output |
Can we also add support to link code directly to the XIP region?
Ideally you want be able to use both
|
((CONFIG_FLASH_BASE_ADDRESS) < (DT_REG_ADDR_BY_IDX(node_id, 1) + \ | ||
DT_REG_SIZE_BY_IDX(node_id, 1))) | ||
|
||
#define MEMC_FLEXSPI_CFG_XIP(node_id) true |
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.
CONFIG_FLASH_MCUX_FLEXSPI_XIP
does not do the same thing as the code being removed here. The key difference is that CONFIG_FLASH_MCUX_FLEXSPI_XIP
simply indicates that one of the FLEXSPI devices is being used for XIP. This check was added for parts like the iMXRT1xxx or iMXRT5xx, which have multiple FLEXSPI devices. For these systems, the FLEXSPI being used for XIP should not be initialized, but the other FLEXSPI must be initialized, as the bootloader will not have configured it.
I'm confused why this check wouldn't work for the MCXN use case. Shouldn't the image targeting external flash be built with CONFIG_FLASH_BASE_ADDRESS
within the FLEXSPI region?
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.
The commit adding these overlay files should come after the one adding support for the board, right?
Also, the commits follow this one are split based on which sample they are adding support for. I think we should organize commits like so:
- Commit adding baseline support for QSPI variant
- Commits adding support for features on the QSPI variant, which add sample/test overlays for that feature (and update the YAML file for the variant)
compatible = "nxp,mcxn947", "nxp,mcx"; | ||
|
||
chosen { | ||
zephyr,flash = &w25q64jvssiq; |
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.
Based on this, CONFIG_FLASH_BASE_ADDRESS
should be in the FLEXSPI XIP region- so I am unclear why we need to change the XIP check in the MEMC flexspi driver
- zephyr | ||
- gnuarmemb | ||
- xtools | ||
supported: |
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.
As mentioned in my other comment, I think we should first introduce baseline support for this variant in a commit early in this PR, then add support for features in follow up commits (along with the requisite YAML changes)
@mmahadevan108 mcu-tools/mcuboot#1961 merged but I guess now we need to ensure that the Zephyr version of mcuboot is updated for this PR to work? Should we do that in this PR as well (coordinating with @d3zd3z) Also, I rebased your branch to address the merge conflict |
Get the fixes made to the NXP SDK CACHE64 driver Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
The CONFIG_FLASH_MCUX_FLEXSPI_XIP Kconfig is doing the same thing as the code. Also removing the code gives the flexibilily of XIP'ing from the a different aliased address that maybe available on some SOC's. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Include compile of the flash file when FlexSPI_XIP is enabled even when the FlexSPI driver is not enabled. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add config and overlay files for the QSPI variant of the NXP FRDM-MCXN947 board Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
- Add overlay for the FRDM MCXN947 qspi variant - Fix the overlay file name for the default variant Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Add overlay for the QSPI variant of FRDM-MCXN947 Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. The boards always boots from internal flash. However it does have an external QSPI that can be used to store Zephyr. Add a variant to support running Zephyr from QSPI Flash. Running Zephyr from QSPI requires a bootloader like MCUboot to be pogrammed to internal flash. 2. Create a common dts file to add features that are enabled for CPU 0 that is included by both vairants i.e internal flash (default) and QSPI variant. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
1. Enable CACHE64 block used by FlexSPI. 2. LPCAC cache is already enabled by SystemInit which is called earlier 3. Configure the FlexSPI clock when running in XIP mode as we cannot rely on the driver setting this up as it may not be enabled. Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
@mmahadevan108 , I switch to the mcuboot commit that has your commit
with below command line with this zephyr PR source I get
|
This PR requires a bootloader like MCUboot to be programmed to internal flash which will load and execute the Zephyr application from QSPI.
PR: mcu-tools/mcuboot#1961 to update MCUboot for this QSPI variant