-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Move hal_nxp glue code to zephyr repo #84423
Open
ZhaoxiangJin
wants to merge
11
commits into
zephyrproject-rtos:main
Choose a base branch
from
nxp-upstream:feature/mcux_ng_glue_upstream_no_kconfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Move hal_nxp glue code to zephyr repo #84423
ZhaoxiangJin
wants to merge
11
commits into
zephyrproject-rtos:main
from
nxp-upstream:feature/mcux_ng_glue_upstream_no_kconfig
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 project with PR revision Note: This message is automatically posted and updated by the Manifest GitHub Action. |
84b3afa
to
3e5c624
Compare
3e5c624
to
45d2190
Compare
0479c6c
to
d4664ec
Compare
11d8ea0
to
d5e6030
Compare
d5e6030
to
d784019
Compare
The cntMode in gpc_tran_step_config_t is not used, removed it. Signed-off-by: Zhaoxiang Jin <[email protected]>
The XSPI features was updated in MCUXSDK, need to update zephyr side code to avoiding build error. Signed-off-by: Zhaoxiang Jin <[email protected]>
Add cortex-m core suffix item for imx devices Signed-off-by: Zhaoxiang Jin <[email protected]>
In some secondary core scenarios, the boot header is included, RT Boot header is only needed on primary core. Signed-off-by: Zhaoxiang Jin <[email protected]>
The kconfig option CONFIG_MCUX_ACMP has been removed, and the currently available kconfig options are CONFIG_COMPAARATOR_SCUX_ACMP or CONFIG_SENSOR_SCUX-ACMP Signed-off-by: Zhaoxiang Jin <[email protected]>
Remove the fsl_power.h, because it is not avaiable for MCXN in MCUX SDK 24.12. Signed-off-by: Jason Yu <[email protected]>
The acmp driver will pull in based on SENSOR_MCUX_ACMP, the kconfig option MCUX_ACMP is not needed. Signed-off-by: Zhaoxiang Jin <[email protected]>
The acmp driver will pull in based on COMPARATOR_MCUX_ACMP, the kconfig option MCUX_ACMP is not needed. Signed-off-by: Zhaoxiang Jin <[email protected]>
Kconfig.imx, Kconfig.mcux, Kconfig.nxp_s32 have moved inside hal_nxp, need to remove them from MAINTAINERS.yml Signed-off-by: Zhaoxiang Jin <[email protected]>
Move hal_nxp glue layer to zephyr repo. This patch only leverage MCUX SDK Cmake. Signed-off-by: Zhaoxiang Jin <[email protected]> Signed-off-by: Jason Yu <[email protected]>
Update manifest to contain hal_nxp changes Signed-off-by: Zhaoxiang Jin <[email protected]>
d784019
to
5c9765e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Comparator
area: DMA
Direct Memory Access
area: Process
area: Sensors
Sensors
DNM (manifest)
This PR should not be merged (controlled by action-manifest)
manifest
manifest-hal_nxp
platform: NXP Drivers
NXP Semiconductors, drivers
platform: NXP MPU
platform: NXP
NXP
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR has been implemented:
Moving the glue layer to the Zephyr repo can reduce the number of repositories that need to be touched when supporting new devices/drives, making it easier for the development process.
The MCUXSDK NG introduced CMake to organize files and Kconfig to resolve dependencies. Adopting MCUXSDK NG to hal_nxp will reduce the effort of introducing new drivers and devices to Zephyr, as it can directly leverage the CMake infrastructure in SDK NG.
Two integration method compare
Original integration method:
The original integration method uses CMake to add SDK code to Zephyr, it is based on modified SDK 2.0 driver CMake. When developers need a driver, they first need to add this CMake file first. Take adc16 driver as an example, the adc16 cmake content is like below.
When Zephyr needs adc16 driver, a Kconfig configuration ADC_MCUX_ADC16 is enabled, then add the following code to the glue code to include the adc16 driver.
include_driver_ifdef(CONFIG_ADC_MCUX_ADC16 adc16 driver_adc16)
New integration method:
SDK NG uses Kconfig and CMake to add driver in project, which is similar with Zephyr. The architecture is:
Device’s Kconfig defines IP Kconfig options, which indicates the device supported features. For example, define MCUX_HW_IP_DriverType_ADC16 if the device has ADC16.
Driver’s Kconfig defines two Kconfig options MCUX_HAS_COMPONENT_driver.xxx and MCUX_COMPONENT_driver.xxx. The driver dependency is handled in this layer. For example, fsl_adc16.c needs fsl_common.c, so MCUX_COMPONENT_driver.adc16 selects MCUX_COMPONENT_driver.common.
Driver’s CMakeLists.txt adds source code and include path, based on Kconfig selection.
More details see CMakeLists.txt and Kconfig.
The new integration method will only use the SDK NG CMake files. If the Zephyr side needs the adc16 driver, just add the following code to glue. Developers do not need to add the driver side CMake.
Device enablement
Based on the new integration method, the device enablement in zephyr becomes easier.
Enabling a device requires the device header, device feature header, peripheral header and so on. All of these have been processed in the device CMakeLists,txt of SDK NG (see https://github.com/nxp-mcuxpresso/mcuxsdk-core/blob/release/24.12.00/devices/arm/device_header.cmake). We no longer need to add various device related cmakes to hal_nxp like the old integration method, we only need to add the following code in glue code (all devices are the same, so it only needs to be done once):
The glue code folder structure
The hal_nxp code folder structure
The legacy sdk folder mcux-sdk is not changed, some files in this folder can be removed, such as cmsis_driver, and the devices which are supported by SDK NG.
The mcu-sdk-ng is copied from mcu-sdk, unused files are removed, such as documents, linker script and so on.
The mcux/middleware are improved so that they can be used by both legacy platforms and SDK NG platforms. If it is not necessary to support the legacy platforms, then SDK NG middleware in mcux/mcux-sdk-ng/middleware can be used.
Note: Devices supported in SDK NG may also use files in mcux-sdk/components, as these components have files that are not supported in SDK NG, such as rpmsg/fsl_adapter_rfimu.c.
Why we still need the original hal_nxp.cmake (now is <zephyr_repo>/modules/hal_nxp/mcux/mcux-sdk/CMakeLists.txt)?
The SDK NG does not support legacy devices like MK64F12, MKE16F16 and some APs like MIMX9352_A55 and MIMX8UD7_ADSP. So, these devices still need to be run through hal_nxp.cmake.

A simple load structure diagram is shown below: