Skip to content

Conversation

@bogdanovs
Copy link
Contributor

Add hwinfo support for get_reset_cause and get_supported_reset_cause.

Datasheet: https://www.ti.com/lit/ds/symlink/cc2340r5.pdf

@github-actions github-actions bot added the area: HWINFO Hardware Information Driver label May 6, 2025
@github-actions github-actions bot requested a review from alexanderwachter May 6, 2025 03:59
@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-hwinfo branch from a53fe97 to 2f3f683 Compare May 6, 2025 05:55
Copy link
Member

@alexanderwachter alexanderwachter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kartben kartben requested a review from Copilot May 6, 2025 09:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds hardware info support for the cc23x0 family by implementing two new functions to retrieve supported reset causes and the current reset cause for the device.

  • Introduces z_impl_hwinfo_get_supported_reset_cause with combined bit flags.
  • Implements z_impl_hwinfo_get_reset_cause using PMCTLGetResetReason() and a switch-case.
Files not reviewed (2)
  • drivers/hwinfo/CMakeLists.txt: Language not supported
  • drivers/hwinfo/Kconfig: Language not supported

kartben
kartben previously approved these changes May 6, 2025
case PMCTL_RESET_LOCKUP:
*cause = RESET_CPU_LOCKUP;
break;
default:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe a few more reset causes are supported:

  • PMCTL_RESET_LFXT (LFXT clock loss) for RESET_CLOCK
  • PMCTL_RESET_SYSTEM (Software triggered reset) for RESET_SOFTWARE
  • PMCTL_RESET_TSD (Device woke up from thermal shutdown after temperature drop) for RESET_TEMPERATURE
  • PMCTL_RESET_SWD (Device reset triggered by Serial Wire Debug reset event) for RESET_DEBUG

Copy link
Contributor Author

@bogdanovs bogdanovs May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • PMCTL_RESET_LFXT (LFXT clock loss) for RESET_CLOCK

I was not exactly sure , if this case is exact match. If you think it is I am adding it.

  • PMCTL_RESET_SYSTEM (Software triggered reset) for RESET_SOFTWARE

This is already implemented

  • PMCTL_RESET_TSD (Device woke up from thermal shutdown after temperature drop) for RESET_TEMPERATURE

I was not exactly sure , if this case is exact match. If you think it is I am adding it.

  • PMCTL_RESET_SWD (Device reset triggered by Serial Wire Debug reset event) for RESET_DEBUG

Missed it because there was already SWD case - added now.

@bogdanovs bogdanovs dismissed stale reviews from kartben and alexanderwachter via 230446a May 7, 2025 14:53
@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-hwinfo branch from 6b92c02 to 230446a Compare May 7, 2025 14:53
@bogdanovs
Copy link
Contributor Author

Added couple more supported reset reasons as requested.

PR is rebased and on latest main , since force push was required.

Add support for get_reset_cause and get_supported_reset_cause.

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
@bogdanovs bogdanovs force-pushed the baylibre/upstream-cc23x0-hwinfo branch from 230446a to 1e52d3e Compare May 8, 2025 09:51
Copy link
Member

@alexanderwachter alexanderwachter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kartben kartben merged commit f1b4c12 into zephyrproject-rtos:main May 14, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: HWINFO Hardware Information Driver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants