* [PATCH v3 1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode
2025-06-18 10:32 [PATCH v3 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806 Quentin Schulz
@ 2025-06-18 10:32 ` Quentin Schulz
2025-06-19 9:54 ` Krzysztof Kozlowski
2025-06-18 10:32 ` [PATCH v3 2/5] mfd: rk8xx-core: allow to customize RK806 " Quentin Schulz
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2025-06-18 10:32 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel
Cc: Lukasz Czechowski, Daniel Semkowicz, Nicolas Frattaroli,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
The RK806 PMIC allows to configure its reset/restart behavior whenever
the PMIC is reset either programmatically or via some external pins
(e.g. PWRCTRL or RESETB).
The following modes exist:
- 0; restart PMU,
- 1; reset all power off reset registers and force state to switch to
ACTIVE mode,
- 2; same as mode 1 and also pull RESETB pin down for 5ms,
For example, some hardware may require a full restart (mode 0) in order
to function properly as regulators are shortly interrupted in this mode.
This is the case for RK3588 Jaguar and RK3588 Tiger which have a
companion microcontroller running on an independent power supply and
monitoring the PMIC power rail to know the state of the main system.
When it detects a restart, it resets its own IPs exposed to the main
system as if to simulate its own reset. Failing to perform this fake
reset of the microcontroller may break things (e.g. watchdog not
automatically disabled, buzzer still running until manually disabled,
leftover configuration from previous main system state, etc...).
Some other systems may be depending on the power rails to not be
interrupted even for a small amount of time[1].
This allows to specify how the PMIC should perform on the hardware level
and may differ between harwdare designs, so a DT property seems
warranted. I unfortunately do not see how this could be made generic
enough to make it a non-vendor property.
[1] https://lore.kernel.org/linux-rockchip/2577051.irdbgypaU6@workhorse/
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
.../devicetree/bindings/mfd/rockchip,rk806.yaml | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
index 3c2b06629b75ea94f90712470bf14ed7fc16d68d..eb5bca31948ef0d39c46025d0cca65b8b4105a50 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
@@ -31,6 +31,27 @@ properties:
system-power-controller: true
+ rockchip,reset-mode:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1, 2]
+ description:
+ Mode to use when a reset of the PMIC is triggered.
+
+ The reset can be triggered either programmatically, via one of
+ the PWRCTRL pins (provided additional configuration) or
+ asserting RESETB pin low.
+
+ The following modes are supported
+
+ - 0; restart PMU,
+ - 1; reset all power off reset registers and force state to
+ switch to ACTIVE mode,
+ - 2; same as mode 1 and also pull RESETB pin down for 5ms,
+
+ For example, some hardware may require a full restart (mode 0)
+ in order to function properly as regulators are shortly
+ interrupted in this mode.
+
vcc1-supply:
description:
The input supply for dcdc-reg1.
--
2.49.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode
2025-06-18 10:32 ` [PATCH v3 1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode Quentin Schulz
@ 2025-06-19 9:54 ` Krzysztof Kozlowski
0 siblings, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2025-06-19 9:54 UTC (permalink / raw)
To: Quentin Schulz
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel, Lukasz Czechowski,
Daniel Semkowicz, Nicolas Frattaroli, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, Quentin Schulz
On Wed, Jun 18, 2025 at 12:32:40PM GMT, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> The RK806 PMIC allows to configure its reset/restart behavior whenever
> the PMIC is reset either programmatically or via some external pins
> (e.g. PWRCTRL or RESETB).
>
> The following modes exist:
> - 0; restart PMU,
> - 1; reset all power off reset registers and force state to switch to
> ACTIVE mode,
> - 2; same as mode 1 and also pull RESETB pin down for 5ms,
>
> For example, some hardware may require a full restart (mode 0) in order
> to function properly as regulators are shortly interrupted in this mode.
>
> This is the case for RK3588 Jaguar and RK3588 Tiger which have a
> companion microcontroller running on an independent power supply and
> monitoring the PMIC power rail to know the state of the main system.
> When it detects a restart, it resets its own IPs exposed to the main
> system as if to simulate its own reset. Failing to perform this fake
> reset of the microcontroller may break things (e.g. watchdog not
> automatically disabled, buzzer still running until manually disabled,
> leftover configuration from previous main system state, etc...).
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 2/5] mfd: rk8xx-core: allow to customize RK806 reset mode
2025-06-18 10:32 [PATCH v3 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806 Quentin Schulz
2025-06-18 10:32 ` [PATCH v3 1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode Quentin Schulz
@ 2025-06-18 10:32 ` Quentin Schulz
2025-06-26 13:12 ` Lee Jones
2025-06-18 10:32 ` [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants Quentin Schulz
` (2 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2025-06-18 10:32 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel
Cc: Lukasz Czechowski, Daniel Semkowicz, Nicolas Frattaroli,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
The RK806 PMIC has a bitfield for configuring the restart/reset behavior
(which I assume Rockchip calls "function") whenever the PMIC is reset
either programmatically (c.f. DEV_RST in the datasheet) or via PWRCTRL
or RESETB pins.
For RK806, the following values are possible for RST_FUN:
0b00 means "restart PMU"
0b01 means "Reset all the power off reset registers, forcing
the state to switch to ACTIVE mode"
0b10 means "Reset all the power off reset registers, forcing
the state to switch to ACTIVE mode, and simultaneously
pull down the RESETB PIN for 5mS before releasing"
0b11 means the same as for 0b10 just above.
This adds the appropriate logic in the driver to parse the new
rockchip,reset-mode DT property to pass this information. It just
happens that the values in the binding match the values to write in the
bitfield so no mapping is necessary.
If it is missing, the register is left untouched and relies either on
the silicon default or on whatever was set earlier in the boot stages
(e.g. the bootloader).
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
drivers/mfd/rk8xx-core.c | 15 +++++++++++++++
include/linux/mfd/rk808.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
index 71c2b80a4678d627e86cfbec8135f08e262559d3..23ff92f89f3357e3f47c5dd0e9f80cca453f22c0 100644
--- a/drivers/mfd/rk8xx-core.c
+++ b/drivers/mfd/rk8xx-core.c
@@ -10,6 +10,7 @@
* Author: Wadim Egorov <w.egorov@phytec.de>
*/
+#include <linux/bitfield.h>
#include <linux/interrupt.h>
#include <linux/mfd/rk808.h>
#include <linux/mfd/core.h>
@@ -699,6 +700,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
const struct mfd_cell *cells;
int dual_support = 0;
int nr_pre_init_regs;
+ u32 rst_fun = 0;
int nr_cells;
int ret;
int i;
@@ -726,6 +728,19 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
cells = rk806s;
nr_cells = ARRAY_SIZE(rk806s);
dual_support = IRQF_SHARED;
+
+ ret = device_property_read_u32(dev, "rockchip,reset-mode", &rst_fun);
+ if (ret) {
+ dev_dbg(dev,
+ "rockchip,reset-mode property missing, not setting RST_FUN\n");
+ break;
+ }
+
+ ret = regmap_update_bits(rk808->regmap, RK806_SYS_CFG3,
+ RK806_RST_FUN_MSK,
+ FIELD_PREP(RK806_RST_FUN_MSK, rst_fun));
+ if (ret)
+ return dev_err_probe(dev, ret, "RST_FUN write err\n");
break;
case RK808_ID:
rk808->regmap_irq_chip = &rk808_irq_chip;
diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
index 69cbea78b430b562a23d995263369d475daa6287..28170ee08898ca59c76a741a1d42763a42b72380 100644
--- a/include/linux/mfd/rk808.h
+++ b/include/linux/mfd/rk808.h
@@ -812,6 +812,8 @@ enum rk806_pin_dr_sel {
#define RK806_INT_POL_H BIT(1)
#define RK806_INT_POL_L 0
+/* SYS_CFG3 */
+#define RK806_RST_FUN_MSK GENMASK(7, 6)
#define RK806_SLAVE_RESTART_FUN_MSK BIT(1)
#define RK806_SLAVE_RESTART_FUN_EN BIT(1)
#define RK806_SLAVE_RESTART_FUN_OFF 0
--
2.49.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 2/5] mfd: rk8xx-core: allow to customize RK806 reset mode
2025-06-18 10:32 ` [PATCH v3 2/5] mfd: rk8xx-core: allow to customize RK806 " Quentin Schulz
@ 2025-06-26 13:12 ` Lee Jones
0 siblings, 0 replies; 11+ messages in thread
From: Lee Jones @ 2025-06-26 13:12 UTC (permalink / raw)
To: Quentin Schulz
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
Sebastian Reichel, Lukasz Czechowski, Daniel Semkowicz,
Nicolas Frattaroli, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz
On Wed, 18 Jun 2025, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> The RK806 PMIC has a bitfield for configuring the restart/reset behavior
> (which I assume Rockchip calls "function") whenever the PMIC is reset
> either programmatically (c.f. DEV_RST in the datasheet) or via PWRCTRL
> or RESETB pins.
>
> For RK806, the following values are possible for RST_FUN:
>
> 0b00 means "restart PMU"
"Restart PMU"
> 0b01 means "Reset all the power off reset registers, forcing
> the state to switch to ACTIVE mode"
> 0b10 means "Reset all the power off reset registers, forcing
> the state to switch to ACTIVE mode, and simultaneously
> pull down the RESETB PIN for 5mS before releasing"
> 0b11 means the same as for 0b10 just above.
>
> This adds the appropriate logic in the driver to parse the new
> rockchip,reset-mode DT property to pass this information. It just
> happens that the values in the binding match the values to write in the
> bitfield so no mapping is necessary.
>
> If it is missing, the register is left untouched and relies either on
> the silicon default or on whatever was set earlier in the boot stages
> (e.g. the bootloader).
>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
> drivers/mfd/rk8xx-core.c | 15 +++++++++++++++
> include/linux/mfd/rk808.h | 2 ++
> 2 files changed, 17 insertions(+)
>
> diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
> index 71c2b80a4678d627e86cfbec8135f08e262559d3..23ff92f89f3357e3f47c5dd0e9f80cca453f22c0 100644
> --- a/drivers/mfd/rk8xx-core.c
> +++ b/drivers/mfd/rk8xx-core.c
> @@ -10,6 +10,7 @@
> * Author: Wadim Egorov <w.egorov@phytec.de>
> */
>
> +#include <linux/bitfield.h>
> #include <linux/interrupt.h>
> #include <linux/mfd/rk808.h>
> #include <linux/mfd/core.h>
> @@ -699,6 +700,7 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
> const struct mfd_cell *cells;
> int dual_support = 0;
> int nr_pre_init_regs;
> + u32 rst_fun = 0;
> int nr_cells;
> int ret;
> int i;
> @@ -726,6 +728,19 @@ int rk8xx_probe(struct device *dev, int variant, unsigned int irq, struct regmap
> cells = rk806s;
> nr_cells = ARRAY_SIZE(rk806s);
> dual_support = IRQF_SHARED;
> +
> + ret = device_property_read_u32(dev, "rockchip,reset-mode", &rst_fun);
> + if (ret) {
> + dev_dbg(dev,
> + "rockchip,reset-mode property missing, not setting RST_FUN\n");
I suggest that this debug message is not that useful and can be removed.
> + break;
> + }
> +
> + ret = regmap_update_bits(rk808->regmap, RK806_SYS_CFG3,
> + RK806_RST_FUN_MSK,
Place on the line above?
> + FIELD_PREP(RK806_RST_FUN_MSK, rst_fun));
> + if (ret)
> + return dev_err_probe(dev, ret, "RST_FUN write err\n");
Failed to configure requested restart/reset behavior"
> break;
> case RK808_ID:
> rk808->regmap_irq_chip = &rk808_irq_chip;
> diff --git a/include/linux/mfd/rk808.h b/include/linux/mfd/rk808.h
> index 69cbea78b430b562a23d995263369d475daa6287..28170ee08898ca59c76a741a1d42763a42b72380 100644
> --- a/include/linux/mfd/rk808.h
> +++ b/include/linux/mfd/rk808.h
> @@ -812,6 +812,8 @@ enum rk806_pin_dr_sel {
> #define RK806_INT_POL_H BIT(1)
> #define RK806_INT_POL_L 0
>
> +/* SYS_CFG3 */
> +#define RK806_RST_FUN_MSK GENMASK(7, 6)
> #define RK806_SLAVE_RESTART_FUN_MSK BIT(1)
> #define RK806_SLAVE_RESTART_FUN_EN BIT(1)
> #define RK806_SLAVE_RESTART_FUN_OFF 0
>
> --
> 2.49.0
>
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants
2025-06-18 10:32 [PATCH v3 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806 Quentin Schulz
2025-06-18 10:32 ` [PATCH v3 1/5] dt-bindings: mfd: rk806: allow to customize PMIC reset mode Quentin Schulz
2025-06-18 10:32 ` [PATCH v3 2/5] mfd: rk8xx-core: allow to customize RK806 " Quentin Schulz
@ 2025-06-18 10:32 ` Quentin Schulz
2025-06-19 15:51 ` Sebastian Reichel
2025-06-18 10:32 ` [PATCH v3 4/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Jaguar Quentin Schulz
2025-06-18 10:32 ` [PATCH v3 5/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Tiger Quentin Schulz
4 siblings, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2025-06-18 10:32 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel
Cc: Lukasz Czechowski, Daniel Semkowicz, Nicolas Frattaroli,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
To make it easier to read the device tree, let's add constants for the
rockchip,reset-mode property values that are currently only applicable
to RK806 PMIC.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
arch/arm64/boot/dts/rockchip/rk8xx.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk8xx.h b/arch/arm64/boot/dts/rockchip/rk8xx.h
new file mode 100644
index 0000000000000000000000000000000000000000..a6fbef71c06493c35b0f3697476167aaafa24f30
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk8xx.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) */
+/*
+ * Device Tree defines for Rockchip RK8xx PMICs
+ *
+ * Copyright 2025 Cherry Embedded Solutions GmbH
+ *
+ * Author: Quentin Schulz <quentin.schulz@cherry.de>
+ */
+
+#ifndef _DT_MFD_ROCKCHIP_RK8XX_H
+#define _DT_MFD_ROCKCHIP_RK8XX_H
+
+/* For use with rockchip,reset-mode property */
+#define RK806_RESTART 0
+#define RK806_RESET 1
+#define RK806_RESET_NOTIFY 2
+
+#endif
--
2.49.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants
2025-06-18 10:32 ` [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants Quentin Schulz
@ 2025-06-19 15:51 ` Sebastian Reichel
2025-06-23 9:48 ` Quentin Schulz
0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Reichel @ 2025-06-19 15:51 UTC (permalink / raw)
To: Quentin Schulz
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Lukasz Czechowski, Daniel Semkowicz,
Nicolas Frattaroli, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, Quentin Schulz
[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]
Hi,
On Wed, Jun 18, 2025 at 12:32:42PM +0200, Quentin Schulz wrote:
> From: Quentin Schulz <quentin.schulz@cherry.de>
>
> To make it easier to read the device tree, let's add constants for the
> rockchip,reset-mode property values that are currently only applicable
> to RK806 PMIC.
>
> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> ---
> arch/arm64/boot/dts/rockchip/rk8xx.h | 18 ++++++++++++++++++
I think this header should be in include/dt-bindings/, otherwise the
series LGTM.
Greetings,
-- Sebastian
> 1 file changed, 18 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk8xx.h b/arch/arm64/boot/dts/rockchip/rk8xx.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..a6fbef71c06493c35b0f3697476167aaafa24f30
> --- /dev/null
> +++ b/arch/arm64/boot/dts/rockchip/rk8xx.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: (GPL-2.0-or-later OR MIT) */
> +/*
> + * Device Tree defines for Rockchip RK8xx PMICs
> + *
> + * Copyright 2025 Cherry Embedded Solutions GmbH
> + *
> + * Author: Quentin Schulz <quentin.schulz@cherry.de>
> + */
> +
> +#ifndef _DT_MFD_ROCKCHIP_RK8XX_H
> +#define _DT_MFD_ROCKCHIP_RK8XX_H
> +
> +/* For use with rockchip,reset-mode property */
> +#define RK806_RESTART 0
> +#define RK806_RESET 1
> +#define RK806_RESET_NOTIFY 2
> +
> +#endif
>
> --
> 2.49.0
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants
2025-06-19 15:51 ` Sebastian Reichel
@ 2025-06-23 9:48 ` Quentin Schulz
2025-06-25 1:26 ` Sebastian Reichel
0 siblings, 1 reply; 11+ messages in thread
From: Quentin Schulz @ 2025-06-23 9:48 UTC (permalink / raw)
To: Sebastian Reichel, Quentin Schulz
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Lukasz Czechowski, Daniel Semkowicz,
Nicolas Frattaroli, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
Hi Sebastian,
On 6/19/25 5:51 PM, Sebastian Reichel wrote:
> Hi,
>
> On Wed, Jun 18, 2025 at 12:32:42PM +0200, Quentin Schulz wrote:
>> From: Quentin Schulz <quentin.schulz@cherry.de>
>>
>> To make it easier to read the device tree, let's add constants for the
>> rockchip,reset-mode property values that are currently only applicable
>> to RK806 PMIC.
>>
>> Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
>> ---
>> arch/arm64/boot/dts/rockchip/rk8xx.h | 18 ++++++++++++++++++
>
> I think this header should be in include/dt-bindings/, otherwise the
v2 did that and the feedback from dt-binding people was they didn't want
(as far as I understood) unused constants as ABI[1][2].
[1]
https://lore.kernel.org/all/704d75df-a484-4da3-9bcb-85b480e2ecf0@kernel.org/
[2]
https://lore.kernel.org/all/a9baf6b0-b668-4d10-b9de-b63eb3fd8f23@kernel.org/
Cheers,
Quentin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants
2025-06-23 9:48 ` Quentin Schulz
@ 2025-06-25 1:26 ` Sebastian Reichel
0 siblings, 0 replies; 11+ messages in thread
From: Sebastian Reichel @ 2025-06-25 1:26 UTC (permalink / raw)
To: Quentin Schulz
Cc: Quentin Schulz, Lee Jones, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Heiko Stuebner, Lukasz Czechowski, Daniel Semkowicz,
Nicolas Frattaroli, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1514 bytes --]
Hi,
On Mon, Jun 23, 2025 at 11:48:27AM +0200, Quentin Schulz wrote:
> On 6/19/25 5:51 PM, Sebastian Reichel wrote:
> > On Wed, Jun 18, 2025 at 12:32:42PM +0200, Quentin Schulz wrote:
> > > From: Quentin Schulz <quentin.schulz@cherry.de>
> > >
> > > To make it easier to read the device tree, let's add constants for the
> > > rockchip,reset-mode property values that are currently only applicable
> > > to RK806 PMIC.
> > >
> > > Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
> > > ---
> > > arch/arm64/boot/dts/rockchip/rk8xx.h | 18 ++++++++++++++++++
> >
> > I think this header should be in include/dt-bindings/, otherwise the
>
> v2 did that and the feedback from dt-binding people was they didn't want (as
> far as I understood) unused constants as ABI[1][2].
>
> [1]
> https://lore.kernel.org/all/704d75df-a484-4da3-9bcb-85b480e2ecf0@kernel.org/
> [2]
> https://lore.kernel.org/all/a9baf6b0-b668-4d10-b9de-b63eb3fd8f23@kernel.org/
I wonder if it would be considered an ABI, if the drivers would use
the values like this:
switch (value_from_dt) {
case RK806_RESTART:
case RK806_RESET:
case RK806_RESET_NOTIFY:
program_register(...);
break;
default:
return dev_err_probe(dev, -EINVAL, "invalid restart setting");
}
IMHO register values not being an ABI is kind of weird, as this is a
very strong ABI from my POV - it's just not defined by us. But I don't
intent to fight for this, so ignore my comment :)
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3 4/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Jaguar
2025-06-18 10:32 [PATCH v3 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806 Quentin Schulz
` (2 preceding siblings ...)
2025-06-18 10:32 ` [PATCH v3 3/5] arm64: dts: rockchip: add header for RK8XX PMIC constants Quentin Schulz
@ 2025-06-18 10:32 ` Quentin Schulz
2025-06-18 10:32 ` [PATCH v3 5/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Tiger Quentin Schulz
4 siblings, 0 replies; 11+ messages in thread
From: Quentin Schulz @ 2025-06-18 10:32 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel
Cc: Lukasz Czechowski, Daniel Semkowicz, Nicolas Frattaroli,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
The bootloader for RK3588 Jaguar currently forces the PMIC reset
behavior (stored in RST_FUN bitfield in register SYS_CFG3 of the PMIC)
to 0b1X which is incorrect for our devices.
It is required to restart the PMU as otherwise the companion
microcontroller cannot detect the PMIC (and by extension the full
product and main SoC) being rebooted which is an issue as that is used
to reset a few things like the PWM beeper and watchdogs.
Let's add the new rockchip,reset-mode property to make sure the PMIC
reset behavior is the expected one.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
index ebe77cdd24e803b00fb848dc81258909472290f1..176925d0a1a809d1e2500f5e5efbbfa6a6d0bd42 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-jaguar.dts
@@ -10,6 +10,7 @@
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/soc/rockchip,vop2.h>
#include <dt-bindings/usb/pd.h>
+#include "rk8xx.h"
#include "rk3588.dtsi"
/ {
@@ -693,6 +694,7 @@ pmic@0 {
vcc13-supply = <&vcc_1v1_nldo_s3>;
vcc14-supply = <&vcc_1v1_nldo_s3>;
vcca-supply = <&vcc5v0_sys>;
+ rockchip,reset-mode = <RK806_RESTART>;
rk806_dvs1_null: dvs1-null-pins {
pins = "gpio_pwrctrl1";
--
2.49.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 5/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Tiger
2025-06-18 10:32 [PATCH v3 0/5] rockchip: rk8xx: allow to customize PMIC reset mode on RK806 Quentin Schulz
` (3 preceding siblings ...)
2025-06-18 10:32 ` [PATCH v3 4/5] arm64: dts: rockchip: force PMIC reset behavior to restart PMU on RK3588 Jaguar Quentin Schulz
@ 2025-06-18 10:32 ` Quentin Schulz
4 siblings, 0 replies; 11+ messages in thread
From: Quentin Schulz @ 2025-06-18 10:32 UTC (permalink / raw)
To: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Heiko Stuebner, Sebastian Reichel
Cc: Lukasz Czechowski, Daniel Semkowicz, Nicolas Frattaroli,
devicetree, linux-arm-kernel, linux-rockchip, linux-kernel,
Quentin Schulz
From: Quentin Schulz <quentin.schulz@cherry.de>
The bootloader for RK3588 Tiger currently forces the PMIC reset behavior
(stored in RST_FUN bitfield in register SYS_CFG3 of the PMIC) to 0b1X
which is incorrect for our devices.
It is required to restart the PMU as otherwise the companion
microcontroller cannot detect the PMIC (and by extension the full
product and main SoC) being rebooted which is an issue as that is used
to reset a few things like the PWM beeper and watchdogs.
Let's add the new rockchip,reset-mode property to make sure the PMIC
reset behavior is the expected one.
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
index c4933a08dd1e3c92f3e0747135faf97c5eeca906..b44e89e1bb1599ee70b921598c2eb6fd54614f55 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
@@ -6,6 +6,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/rockchip.h>
+#include "rk8xx.h"
#include "rk3588.dtsi"
/ {
@@ -440,6 +441,7 @@ pmic@0 {
vcc13-supply = <&vcc_1v1_nldo_s3>;
vcc14-supply = <&vcc_1v1_nldo_s3>;
vcca-supply = <&vcc5v0_sys>;
+ rockchip,reset-mode = <RK806_RESTART>;
rk806_dvs1_null: dvs1-null-pins {
pins = "gpio_pwrctrl1";
--
2.49.0
^ permalink raw reply related [flat|nested] 11+ messages in thread