[PATCH v4 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806

Quentin Schulz posted 5 patches 3 months, 1 week ago
.../devicetree/bindings/mfd/rockchip,rk806.yaml     | 21 +++++++++++++++++++++
arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts      |  2 ++
arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi      |  2 ++
arch/arm64/boot/dts/rockchip/rk8xx.h                | 18 ++++++++++++++++++
drivers/mfd/rk8xx-core.c                            | 12 ++++++++++++
include/linux/mfd/rk808.h                           |  2 ++
6 files changed, 57 insertions(+)
[PATCH v4 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806
Posted by Quentin Schulz 3 months, 1 week ago
This allows to customize the PMIC reset method (also called RST_FUN) on
RK806 PMIC from Rockchip, mainly found on RK3588 devices but also on
RK3576.

Finally, this is required on the two RK3588 devices from Theobroma as
U-Boot changes the silicon-default (which is suitable for us) to
something that breaks our companion microcontroller's reboot detection
which breaks a bunch of assumptions in the MCU FW code.

To validate this works on those devices do the following:

On Tiger:
i2cset -y -f 6 0x6f 0x9 0x62
On Jaguar:
i2cset -y -f 0 0x6f 0x9 0x62

You hear a nice (loud :) ) beep, then reboot and it should stop right
before entering U-Boot TPL again.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Changes in v4:
- removed not-so-useful dev_dbg message about missing property,
- unwrapped RK806_RST_FUN_MSK into the line above,
- reworded regmap_update_bits error message according to Lee's
  suggestion,
- Link to v3: https://lore.kernel.org/r/20250618-rk8xx-rst-fun-v3-0-081f02d3d348@cherry.de

Changes in v3:
- (hopefully) fixed missing bitfield.h include in driver as reported by
  Intel's kernel test robot,
- removed dt-binding header file,
- removed mentions to constants that used to be in dt-binding header
  file since they aren't anymore,
- added (patch 3) header file in arch/arm64/boot/dts/rockchip to make
  the value of rockchip,reset-mode easier to understand when reading the
  device tree,
- Link to v2: https://lore.kernel.org/r/20250605-rk8xx-rst-fun-v2-0-143d190596dd@cherry.de

Changes in v2:
- moved rst_fun variable declaration out of the switch-case,
- initialized rst_fun variable to make kernel test robot happy even
  though the variable wouldn't be used uninitialized due to breaking
  before using it,
- renamed rockchip,rst-fun to rockchip,reset-mode
- rewrote rockchip,reset-mode binding description to not mention the
  relation to registers or register values,
- added binding header file to make it easier to understand what the
  mode is when reading a Device Tree without having to read the binding,
- Link to v1: https://lore.kernel.org/r/20250526-rk8xx-rst-fun-v1-0-ea894d9474e0@cherry.de

---
Quentin Schulz (5):
      dt-bindings: mfd: rk806: allow to customize PMIC reset mode
      mfd: rk8xx-core: allow to customize RK806 reset mode
      arm64: dts: rockchip: add header for RK8XX PMIC constants
      arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Jaguar
      arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Tiger

 .../devicetree/bindings/mfd/rockchip,rk806.yaml     | 21 +++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts      |  2 ++
 arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi      |  2 ++
 arch/arm64/boot/dts/rockchip/rk8xx.h                | 18 ++++++++++++++++++
 drivers/mfd/rk8xx-core.c                            | 12 ++++++++++++
 include/linux/mfd/rk808.h                           |  2 ++
 6 files changed, 57 insertions(+)
---
base-commit: b004ef1a3e9210ef9b9092ed8812ab8cc65b10e9
change-id: 20250526-rk8xx-rst-fun-f261c40b6d0c

Best regards,
-- 
Quentin Schulz <quentin.schulz@cherry.de>
Re: (subset) [PATCH v4 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806
Posted by Lee Jones 3 months, 1 week ago
On Fri, 27 Jun 2025 12:53:52 +0200, Quentin Schulz wrote:
> This allows to customize the PMIC reset method (also called RST_FUN) on
> RK806 PMIC from Rockchip, mainly found on RK3588 devices but also on
> RK3576.
> 
> Finally, this is required on the two RK3588 devices from Theobroma as
> U-Boot changes the silicon-default (which is suitable for us) to
> something that breaks our companion microcontroller's reboot detection
> which breaks a bunch of assumptions in the MCU FW code.
> 
> [...]

Applied, thanks!

[1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode
      commit: 1ba8d6e2e2003681fc0a1548c145299d509e352a
[2/5] mfd: rk8xx-core: allow to customize RK806 reset mode
      commit: 2e8185c0f214d45cdbc20ee4e6796c561ba66c55

--
Lee Jones [李琼斯]

Re: (subset) [PATCH v4 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806
Posted by Heiko Stuebner 3 months ago
On Fri, 27 Jun 2025 12:53:52 +0200, Quentin Schulz wrote:
> This allows to customize the PMIC reset method (also called RST_FUN) on
> RK806 PMIC from Rockchip, mainly found on RK3588 devices but also on
> RK3576.
> 
> Finally, this is required on the two RK3588 devices from Theobroma as
> U-Boot changes the silicon-default (which is suitable for us) to
> something that breaks our companion microcontroller's reboot detection
> which breaks a bunch of assumptions in the MCU FW code.
> 
> [...]

Applied, thanks!

[3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants
      commit: 92056b3afde6599f0e125a89c9483bad6930ea85
[4/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Jaguar
      commit: 03b77bbb428250d8359bc76ff5032534d33f8499
[5/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Tiger
      commit: b5c69adb3e27a5d31b733fbfbc32e5f036e21bed

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>