Skip to content

UPSTREAM-PEND: drivers: rtc: MSPM0 rtc native register access - #49

Open
Sunil-Hegde wants to merge 10 commits into
TexasInstruments:v4.4.0-ti-nextfrom
Sunil-Hegde:msp_downstream_rtc
Open

Sunil-Hegde wants to merge 10 commits into
TexasInstruments:v4.4.0-ti-nextfrom
Sunil-Hegde:msp_downstream_rtc

Conversation

@Sunil-Hegde

Copy link
Copy Markdown

Convert MSPM0 RTC driver to use native register read/writes
instead of calls to the driver lib.

Improvements and bug fixes over the HAL version:

  • In the set alarm function, Day of Month writes could overwrite
    the values from Day of week value, combined both in to a single
    register write.
  • Introduced an Alarm register struct in order to simplify
    setting alarm registers. Earlier, separate APIs were present for
    getting or setting alarm values for different alarm instances.
  • Earlier alarm callback was called while still holding the
    spinlock which is not safe. Remove callback from inside the
    spinlock.

Depends on #43

@Sunil-Hegde Sunil-Hegde changed the title drivers: rtc: MSPM0 rtc native register access UPSTREAM-PEND: drivers: rtc: MSPM0 rtc native register access Sep 24, 2026
…gis...

PR: 115394

Replace all HAL calls to native register read/writes.
Also, create macros in the same file eliminating the
need for including the driver lib.

This also adds a bug fix to the set alarm functions where
earlier, Day of Month alarm write could overwrite
Day of Week value. Both are combined into a single write to fix
the problem.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
… al...

PR: 115394

Add seperate register struct for Alarm registers in-order to
reduce code duplication for set and get alarm APIs. Earlier,
each alarm had its own APIs which are merged into a single
API and is handled via the alarm id.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
PR: 115394

Add value check for rtc time passed in set alarm API
and allow clearing an alarm via the set API.

Allow alarm callback to be set to null as the existing
Tests suggest.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
…sid...

PR: 115394

In the ISR, the alarm should not be called while still holding the
lock. Therefore, copy the contents to a local alarm struct
inside the lock and callback is triggered once lock is released.

Also, change some functions using k_spinlock_t to use
K_SPINLOCK macro for uniformity.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
PR: 115394

Add RTC as a supported peripheral in the board.yaml

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
PR: 115394

Add RTC as a supported peripheral in the board.yaml

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
PR: 115394

Add RTC node and corresponding interrupt to the MSPM33
base dt.

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
PR: 115394

Add RTC as a supported peripheral in the board.yaml

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
…321a

PR: 115394

Add board overlay for lp_mspm33c321a board

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
… co...

PR: 115394

Add overlays and config files for the following boards to enable
twister tests:
  - lp_mspm0g3519
  - lp_mspm0l2228
  - lp_mspm33c321a

Signed-off-by: Sunil Hegde <s-hegde3@ti.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant