-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
arch: arm: nrf: add hardware description for nrf kconfig files #8363
arch: arm: nrf: add hardware description for nrf kconfig files #8363
Conversation
Purpose of this PR is to allow to display and configure in Kconfig only these drivers that are available for particular SoC. |
Codecov Report
@@ Coverage Diff @@
## master #8363 +/- ##
=======================================
Coverage 64.61% 64.61%
=======================================
Files 421 421
Lines 40296 40296
Branches 6803 6803
=======================================
Hits 26037 26037
Misses 11126 11126
Partials 3133 3133 Continue to review full report at Codecov.
|
@jarz-nordic I think such explanation (why all these config entries are introduced) should be contained in the commit message. And the change in Kconfig.nrfx for serial driver should be mentioned as an example of usage of these entries, or moved to a separate commit. |
@@ -0,0 +1,208 @@ | |||
# Kconfig.peripherals - Nordic Semiconductor nRFx MCU line | |||
# | |||
# Copyright (c) 2018-2018 Nordic Semiconductor ASA |
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.
One 2018 will be sufficient.
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.
fixed
@@ -0,0 +1,208 @@ | |||
# Kconfig.peripherals - Nordic Semiconductor nRFx MCU line |
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 description does not explain much.
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.
changed
@@ -8,15 +8,13 @@ | |||
config SOC_SERIES_NRF52X | |||
bool "Nordic Semiconductor nRF52 series MCU" | |||
select CPU_CORTEX_M4 | |||
select CPU_HAS_FPU |
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 change together with the XIP one should be extracted to a separate commit with an explanation in the commit message why these selects have been moved.
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.
Now there are 3 logical (I hope) commits.
arch/arm/soc/nordic_nrf/Kconfig
Outdated
@@ -15,5 +15,7 @@ config SOC_FAMILY | |||
string | |||
default "nordic_nrf" | |||
|
|||
gsource "arch/arm/soc/nordic_nrf/Kconfig.peripherals" |
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.
A plain source
would do here. gsource
works like an optional include (like -include
in make
) when you don't have any wildcards in the filename.
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.
fixed
6a885b7
to
e2625be
Compare
|
||
config SOC_NRF52840 | ||
depends on SOC_SERIES_NRF52X | ||
bool | ||
select CPU_HAS_FPU | ||
select XIP |
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 XIP is not selected in nRF52832?
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.
nRF52832 does not have QSPI hence does not support XIP
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.
fixed
I was told that this is different XIP. I've created one more configuration parameter:
HAS_HW_NRF_XIP.
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.
gsource
nit fixed.
e2625be
to
73edfa3
Compare
config HAS_HW_NRF_UARTE1 | ||
bool | ||
|
||
config HAS_HW_NRF_USB |
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.
should be USBD
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.
fixed
@@ -11,11 +11,71 @@ depends on SOC_SERIES_NRF51X | |||
|
|||
config SOC_NRF51822_QFAA | |||
bool "NRF51822_QFAA" | |||
select HAS_HW_NRF_CCM |
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.
GPIOTE, ADC missing
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.
fixed
|
||
config SOC_NRF51822_QFAB | ||
bool "NRF51822_QFAB" | ||
select HAS_HW_NRF_CCM |
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.
GPIOTE, ADC missing
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.
fixed
5be0909
to
1e77d3a
Compare
config HAS_HW_NRF_WDT | ||
bool | ||
|
||
config HAS_HW_NRF_XIP |
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 far as I understand, this has been added to describe the QSPI peripheral that exists in nrf52840, which provides the capability to execute-in-place from external flash.
My concern is that all the above Kconfig definitions have names that directly map to the peripheral names of nrf52840 (as defined in the nRF product specification), except for this one. To be consistent, I think we should rename this to something like HAS_HW_NRF_QSPI.
select CPU_HAS_MPU | ||
select SOC_FAMILY_NRF | ||
select NRF_RTC_TIMER | ||
select CLOCK_CONTROL | ||
select CLOCK_CONTROL_NRF5 | ||
select SYS_POWER_LOW_POWER_STATE_SUPPORTED | ||
select SYS_POWER_DEEP_SLEEP_SUPPORTED | ||
select XIP |
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.
just for the sake of simplicity, could you revert this change (i.e. add and remove XIP in different lines)?
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.
Some minor requested changes
This is duplicate from information available in device tree. |
Hi, There is an ogoing discussion how to solve it in future: |
56c1f5b
to
f128104
Compare
Fixed changes requested by @ioannisg |
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.
Looks good.
But I think it would be more adequate to start the titles of the first two commits with "arch: nrf:" instead of "drivers: all:".
@jarz-nordic
Thanks for explanation (it would have been useful to detail in initial PR description, but ok). |
Looks good. |
897f73e
to
aefba9f
Compare
I've changed prefix to: arch: arm: nrf: |
Created NRF5x peripheral list that can be used to describe each NRF5x SoC. Basing on this description Kconfig file can display and allow to configure only these drivers that are available for particular SoC. Signed-off-by: Jakub Rzeszutko <[email protected]>
Configuration parameter SOC_SERIES_NRF52X is common for all NRF5X SoCs. Due to that it cannot select: CPU_HAS_FPU because not all Nordic microcontrollers supports that. Selection of this parameter was moved to configuration of each SoC in Kconfig.soc file. Signed-off-by: Jakub Rzeszutko <[email protected]>
Condition: depends on ((SOC_SERIES_NRF52X || SOC_SERIES_NRF51X) && (!SOC_NRF52810)) for displaing configuration for UART0 peripheral has been replaced with: depends on HAS_HW_NRF_UART0. Signed-off-by: Jakub Rzeszutko <[email protected]>
66c5bc0
to
06e7ed5
Compare
@erwango @tbursztyka @galak This tries to address the lack of DTS data availability decribed here by listing the hardware support in Kconfig in parallel to DTS. I personally think it's a compromise until #7302 has been addressed properly, but I want to ask your opinion as well. |
My personal point of view is that Kconfig symbols to describe HW are duplicate information vs what should be extracted from dts. #7302 might eventually output to generation of some symbols that could then be used in Kconfig space. |
This PR has the purpose of
It is reasonable to expect this from the configuration system. Duplicating information between DTS and Kconfig seems reasonable to me until #7302 is resolved. |
@MaureenHelm Does the NXP hardware support use a similar approach to this? |
@jarz-nordic could we make some of those common to all drivers instead of them being Nordic-specific? |
I've defined some HAS_* configs in |
@MaureenHelm thanks for the input. I spoke to @nashif and I think we need to reconsider this. It might take a while until we get a proper way to obtain DT info from Kconfig, so in the meantime we could have a set of generic peripheral Kconfig options (eg. |
There are a few cases in the Kinetis family where we have multiple variants of a given peripheral type (e.g., SPI, DSPI, LPSPI), so it isn't sufficient to define a generic peripheral Kconfig option like |
It should be ok to define HAS_HW_DSPI and HAS_HW_LPSPI which can be used by other vendors if they support them. I know some of those would be vendor specific and only one vendor might have them, but at least in this case it is consistent and safe for future support. What I dislike is having those (many) HAS_HW_XXX defined for every vendor individually. |
I would not put this in dts/ and make it appear as a DTS thing, DTS does nothing with those configs, at some point when move this decision to DTS we can make the change and remove them all hopefully. Waiting to hear from the participants of the meeting last week where DTS in general was discussed @erwango , @galak , @tbursztyka |
What is wrong about having such file by each vendor individually? In my opinion one file with peripheral list containing all vendors and all possible peripheral variants will make developers work more difficult. @carlescufi : generic list of peripherals like HAS_HW_ADC is not enough for us. Some SoCs have ADC other SAADC only, some have SPI other SPIM or both. The best example is with nrf52840. |
I'm not sure if this all should be in common kconfig with the list of all possible options when in many cases names may be unique to vendor. It will generate long list and when vendor will be adding new peripheral it will require change to common file. Let say that there is LPUART which is low power UART, but other vendor has LEUART which is low energy uart. Should it use LPUART or create LEUART in common list. If LPUART is used it may confuse somebody because there will be kconfigs like: config LEUART0_ENABLE Additionally, we might want to not only put peripherals there but also specific features in those peripherals. Example: SPI in device X has max speed 4M and in device Y has 8M. I want to limit menu for those instances of SPI which do not support 8M. That i can to by creating flag like HAS_HW_SPI3_8M. Such flag do not belong to generic, common file for sure. Summarizing, I think that each vendor should has own list of peripherals/features since those will be used only in Kconfig specific to that vendor and nowhere else. |
Merging but keeping track of this in #8481 |
Simplify Kconfig.nrfx for serial to use HAS_HW_NRF_UART0.
Signed-off-by: Jakub Rzeszutko [email protected]