Skip to content

hal/armv7r/zynqmp/zynqmp.c: update reboot reason lockstep and wdt#432

Merged
kber-ps merged 1 commit into
masterfrom
kber/zynqmp_rpu_wdg
Jul 13, 2026
Merged

hal/armv7r/zynqmp/zynqmp.c: update reboot reason lockstep and wdt#432
kber-ps merged 1 commit into
masterfrom
kber/zynqmp_rpu_wdg

Conversation

@kber-ps

@kber-ps kber-ps commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR introduces better reboot reason investigation for ZynqMP RPU (ARMV7r) target.

Description

PMU_ERROR_STATUS registers are examined during reboot reason investigation.
Once read both regs are clear to ensure erroneous reset is not trigger during lock step or watchdog configuration.

Motivation and Context

Change is introduced to ensure Watchdog handlers for ZynqMP RPU are properly configures.
There was also intention to ensure the lock step vs watchdog reboot info is also available to user.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (refactoring, style fixes, git/CI config, submodule management, no code logic changes)

How Has This Been Tested?

  • Already covered by automatic testing.
  • New test added: (add PR link here).
  • Tested by hand on: (list targets here).

Tests are described in:
phoenix-rtos/phoenix-rtos-kernel#789

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing linter checks and tests passed.
  • My changes generate no new compilation warnings for any of the targets.

Special treatment

  • This PR needs additional PRs to work (list the PRs, preferably in merge-order).
  • I will merge this PR by myself when appropriate.

phoenix-rtos/phoenix-rtos-kernel#789

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for storing and clearing latched PMU error status registers during initialization on ZynqMP, specifically for RPU lockstep and LPD watchdog errors. The review feedback identifies two critical issues: first, a duplicate read of crl_apb_reset_reason overwrites and erases the previously retrieved reset flags; second, the watchdog timeout check uses the incorrect constant (ZYNQ_RESET_REASON_LPD_SWDT instead of PMU_ERR_LPD_SWDT) and hardcodes the flag value 0x20000 instead of using the defined macro.

Comment thread hal/armv7r/zynqmp/zynqmp.c
Comment thread hal/armv7r/zynqmp/zynqmp.c Outdated

@damianloew damianloew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please address the comments, they seem to be valid

@damianloew damianloew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current commit message is readable, but let's follow the rules from Git Commit Message Guidelines [YT]

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Unit Test Results

10 890 tests  ±0   10 220 ✅ ±0   52m 52s ⏱️ -54s
   680 suites ±0      670 💤 ±0 
     1 files   ±0        0 ❌ ±0 

Results for commit 3b88ec4. ± Comparison against base commit 23171e3.

♻️ This comment has been updated with latest results.

@kber-ps

kber-ps commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

@damianloew I fixed issues raised in review and also update the commit message so it complies now with Git Commit Message Guidelines [YT]

@kber-ps
kber-ps force-pushed the kber/zynqmp_rpu_wdg branch from c633efb to 8dd2097 Compare July 10, 2026 15:05
@kber-ps

kber-ps commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Manual test post fix:

image

Figure 1
0x00000001 - this is properly recognized Power On Reset
0x00020004 - this is properly recognized watchdog reset

image Figure 2 0x00000020 - this is properly recognized Software Reset

@damianloew

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for reading, storing, and clearing latched PMU error status registers during ZynqMP initialization, specifically for RPU lockstep and LPD watchdog timer errors. The review feedback notes that using an else if condition prevents both independent error flags from being captured if they occur simultaneously, and suggests using separate if statements instead.

Comment thread hal/armv7r/zynqmp/zynqmp.c
@kber-ps kber-ps changed the title ZynqMP RPU PMU error status handlers for reboot reason hal/armv7r/zynqmp/zynqmp.c: update reboot reason lockstep and wdt Jul 10, 2026

@damianloew damianloew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks for all of the changes

@julianuziemblo julianuziemblo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, please rebase

PMU_ERROR_STATUS registers are examined during reboot reason
investigation. Once read both regs are clear to ensure erroneous
reset is not trigger during lock step or watchdog configuration.

Functional working has been confirmed on ZCU104 board with
watchdog and soft reset.

YT: DO-836
@kber-ps
kber-ps force-pushed the kber/zynqmp_rpu_wdg branch from 8dd2097 to 3b88ec4 Compare July 10, 2026 16:26
@kber-ps
kber-ps merged commit 507e363 into master Jul 13, 2026
47 checks passed
@kber-ps
kber-ps deleted the kber/zynqmp_rpu_wdg branch July 13, 2026 10:59
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.

3 participants