Skip to content

Add rpipmic - #207

Open
JamesH65 wants to merge 2 commits into
masterfrom
add_rpipmic
Open

JamesH65 wants to merge 2 commits into
masterfrom
add_rpipmic

Conversation

@JamesH65

Copy link
Copy Markdown
Collaborator

Quick utility to make PMIC events human readable.

Comment thread rpipmic/rpipmic Outdated
exit 1
fi

raw_output=$(vcgencmd pmicrd "$REG_ADDR")

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 bootloader clears fatal PMIC events at power on. You'd need to read them from

/proc/device-tree/chosen/power/power_reset

Comment thread rpipmic/rpipmic Outdated
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
#
# Reads the PMIC EVT status register via vcgencmd and reports any

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.

This is specific to the PMIC on Pi5.

vcgencmd pmicrd and pmicwr may well get deleted, but I think we'd probably need to replace them with a mailbox.

The bootloader clears fatal PMIC events at power on, so read the reset
reason from /proc/device-tree/chosen/power/power_reset. Refuse to run on
anything other than BCM2712 as the PMIC is Pi 5 specific, and treat the
vcgencmd pmicrd read as optional since it may be removed.
@popcornmix

Copy link
Copy Markdown
Contributor

Added a commit addressing the review comments:

  • The fatal PMIC reset reason is now read from /proc/device-tree/chosen/power/power_reset (the bootloader clears those events at power on).
  • The script now refuses to run on anything other than BCM2712, as the PMIC is Pi 5 specific.
  • Reading register 0x3018 with vcgencmd pmicrd is now optional: if it is missing or fails, the script warns and carries on, in case that command is removed.

@popcornmix

Copy link
Copy Markdown
Contributor

@timg236 does this address your issues? Note: wants a "squash and merge"

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