-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Enable rtc on rt700 #93006
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
base: main
Are you sure you want to change the base?
Enable rtc on rt700 #93006
Conversation
c1b3d9c
to
55a2226
Compare
samples/drivers/rtc/src/main.c
Outdated
@@ -11,6 +11,7 @@ | |||
|
|||
const struct device *const rtc = DEVICE_DT_GET(DT_ALIAS(rtc)); | |||
|
|||
#if !(DT_PROP(DT_ALIAS(rtc), share_counter)) |
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 can not go in a common sample, board/soc specific logic stays with the board/soc, if really needed, in a board specific sample in samples/boards/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.
Updated. Move the #if (DT_PROP(DT_ALIAS(rtc), share_counter))
into rtc_nxp_irtc.c nxp_irtc_set_time
function. Please review.
dts/bindings/rtc/nxp,irtc.yaml
Outdated
share-counter: | ||
type: boolean | ||
description: | | ||
This slave irtc instance shares the data and time counters of the master irtc instance. | ||
This means the code cannot set the data and time counters, but can only read them. |
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 property should be enforced on the driver level, by implementing the set_time API like
static int set_time_not_perm(const struct device *dev, const struct rtc_time *timeptr)
{
ARG_UNUSED(timeptr);
return -EPERM;
}
static DEVICE_API(...) = {
.set_time = set_time_not_perm,
...
};
the sample does not need to be updated, it will correclty print "Cannot write date time: -1"
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.
Updated, please review.
1. Update nxp irtc driver to fix issue in init and alarm function. 2. Update RTC device tree binding to support "share-counter". 3. Update RT700 dtsi to support rtc0 for cpu0 and rtc1 for cpu1. 4. Update readme. Signed-off-by: Holt.Sun <holt.sun@nxp.com>
1. Update overlay and project conf for RT700. 2. Update test_alarm.c to disable RTC irq so that callback function won't be called to clear the pending interrupt. Signed-off-by: Holt.Sun <holt.sun@nxp.com>
55a2226
to
620191f
Compare
|
Updated rtc driver to support NXP RT700.
Enable rt700 RTC unittest.