* [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver
@ 2025-03-11 10:50 Jonas Rebmann
2025-03-11 10:50 ` [PATCH 1/2] mfd: pca9450: configure pmic reset behavior Jonas Rebmann
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 10:50 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Jonas Rebmann
Configure the RESET_CTRL register of the pca9450 pmic in the driver,
like u-boot and kernel do. Subsequently, remove the setup of this
register from the pca9450_register_init_callback of the two imx93 boards
we currently have.
Configuration of this register in lowlevel.c of the imx8 boards remains
untouched for now as they use a larger array of pmic register setups
which I haven't given a closer look as to which is actually needed given
the defaults and what's done in the driver already.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
Jonas Rebmann (2):
mfd: pca9450: configure pmic reset behavior
ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
arch/arm/boards/tqma93xx/board.c | 3 ---
drivers/mfd/pca9450.c | 11 +++++++++++
include/mfd/pca9450.h | 4 ++++
4 files changed, 15 insertions(+), 12 deletions(-)
---
base-commit: d004da6e3710cc01b645a57c8dd1a986eced1c80
change-id: 20250311-pca9450-wdog-b9458f1a26ff
Best regards,
--
Jonas Rebmann <jre@pengutronix.de>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] mfd: pca9450: configure pmic reset behavior
2025-03-11 10:50 [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Jonas Rebmann
@ 2025-03-11 10:50 ` Jonas Rebmann
2025-03-12 12:38 ` Sascha Hauer
2025-03-11 10:50 ` [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup Jonas Rebmann
2025-03-11 11:05 ` [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Rouven Czerwinski
2 siblings, 1 reply; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 10:50 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Jonas Rebmann
Currently, boards using the pca9450 pmic driver initialize the
RESET_CTRL register either in lowlevel.c or board.c explicitly to 0xA1
to enable the watchdog for Cold Reset with all voltage regulators
recycled except LDO1/ LDO2 in addition to the default configuration of
0x11 where the WDOG_B watchdog input is disabled.
Instead, enable the watchdog in the driver for Cold Reset with all
voltage regulators recycled except LDO1/ LDO2. When
nxp,wdog_b-warm-reset is set, the watchdog is instead enabled for Warm
Reset.
This is identical to U-Boot's behaviour since commit 910c7a881f5 and
Linux's since commit 2364a64d0673f.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
drivers/mfd/pca9450.c | 11 +++++++++++
include/mfd/pca9450.h | 4 ++++
2 files changed, 15 insertions(+)
diff --git a/drivers/mfd/pca9450.c b/drivers/mfd/pca9450.c
index 2511e662c3dfb5dfedbc461357ffa82d1812166f..6d6fb32c36569689b901455b3376c92977eabc37 100644
--- a/drivers/mfd/pca9450.c
+++ b/drivers/mfd/pca9450.c
@@ -3,6 +3,7 @@
* Copyright (C) 2023 Holger Assmann, Pengutronix
*/
+#include "linux/regmap.h"
#include <common.h>
#include <driver.h>
#include <errno.h>
@@ -103,6 +104,16 @@ static int __init pca9450_probe(struct device *dev)
/* Chip ID defined in bits [7:4] */
dev_info(dev, "PMIC Chip ID: 0x%x\n", (reg >> 4));
+ /* Enable WDOG_B, for cold reset by default */
+ if (of_property_read_bool(dev->of_node, "nxp,wdog_b-warm-reset"))
+ regmap_update_bits(regmap, PCA9450_RESET_CTRL,
+ PCA9450_PMIC_RESET_WDOG_B_CFG_MASK,
+ PCA9450_PMIC_RESET_WDOG_B_CFG_WARM);
+ else
+ regmap_update_bits(regmap, PCA9450_RESET_CTRL,
+ PCA9450_PMIC_RESET_WDOG_B_CFG_MASK,
+ PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12);
+
if (pca9450_init_callback)
pca9450_init_callback(regmap);
pca9450_map = regmap;
diff --git a/include/mfd/pca9450.h b/include/mfd/pca9450.h
index 7071c3a9da6c5adc26dbd6149fec5fa96f3365bf..af10e409855ff6c3585c7f63098a16e8ec33dee2 100644
--- a/include/mfd/pca9450.h
+++ b/include/mfd/pca9450.h
@@ -66,4 +66,8 @@ static inline int pca9450_register_init_callback(void(*callback)(struct regmap *
}
#endif
+#define PCA9450_PMIC_RESET_WDOG_B_CFG_MASK 0xc0
+#define PCA9450_PMIC_RESET_WDOG_B_CFG_WARM 0x40
+#define PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12 0x80
+
#endif
--
2.39.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
2025-03-11 10:50 [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Jonas Rebmann
2025-03-11 10:50 ` [PATCH 1/2] mfd: pca9450: configure pmic reset behavior Jonas Rebmann
@ 2025-03-11 10:50 ` Jonas Rebmann
2025-03-11 11:03 ` Ahmad Fatoum
2025-03-11 11:05 ` [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Rouven Czerwinski
2 siblings, 1 reply; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 10:50 UTC (permalink / raw)
To: Sascha Hauer, BAREBOX; +Cc: Jonas Rebmann
Since a previous commit, PCA9450_RESET_CTRL is initialized to 0xA1 in
pca9450_probe; explicitly setting this in board.c has no effect anymore.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
arch/arm/boards/tqma93xx/board.c | 3 ---
2 files changed, 12 deletions(-)
diff --git a/arch/arm/boards/phytec-phycore-imx93/board.c b/arch/arm/boards/phytec-phycore-imx93/board.c
index 149248ca654624826d0e8f6fe0f1f42c2747e248..03ba8cb5026d2a9eaa054fcfc69e18872fcd658e 100644
--- a/arch/arm/boards/phytec-phycore-imx93/board.c
+++ b/arch/arm/boards/phytec-phycore-imx93/board.c
@@ -6,23 +6,14 @@
#include <init.h>
#include <linux/kernel.h>
#include <environment.h>
-#include <mfd/pca9450.h>
#include <deep-probe.h>
#include <mach/imx/bbu.h>
#include <linux/pinctrl/consumer.h>
-static void phycore_imx93_init_pmic(struct regmap *map)
-{
- /* set WDOG_B_CFG to cold reset */
- regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
-}
-
static int phycore_imx93_probe(struct device *dev)
{
struct device_node *np;
- pca9450_register_init_callback(phycore_imx93_init_pmic);
-
/*
* The phy on the EQOS has its MDIO lines connected to the FEC. The phy
* registers can only be successfully read when the EQOS pinctrl setup
diff --git a/arch/arm/boards/tqma93xx/board.c b/arch/arm/boards/tqma93xx/board.c
index b181784079cf12e5a112d13f95c87c2cf5ebeba6..b4de6c2f6c347cb255537a3784a667a9c2607de3 100644
--- a/arch/arm/boards/tqma93xx/board.c
+++ b/arch/arm/boards/tqma93xx/board.c
@@ -27,9 +27,6 @@ static void tqma93xx_init_pmic(struct regmap *map)
/* I2C_LT_EN*/
regmap_write(map, 0xa, 0x3);
-
- /* set WDOG_B_CFG to cold reset */
- regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
}
static int tqma93xx_probe(struct device *dev)
--
2.39.5
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
2025-03-11 10:50 ` [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup Jonas Rebmann
@ 2025-03-11 11:03 ` Ahmad Fatoum
2025-03-11 11:21 ` Jonas Rebmann
0 siblings, 1 reply; 12+ messages in thread
From: Ahmad Fatoum @ 2025-03-11 11:03 UTC (permalink / raw)
To: Jonas Rebmann, Sascha Hauer, BAREBOX
Hi,
On 3/11/25 11:50, Jonas Rebmann wrote:
> Since a previous commit, PCA9450_RESET_CTRL is initialized to 0xA1 in
> pca9450_probe; explicitly setting this in board.c has no effect anymore.
Note that there is a number of i.MX8M boards that also use the PCA9450
and configure 0xA1 into PCA9450_RESET_CTRL in their lowlevel.c.
Any particular reason against or for dropping the configuration there?
Thanks,
Ahmad
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
> ---
> arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
> arch/arm/boards/tqma93xx/board.c | 3 ---
> 2 files changed, 12 deletions(-)
>
> diff --git a/arch/arm/boards/phytec-phycore-imx93/board.c b/arch/arm/boards/phytec-phycore-imx93/board.c
> index 149248ca654624826d0e8f6fe0f1f42c2747e248..03ba8cb5026d2a9eaa054fcfc69e18872fcd658e 100644
> --- a/arch/arm/boards/phytec-phycore-imx93/board.c
> +++ b/arch/arm/boards/phytec-phycore-imx93/board.c
> @@ -6,23 +6,14 @@
> #include <init.h>
> #include <linux/kernel.h>
> #include <environment.h>
> -#include <mfd/pca9450.h>
> #include <deep-probe.h>
> #include <mach/imx/bbu.h>
> #include <linux/pinctrl/consumer.h>
>
> -static void phycore_imx93_init_pmic(struct regmap *map)
> -{
> - /* set WDOG_B_CFG to cold reset */
> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
> -}
> -
> static int phycore_imx93_probe(struct device *dev)
> {
> struct device_node *np;
>
> - pca9450_register_init_callback(phycore_imx93_init_pmic);
> -
> /*
> * The phy on the EQOS has its MDIO lines connected to the FEC. The phy
> * registers can only be successfully read when the EQOS pinctrl setup
> diff --git a/arch/arm/boards/tqma93xx/board.c b/arch/arm/boards/tqma93xx/board.c
> index b181784079cf12e5a112d13f95c87c2cf5ebeba6..b4de6c2f6c347cb255537a3784a667a9c2607de3 100644
> --- a/arch/arm/boards/tqma93xx/board.c
> +++ b/arch/arm/boards/tqma93xx/board.c
> @@ -27,9 +27,6 @@ static void tqma93xx_init_pmic(struct regmap *map)
>
> /* I2C_LT_EN*/
> regmap_write(map, 0xa, 0x3);
> -
> - /* set WDOG_B_CFG to cold reset */
> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
> }
>
> static int tqma93xx_probe(struct device *dev)
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver
2025-03-11 10:50 [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Jonas Rebmann
2025-03-11 10:50 ` [PATCH 1/2] mfd: pca9450: configure pmic reset behavior Jonas Rebmann
2025-03-11 10:50 ` [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup Jonas Rebmann
@ 2025-03-11 11:05 ` Rouven Czerwinski
2025-03-11 11:40 ` Jonas Rebmann
2 siblings, 1 reply; 12+ messages in thread
From: Rouven Czerwinski @ 2025-03-11 11:05 UTC (permalink / raw)
To: Jonas Rebmann, Sascha Hauer, BAREBOX
Hi,
On Tue, 2025-03-11 at 11:50 +0100, Jonas Rebmann wrote:
> Configure the RESET_CTRL register of the pca9450 pmic in the driver,
> like u-boot and kernel do. Subsequently, remove the setup of this
> register from the pca9450_register_init_callback of the two imx93 boards
> we currently have.
Does it make sense to select the pcs9450 in the board kconfig symbols?
This way users retain the behaviour after an update even if the pca9450
driver was not selected before.
> Configuration of this register in lowlevel.c of the imx8 boards remains
> untouched for now as they use a larger array of pmic register setups
> which I haven't given a closer look as to which is actually needed given
> the defaults and what's done in the driver already.
>
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
> ---
> Jonas Rebmann (2):
> mfd: pca9450: configure pmic reset behavior
> ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
>
> arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
> arch/arm/boards/tqma93xx/board.c | 3 ---
> drivers/mfd/pca9450.c | 11 +++++++++++
> include/mfd/pca9450.h | 4 ++++
> 4 files changed, 15 insertions(+), 12 deletions(-)
> ---
> base-commit: d004da6e3710cc01b645a57c8dd1a986eced1c80
> change-id: 20250311-pca9450-wdog-b9458f1a26ff
>
> Best regards,
Best regards,
Rouven
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
2025-03-11 11:03 ` Ahmad Fatoum
@ 2025-03-11 11:21 ` Jonas Rebmann
2025-03-11 11:42 ` Ahmad Fatoum
2025-03-12 12:43 ` Sascha Hauer
0 siblings, 2 replies; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 11:21 UTC (permalink / raw)
To: Ahmad Fatoum, Sascha Hauer, BAREBOX
Hi Ahmad,
Not so much. As mentioned in the cover, the imx8 boards routinely
configure a larger array of pca9450 registers. As I didn't give the rest
of that setup a closer look, I did not change the code.
I have only tested this series on the phyboard segin imx93.
Just like with the imx93 boards, after application of the driver patch,
the { PCA9450_RESET_CTRL, 0xA1 } lines in lowlevel.c should no more have
an effect (as no board currently uses nxp,wdog_b-warm-reset).
Should I remove all { PCA9450_RESET_CTRL, 0xA1 } configuration in v2?
- Jonas
On 2025-03-11 12:03, Ahmad Fatoum wrote:
> Hi,
>
> On 3/11/25 11:50, Jonas Rebmann wrote:
>> Since a previous commit, PCA9450_RESET_CTRL is initialized to 0xA1 in
>> pca9450_probe; explicitly setting this in board.c has no effect anymore.
>
> Note that there is a number of i.MX8M boards that also use the PCA9450
> and configure 0xA1 into PCA9450_RESET_CTRL in their lowlevel.c.
>
> Any particular reason against or for dropping the configuration there?
>
> Thanks,
> Ahmad
>
>> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
>> ---
>> arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
>> arch/arm/boards/tqma93xx/board.c | 3 ---
>> 2 files changed, 12 deletions(-)
>>
>> diff --git a/arch/arm/boards/phytec-phycore-imx93/board.c b/arch/arm/boards/phytec-phycore-imx93/board.c
>> index 149248ca654624826d0e8f6fe0f1f42c2747e248..03ba8cb5026d2a9eaa054fcfc69e18872fcd658e 100644
>> --- a/arch/arm/boards/phytec-phycore-imx93/board.c
>> +++ b/arch/arm/boards/phytec-phycore-imx93/board.c
>> @@ -6,23 +6,14 @@
>> #include <init.h>
>> #include <linux/kernel.h>
>> #include <environment.h>
>> -#include <mfd/pca9450.h>
>> #include <deep-probe.h>
>> #include <mach/imx/bbu.h>
>> #include <linux/pinctrl/consumer.h>
>>
>> -static void phycore_imx93_init_pmic(struct regmap *map)
>> -{
>> - /* set WDOG_B_CFG to cold reset */
>> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
>> -}
>> -
>> static int phycore_imx93_probe(struct device *dev)
>> {
>> struct device_node *np;
>>
>> - pca9450_register_init_callback(phycore_imx93_init_pmic);
>> -
>> /*
>> * The phy on the EQOS has its MDIO lines connected to the FEC. The phy
>> * registers can only be successfully read when the EQOS pinctrl setup
>> diff --git a/arch/arm/boards/tqma93xx/board.c b/arch/arm/boards/tqma93xx/board.c
>> index b181784079cf12e5a112d13f95c87c2cf5ebeba6..b4de6c2f6c347cb255537a3784a667a9c2607de3 100644
>> --- a/arch/arm/boards/tqma93xx/board.c
>> +++ b/arch/arm/boards/tqma93xx/board.c
>> @@ -27,9 +27,6 @@ static void tqma93xx_init_pmic(struct regmap *map)
>>
>> /* I2C_LT_EN*/
>> regmap_write(map, 0xa, 0x3);
>> -
>> - /* set WDOG_B_CFG to cold reset */
>> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
>> }
>>
>> static int tqma93xx_probe(struct device *dev)
>>
>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver
2025-03-11 11:05 ` [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Rouven Czerwinski
@ 2025-03-11 11:40 ` Jonas Rebmann
2025-03-11 11:42 ` Jonas Rebmann
2025-03-12 12:31 ` Sascha Hauer
0 siblings, 2 replies; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 11:40 UTC (permalink / raw)
To: Rouven Czerwinski, Sascha Hauer, BAREBOX, Ahmad Fatoum
Hi Rouven,
On 2025-03-11 12:05, Rouven Czerwinski wrote:
> Does it make sense to select the pcs9450 in the board kconfig symbols?
> This way users retain the behaviour after an update even if the pca9450
> driver was not selected before.
Are you referring to a scenario where removal of an explicit
initialization of PCA9450_RESET_CTRL in favor of the setup in the driver
would lead to an unitialized PCA9450_RESET_CTRL if the driver is not
enabled?
For the imx93 boards, behaviour remains unchanged same as those two
boards configure PCA9450_RESET_CTRL in pca9450_register_init_callback,
which is called by the driver. So change in behavior with those.
Not so on the imx8 boards where pmic_configure is called unconditionally
in the power-on routine.
Given this, I'm not sure if we should remove the explicit register
config for the imx8 boards as Ahmad mentioned. I think I remember Sasha
mentioning a reason why board kconfig doesn't select the pmic driver?..
- Jonas
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
2025-03-11 11:21 ` Jonas Rebmann
@ 2025-03-11 11:42 ` Ahmad Fatoum
2025-03-12 12:43 ` Sascha Hauer
1 sibling, 0 replies; 12+ messages in thread
From: Ahmad Fatoum @ 2025-03-11 11:42 UTC (permalink / raw)
To: Jonas Rebmann, Sascha Hauer, BAREBOX
Hello Jonas,
On 3/11/25 12:21, Jonas Rebmann wrote:
> Hi Ahmad,
>
> Not so much. As mentioned in the cover, the imx8 boards routinely
> configure a larger array of pca9450 registers. As I didn't give the rest
> of that setup a closer look, I did not change the code.
Ah, should've read the cover letter, my bad.
Please add that information into the commit messages, so it becomes
part of the git history.
> I have only tested this series on the phyboard segin imx93.
>
> Just like with the imx93 boards, after application of the driver patch,
> the { PCA9450_RESET_CTRL, 0xA1 } lines in lowlevel.c should no more have
> an effect (as no board currently uses nxp,wdog_b-warm-reset).
>
> Should I remove all { PCA9450_RESET_CTRL, 0xA1 } configuration in v2?
An explanation in the commit message why this wasn't done is enough.
Cheers,
Ahmad
>
> - Jonas
>
> On 2025-03-11 12:03, Ahmad Fatoum wrote:
>> Hi,
>>
>> On 3/11/25 11:50, Jonas Rebmann wrote:
>>> Since a previous commit, PCA9450_RESET_CTRL is initialized to 0xA1 in
>>> pca9450_probe; explicitly setting this in board.c has no effect anymore.
>>
>> Note that there is a number of i.MX8M boards that also use the PCA9450
>> and configure 0xA1 into PCA9450_RESET_CTRL in their lowlevel.c.
>>
>> Any particular reason against or for dropping the configuration there?
>>
>> Thanks,
>> Ahmad
>>
>>> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
>>> ---
>>> arch/arm/boards/phytec-phycore-imx93/board.c | 9 ---------
>>> arch/arm/boards/tqma93xx/board.c | 3 ---
>>> 2 files changed, 12 deletions(-)
>>>
>>> diff --git a/arch/arm/boards/phytec-phycore-imx93/board.c b/arch/arm/
>>> boards/phytec-phycore-imx93/board.c
>>> index
>>> 149248ca654624826d0e8f6fe0f1f42c2747e248..03ba8cb5026d2a9eaa054fcfc69e18872fcd658e 100644
>>> --- a/arch/arm/boards/phytec-phycore-imx93/board.c
>>> +++ b/arch/arm/boards/phytec-phycore-imx93/board.c
>>> @@ -6,23 +6,14 @@
>>> #include <init.h>
>>> #include <linux/kernel.h>
>>> #include <environment.h>
>>> -#include <mfd/pca9450.h>
>>> #include <deep-probe.h>
>>> #include <mach/imx/bbu.h>
>>> #include <linux/pinctrl/consumer.h>
>>> -static void phycore_imx93_init_pmic(struct regmap *map)
>>> -{
>>> - /* set WDOG_B_CFG to cold reset */
>>> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
>>> -}
>>> -
>>> static int phycore_imx93_probe(struct device *dev)
>>> {
>>> struct device_node *np;
>>> - pca9450_register_init_callback(phycore_imx93_init_pmic);
>>> -
>>> /*
>>> * The phy on the EQOS has its MDIO lines connected to the FEC.
>>> The phy
>>> * registers can only be successfully read when the EQOS
>>> pinctrl setup
>>> diff --git a/arch/arm/boards/tqma93xx/board.c b/arch/arm/boards/
>>> tqma93xx/board.c
>>> index
>>> b181784079cf12e5a112d13f95c87c2cf5ebeba6..b4de6c2f6c347cb255537a3784a667a9c2607de3 100644
>>> --- a/arch/arm/boards/tqma93xx/board.c
>>> +++ b/arch/arm/boards/tqma93xx/board.c
>>> @@ -27,9 +27,6 @@ static void tqma93xx_init_pmic(struct regmap *map)
>>> /* I2C_LT_EN*/
>>> regmap_write(map, 0xa, 0x3);
>>> -
>>> - /* set WDOG_B_CFG to cold reset */
>>> - regmap_write(map, PCA9450_RESET_CTRL, 0xA1);
>>> }
>>> static int tqma93xx_probe(struct device *dev)
>>>
>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver
2025-03-11 11:40 ` Jonas Rebmann
@ 2025-03-11 11:42 ` Jonas Rebmann
2025-03-12 12:31 ` Sascha Hauer
1 sibling, 0 replies; 12+ messages in thread
From: Jonas Rebmann @ 2025-03-11 11:42 UTC (permalink / raw)
To: Rouven Czerwinski, Sascha Hauer, BAREBOX, Ahmad Fatoum
On 2025-03-11 12:40, Jonas Rebmann wrote:
> For the imx93 boards, behaviour remains unchanged same as those two
> boards configure PCA9450_RESET_CTRL in pca9450_register_init_callback,
> which is called by the driver. So change in behavior with those.
This was supposed to say:
For the imx93 boards, behaviour remains **unchanged** as those two
boards configure PCA9450_RESET_CTRL in pca9450_register_init_callback,
which is called by the driver. So **no** change in behavior with those.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver
2025-03-11 11:40 ` Jonas Rebmann
2025-03-11 11:42 ` Jonas Rebmann
@ 2025-03-12 12:31 ` Sascha Hauer
1 sibling, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2025-03-12 12:31 UTC (permalink / raw)
To: Jonas Rebmann; +Cc: Rouven Czerwinski, BAREBOX, Ahmad Fatoum
On Tue, Mar 11, 2025 at 12:40:03PM +0100, Jonas Rebmann wrote:
> Hi Rouven,
>
> On 2025-03-11 12:05, Rouven Czerwinski wrote:
> > Does it make sense to select the pcs9450 in the board kconfig symbols?
> > This way users retain the behaviour after an update even if the pca9450
> > driver was not selected before.
>
> Are you referring to a scenario where removal of an explicit initialization
> of PCA9450_RESET_CTRL in favor of the setup in the driver would lead to an
> unitialized PCA9450_RESET_CTRL if the driver is not enabled?
>
> For the imx93 boards, behaviour remains unchanged same as those two boards
> configure PCA9450_RESET_CTRL in pca9450_register_init_callback, which is
> called by the driver. So change in behavior with those.
>
> Not so on the imx8 boards where pmic_configure is called unconditionally in
> the power-on routine.
>
> Given this, I'm not sure if we should remove the explicit register config
> for the imx8 boards as Ahmad mentioned. I think I remember Sasha mentioning
> a reason why board kconfig doesn't select the pmic driver?..
Yes. We can't select the PMIC driver from the board Kconfig because we
would also have to select all direct dependencies like I2C. Although not
a direct dependency we would also have to select the I2C hardware bus
driver, because without it we also could not access the PMIC. All this
is cumbersome to do, so better avoided. If necessary we could issue a
warning message at runtime and leave it up to the user to select the
missing pieces.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/2] mfd: pca9450: configure pmic reset behavior
2025-03-11 10:50 ` [PATCH 1/2] mfd: pca9450: configure pmic reset behavior Jonas Rebmann
@ 2025-03-12 12:38 ` Sascha Hauer
0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2025-03-12 12:38 UTC (permalink / raw)
To: Jonas Rebmann; +Cc: BAREBOX
On Tue, Mar 11, 2025 at 11:50:17AM +0100, Jonas Rebmann wrote:
> Currently, boards using the pca9450 pmic driver initialize the
> RESET_CTRL register either in lowlevel.c or board.c explicitly to 0xA1
> to enable the watchdog for Cold Reset with all voltage regulators
> recycled except LDO1/ LDO2 in addition to the default configuration of
> 0x11 where the WDOG_B watchdog input is disabled.
>
> Instead, enable the watchdog in the driver for Cold Reset with all
> voltage regulators recycled except LDO1/ LDO2. When
> nxp,wdog_b-warm-reset is set, the watchdog is instead enabled for Warm
> Reset.
>
> This is identical to U-Boot's behaviour since commit 910c7a881f5 and
> Linux's since commit 2364a64d0673f.
Please add the commit description like
910c7a881f5 ("pmic: pca9450: Make warm reset on WDOG_B assertion") and
2364a64d0673f ("regulator: pca9450: Make warm reset on WDOG_B assertion")
>
> Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
> ---
> drivers/mfd/pca9450.c | 11 +++++++++++
> include/mfd/pca9450.h | 4 ++++
> 2 files changed, 15 insertions(+)
>
> diff --git a/drivers/mfd/pca9450.c b/drivers/mfd/pca9450.c
> index 2511e662c3dfb5dfedbc461357ffa82d1812166f..6d6fb32c36569689b901455b3376c92977eabc37 100644
> --- a/drivers/mfd/pca9450.c
> +++ b/drivers/mfd/pca9450.c
> @@ -3,6 +3,7 @@
> * Copyright (C) 2023 Holger Assmann, Pengutronix
> */
>
> +#include "linux/regmap.h"
Please include files from the include paths with <> rather than "".
In this case you can drop it entirely, because linux/regmap.h is already
included by regmap.h
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup
2025-03-11 11:21 ` Jonas Rebmann
2025-03-11 11:42 ` Ahmad Fatoum
@ 2025-03-12 12:43 ` Sascha Hauer
1 sibling, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2025-03-12 12:43 UTC (permalink / raw)
To: Jonas Rebmann; +Cc: Ahmad Fatoum, BAREBOX
On Tue, Mar 11, 2025 at 12:21:52PM +0100, Jonas Rebmann wrote:
> Hi Ahmad,
>
> Not so much. As mentioned in the cover, the imx8 boards routinely configure
> a larger array of pca9450 registers. As I didn't give the rest of that setup
> a closer look, I did not change the code.
>
> I have only tested this series on the phyboard segin imx93.
>
> Just like with the imx93 boards, after application of the driver patch, the
> { PCA9450_RESET_CTRL, 0xA1 } lines in lowlevel.c should no more have an
> effect (as no board currently uses nxp,wdog_b-warm-reset).
>
> Should I remove all { PCA9450_RESET_CTRL, 0xA1 } configuration in v2?
Better not. We have other PMIC register accesses in the lowlevel.c
anyway, so having one more doesn't hurt. The positive effect is that
these boards work better in case the PMIC driver is disabled.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-03-12 13:07 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-11 10:50 [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Jonas Rebmann
2025-03-11 10:50 ` [PATCH 1/2] mfd: pca9450: configure pmic reset behavior Jonas Rebmann
2025-03-12 12:38 ` Sascha Hauer
2025-03-11 10:50 ` [PATCH 2/2] ARM: boards: remove obsolete PCA9450_RESET_CTRL setup Jonas Rebmann
2025-03-11 11:03 ` Ahmad Fatoum
2025-03-11 11:21 ` Jonas Rebmann
2025-03-11 11:42 ` Ahmad Fatoum
2025-03-12 12:43 ` Sascha Hauer
2025-03-11 11:05 ` [PATCH 0/2] Move pca9450 RESET_CTRL configuration to driver Rouven Czerwinski
2025-03-11 11:40 ` Jonas Rebmann
2025-03-11 11:42 ` Jonas Rebmann
2025-03-12 12:31 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox