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
drivers: rtc: support for Nuvoton numaker m46x #71929
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. |
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.
Have you run the RTC API test suite? Looking at the code I think there may be some inconsistencies with the API, running the test suite is good at identifying them if they exist :)
config HAS_NUMAKER_RTC | ||
bool "NuMaker RTC" | ||
help | ||
Enable Nuvoton RTC HAL module driver |
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.
You may be interested in asking DTS whether you have your RTC enabled, for example the way we do that for Nordic:
zephyr/modules/hal_nordic/nrfx/Kconfig
Lines 268 to 274 in 2765d23
config NRFX_RTC | |
bool | |
config NRFX_RTC0 | |
bool "RTC0 driver instance" | |
depends on $(dt_nodelabel_has_compat,rtc0,$(DT_COMPAT_NORDIC_NRF_RTC)) | |
select NRFX_RTC |
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 of your suggestion.
My opinion is: hal is to support zephyr driver. So, Kconfig.numaker of zephyr rtc driver will asking DTS and select rtc's hal config.
select HAS_NUMAKER_RTC | ||
depends on DT_HAS_NUVOTON_NUMAKER_RTC_ENABLED |
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.
If you take my comment https://github.com/zephyrproject-rtos/zephyr/pull/71929/files#r1579753122 into account, then you can have the select
replaced with depends on
and the depends on DT_HAS_NUVOTON_NUMAKER_RTC_ENABLED
can be removed.
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 of your opinion, DT_HAS_xx is asking DTS, and my thinking is like as:
Kconfig.nrfx:
config SPI_NRFX_SPI
def_bool y
depends on DT_HAS_NORDIC_NRF_SPI_ENABLED
select NRFX_SPI0 if HAS_HW_NRF_SPI0
Add Nuvoton numaker RTC driver including RTC alarm feature. Signed-off-by: cyliang tw <cyliang@nuvoton.com>
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 :)
This PR is to add Nuvoton numaker RTC driver including RTC alarm feature for M46x series.