-
Notifications
You must be signed in to change notification settings - Fork 146
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
Feature/enable zephyr integration #37
Conversation
We do not accept contributions to files under CMSIS, these files are sourced from https://github.com/ARM-software/CMSIS_5, please contribute to the upstream directly. |
this is a huge change, do you have any documnets on those changes? @mcuxsusan |
drivers/lpsci/fsl_lpsci.c
Outdated
@@ -0,0 +1,1074 @@ | |||
/* | |||
* Copyright (c) 2015-2016, Freescale Semiconductor, Inc. |
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.
license correct?
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 reused the lpsci driver in current hal_nxp module because the KL25 device which has lpsci driver, has been dropped from SDK release for a long time, so I simply used the verified lpsci driver in hal_nxp.
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.
There are many Zephyr unrealted changes, can you split the PR into serval meanful ones, and let zephyr team review only zephyr related?
CMSIS/kconfig.CMSIS
Outdated
@@ -0,0 +1,89 @@ | |||
# Copyright 2021 NXP |
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.
zephyr does not use this CMSIS. so this shall be in another PR
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.
In the Kconfig framework for MCUXpresso SDK, kconfig.xx is prepared in each category to describe the components in this directory only. Currently all the components are included in the configurable items of zephyr module hal_nxp according to the zephyr/Kconfig description, it's OK to remove some configuration items which are not used in zephyr. Currently the below relative kconfig.xx source are included in the kconfig file, please suggest which are not needed.
rsource "./devices/kconfig.socs"
rsource "./drivers/kconfig.drivers"
rsource "./CMSIS/kconfig.CMSIS"
rsource "./components/kconfig.components"
rsource "./devices/kconfig.devices"
rsource "./utilities/kconfig.utilities"
rsource "./middleware/kconfig.middleware"
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.
above list are all needed. but not all middleware is included
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.
since we are not quite clear about the scenario for providing kconfig item up to zephyr, I will hold this kconfig commit and not put this into zephyr integration for now.
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'll note that the case for the name 'kconfig' doesn't follow what I believe to be the standard practice to use 'Kconfig'
# include(driver_flexcomm_usart_freertos) | ||
# include(component_wm8904_adapter) | ||
# include(driver_reset) | ||
mcux_include_as_kconfig(driver_ctimer) |
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.
put header file for each driver in a dedicated folder will make the the compiler seaching each folder again and again, which is not a good practise.
Sorry for the inconvenience, I will split the changes into separate commits. |
b7e0ad4
to
c5ac7e5
Compare
zephyr/Kconfig
Outdated
This option enables the use of NXP MCUXpresso SDK | ||
|
||
if USE_MCUX_SDK | ||
rsource "../Kconfig" |
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.
does Zephyr need use this? if not used by zephyr, need protect with another maco
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.
Thanks for highlighting this, I will hold this kconfig change and not put this into zephyr integration for now.
${CMAKE_CURRENT_LIST_DIR}/../devices/${MCUX_DEVICE} | ||
${CMAKE_CURRENT_LIST_DIR}/../devices/${MCUX_DEVICE}/drivers | ||
${CMAKE_CURRENT_LIST_DIR}/../drivers/common | ||
${CMAKE_CURRENT_LIST_DIR}/../CMSIS/Core/Include |
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.
remove this line
endif() | ||
|
||
#include shared drivers | ||
include_driver_ifdef(CONFIG_ADC_MCUX_LPADC lpadc driver_lpadc) |
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.
each driver in one folder, why do this way?
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.
@hakehuang, I suspect this is because of how we maintain the drivers in the internal repository. We flattened this in the Zephyr NXP HAL but it is probably easier for keeping the external and internal repositories synchronized.
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.
Could the below commit go into mcux-sdk
repo as a separate PR. This way we can have this in the repo without waiting for the Zephyr integration to complete.
zephyr: Fill the device and driver support gap in mcux-sdk
- Add missing device support for K8x, KE18F, KL25Z, KW2x, KW3x and
KW4x. Reuse files in hal_nxp.
- Add lpsci driver which is needed for KL25Z.
Signed-off-by: Susan Su <susan.su@nxp.com>
OK, will create another PR for this. |
components/kconfig.components
Outdated
@@ -0,0 +1,457 @@ | |||
# Copyright 2021 NXP | |||
# SPDX-License-Identifier: BSD-3-Clause |
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.
'Kconfig.components'
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.
Hi David, thanks for the review comments, I have updated this PR to only include only the change needed for zephyr build. For the module kconfig framework, I created another PR in #42, and in this zephyr integration PR currently I am not going to add kconfig items for this module. We need to discuss more on the requirement for the kconfig items for module hal_nxp.
- For device, board support and mcux drivers, change to use that in mcux-sdk offerring. - For middleware, imx drivers and the component drivers, keep using existing enablement in hal-nxp. Signed-off-by: Susan Su <susan.su@nxp.com>
c5ac7e5
to
cdea0b5
Compare
Hi @dleach02, @hakehuang, @mmahadevan108, Hope you had a nice break.
|
}; | ||
|
||
|
||
/* begin of deprecated versions |
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.
why we keep deprcated version?
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 is sourced from the hal_nxp module. https://github.com/zephyrproject-rtos/hal_nxp/blob/master/mcux/components/mcr20a/MCR20Overwrites.h, I agree with your suggestion to put this file to zephyr project.
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.
What is the latest version of this driver called?
Build the status reset controller driver if hwinfo is enabled
add rtadc zephyr driver compiling Signed-off-by: Andrei Ovchinnikov<ovchinnikov@strim-tech.com>
Enabled GPT driver in CMakeLists.txt when the GPT driver is used as a timer within Zephyr Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
I also cherry-picked the commits in hal_nxp master for adding the needed driver/component to cmake build system.
For these bugs will be firstly fixed in our internal develop repo, then deploy to the mcux-sdk, this way ensure the bug is fixed in the source. For the dts change, in current integration we did not include that part so the commit will be dropped. |
for the fix to the MKE1xF CAN_TYPE number of mailboxes, I have an internal jira ticket for this... since this file is generated, it seems like we should understand how this is wrong. |
Closed the PR because we have aligned to keep using hal_nxp to provide NXP HAL support for zephyr. In the approach mcux-sdk is integrated to the existing hal_nxp as subtree to leverage the MCUXpresso SDK driver and device support. The PR to switch Zephyr HAL to use mcux-sdk in hal_nxp has been merged. |
Prerequisites
Describe the pull request
This pull request aims to enable zephyr hal nxp support using current mcux-sdk. Below integration has been done:
simple build test of hello_world has been executed for all RT1xxx boards, RT6xx boards, lpcxpresso54114 and lpcxpresso55s69, shows now build issue.
Fixes # (issue)
Type of change (please delete options that are not relevant):
Tests
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.