[v9,6/7] arm64: dts: ti: k3-j721e-sk: Add TPS6594 family PMICs

Message ID 20231205093439.2298296-7-n-francis@ti.com
State New
Headers
Series Add TPS6594 PMIC support on several boards |

Commit Message

Neha Malcom Francis Dec. 5, 2023, 9:34 a.m. UTC
  This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
These devices provide regulators (bucks and LDOs), but also GPIOs, a
RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
error output signal, and a PFSM (Pre-configurable Finite State Machine)
which manages the operational modes of the PMIC.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
---
 arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
 1 file changed, 158 insertions(+)
  

Comments

Nishanth Menon Dec. 5, 2023, 3:16 p.m. UTC | #1
On 15:04-20231205, Neha Malcom Francis wrote:
> This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
> These devices provide regulators (bucks and LDOs), but also GPIOs, a
> RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
> error output signal, and a PFSM (Pre-configurable Finite State Machine)
> which manages the operational modes of the PMIC.
> 
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
>  arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
>  1 file changed, 158 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> index 42fe8eee9ec8..e600825f7e78 100644
> --- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> +++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> @@ -459,6 +459,13 @@ J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3) EXT_REFCLK1.GPIO1_12 */
>  };
>  
>  &wkup_pmx0 {
> +	pmic_irq_pins_default: pmic-irq-default-pins {
> +		bootph-pre-ram;
> +		pinctrl-single,pins = <
> +			J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
> +		>;
> +	};
> +
>  	mcu_cpsw_pins_default: mcu-cpsw-default-pins {
>  		pinctrl-single,pins = <
>  			J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
> @@ -560,6 +567,157 @@ eeprom@51 {
>  		compatible = "atmel,24c512";
>  		reg = <0x51>;
>  	};
> +
> +	tps659413: pmic@48 {
> +		bootph-pre-ram;

only for the leaf nodes. See
https://libera.irclog.whitequark.org/armlinux/2023-10-19

> +		compatible = "ti,tps6594-q1";
> +		reg = <0x48>;
> +		system-power-controller;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&pmic_irq_pins_default>;
> +		interrupt-parent = <&wkup_gpio0>;
> +		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
> +		ti,primary-pmic;
> +
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +
> +		buck123-supply = <&vsys_3v3>;
> +		buck4-supply = <&vsys_3v3>;
> +		buck5-supply = <&vsys_3v3>;
> +		ldo1-supply = <&vsys_3v3>;
> +		ldo2-supply = <&vsys_3v3>;
> +		ldo3-supply = <&vsys_3v3>;
> +		ldo4-supply = <&vsys_3v3>;
> +
> +		regulators {
> +			bootph-pre-ram;
> +			bucka123: buck123 {
> +				bootph-pre-ram;
> +				regulator-name = "vdd_cpu_avs";
> +				regulator-min-microvolt = <600000>;
> +				regulator-max-microvolt = <900000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			bucka4: buck4 {
> +				regulator-name = "vdd_mcu_0v85";
> +				regulator-min-microvolt = <850000>;
> +				regulator-max-microvolt = <850000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			bucka5: buck5 {
> +				regulator-name = "vdd_phyio_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldoa1: ldo1 {
> +				regulator-name = "vdd1_lpddr4_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldoa2: ldo2 {
> +				regulator-name = "vdd_mcuio_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldoa3: ldo3 {
> +				regulator-name = "vdda_dll_0v8";
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldoa4: ldo4 {
> +				regulator-name = "vda_mcu_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +		};
> +	};
> +
> +	tps659411: pmic@4c {
> +		compatible = "ti,tps6594-q1";
> +		reg = <0x4c>;
> +		system-power-controller;
> +		interrupt-parent = <&wkup_gpio0>;
> +		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
> +
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +
> +		buck1234-supply = <&vsys_3v3>;
> +		buck5-supply = <&vsys_3v3>;
> +		ldo1-supply = <&vsys_3v3>;
> +		ldo2-supply = <&vsys_3v3>;
> +		ldo3-supply = <&vsys_3v3>;
> +		ldo4-supply = <&vsys_3v3>;
> +
> +		regulators {
> +			buckb1234: buck1234 {
> +				regulator-name = "vdd_core_0v8";
> +				regulator-min-microvolt = <800000>;
> +				regulator-max-microvolt = <800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			buckb5: buck5 {
> +				regulator-name = "vdd_ram_0v85";
> +				regulator-min-microvolt = <850000>;
> +				regulator-max-microvolt = <850000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldob1: ldo1 {
> +				regulator-name = "vdd_sd_dv";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldob2: ldo2 {
> +				regulator-name = "vdd_usb_3v3";
> +				regulator-min-microvolt = <3300000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldob3: ldo3 {
> +				regulator-name = "vdd_io_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +
> +			ldob4: ldo4 {
> +				regulator-name = "vda_pll_1v8";
> +				regulator-min-microvolt = <1800000>;
> +				regulator-max-microvolt = <1800000>;
> +				regulator-boot-on;
> +				regulator-always-on;
> +			};
> +		};
> +	};
>  };
>  
>  &mcu_uart0 {
> -- 
> 2.34.1
>
  
Kumar, Udit Dec. 7, 2023, 4:42 a.m. UTC | #2
On 12/5/2023 8:46 PM, Nishanth Menon wrote:
> On 15:04-20231205, Neha Malcom Francis wrote:
>> This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
>> These devices provide regulators (bucks and LDOs), but also GPIOs, a
>> RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
>> error output signal, and a PFSM (Pre-configurable Finite State Machine)
>> which manages the operational modes of the PMIC.
>>
>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>> ---
>>   arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
>>   1 file changed, 158 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>> index 42fe8eee9ec8..e600825f7e78 100644
>> --- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>> +++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>> @@ -459,6 +459,13 @@ J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3) EXT_REFCLK1.GPIO1_12 */
>>   };
>>   
>>   &wkup_pmx0 {
>> +	pmic_irq_pins_default: pmic-irq-default-pins {
>> +		bootph-pre-ram;
>> +		pinctrl-single,pins = <
>> +			J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
>> +		>;
>> +	};
>> +
>>   	mcu_cpsw_pins_default: mcu-cpsw-default-pins {
>>   		pinctrl-single,pins = <
>>   			J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
>> @@ -560,6 +567,157 @@ eeprom@51 {
>>   		compatible = "atmel,24c512";
>>   		reg = <0x51>;
>>   	};
>> +
>> +	tps659413: pmic@48 {
>> +		bootph-pre-ram;
> only for the leaf nodes. See
> https://libera.irclog.whitequark.org/armlinux/2023-10-19


AFAIK, please correct me, u-boot still needs in all nodes ?

>
>> +		compatible = "ti,tps6594-q1";
>> +		reg = <0x48>;
>> +		system-power-controller;
>> +		pinctrl-names = "default";
>> +		pinctrl-0 = <&pmic_irq_pins_default>;
>> +		interrupt-parent = <&wkup_gpio0>;
>> +		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
>> +		ti,primary-pmic;
>> +
>> +		gpio-controller;
>> +		#gpio-cells = <2>;
>> +
>> +		buck123-supply = <&vsys_3v3>;
>> +		buck4-supply = <&vsys_3v3>;
>> +		buck5-supply = <&vsys_3v3>;
>> +		ldo1-supply = <&vsys_3v3>;
>> +		ldo2-supply = <&vsys_3v3>;
>> +		ldo3-supply = <&vsys_3v3>;
>> +		ldo4-supply = <&vsys_3v3>;
>> +
>> +		regulators {
>> +			bootph-pre-ram;
>> +			bucka123: buck123 {
>> +				bootph-pre-ram;
>> +				regulator-name = "vdd_cpu_avs";
>> +				regulator-min-microvolt = <600000>;
>> +				regulator-max-microvolt = <900000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			bucka4: buck4 {
>> +				regulator-name = "vdd_mcu_0v85";
>> +				regulator-min-microvolt = <850000>;
>> +				regulator-max-microvolt = <850000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			bucka5: buck5 {
>> +				regulator-name = "vdd_phyio_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldoa1: ldo1 {
>> +				regulator-name = "vdd1_lpddr4_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldoa2: ldo2 {
>> +				regulator-name = "vdd_mcuio_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldoa3: ldo3 {
>> +				regulator-name = "vdda_dll_0v8";
>> +				regulator-min-microvolt = <800000>;
>> +				regulator-max-microvolt = <800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldoa4: ldo4 {
>> +				regulator-name = "vda_mcu_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +		};
>> +	};
>> +
>> +	tps659411: pmic@4c {
>> +		compatible = "ti,tps6594-q1";
>> +		reg = <0x4c>;
>> +		system-power-controller;
>> +		interrupt-parent = <&wkup_gpio0>;
>> +		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
>> +
>> +		gpio-controller;
>> +		#gpio-cells = <2>;
>> +
>> +		buck1234-supply = <&vsys_3v3>;
>> +		buck5-supply = <&vsys_3v3>;
>> +		ldo1-supply = <&vsys_3v3>;
>> +		ldo2-supply = <&vsys_3v3>;
>> +		ldo3-supply = <&vsys_3v3>;
>> +		ldo4-supply = <&vsys_3v3>;
>> +
>> +		regulators {
>> +			buckb1234: buck1234 {
>> +				regulator-name = "vdd_core_0v8";
>> +				regulator-min-microvolt = <800000>;
>> +				regulator-max-microvolt = <800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			buckb5: buck5 {
>> +				regulator-name = "vdd_ram_0v85";
>> +				regulator-min-microvolt = <850000>;
>> +				regulator-max-microvolt = <850000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldob1: ldo1 {
>> +				regulator-name = "vdd_sd_dv";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <3300000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldob2: ldo2 {
>> +				regulator-name = "vdd_usb_3v3";
>> +				regulator-min-microvolt = <3300000>;
>> +				regulator-max-microvolt = <3300000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldob3: ldo3 {
>> +				regulator-name = "vdd_io_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +
>> +			ldob4: ldo4 {
>> +				regulator-name = "vda_pll_1v8";
>> +				regulator-min-microvolt = <1800000>;
>> +				regulator-max-microvolt = <1800000>;
>> +				regulator-boot-on;
>> +				regulator-always-on;
>> +			};
>> +		};
>> +	};
>>   };
>>   
>>   &mcu_uart0 {
>> -- 
>> 2.34.1
>>
  
Neha Malcom Francis Dec. 7, 2023, 5:31 a.m. UTC | #3
Hi Nishanth, Udit,

On 07/12/23 10:12, Kumar, Udit wrote:
> 
> On 12/5/2023 8:46 PM, Nishanth Menon wrote:
>> On 15:04-20231205, Neha Malcom Francis wrote:
>>> This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
>>> These devices provide regulators (bucks and LDOs), but also GPIOs, a
>>> RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
>>> error output signal, and a PFSM (Pre-configurable Finite State Machine)
>>> which manages the operational modes of the PMIC.
>>>
>>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>>> ---
>>>   arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
>>>   1 file changed, 158 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts 
>>> b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>> index 42fe8eee9ec8..e600825f7e78 100644
>>> --- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>> +++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>> @@ -459,6 +459,13 @@ J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3) 
>>> EXT_REFCLK1.GPIO1_12 */
>>>   };
>>>   &wkup_pmx0 {
>>> +    pmic_irq_pins_default: pmic-irq-default-pins {
>>> +        bootph-pre-ram;
>>> +        pinctrl-single,pins = <
>>> +            J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
>>> +        >;
>>> +    };
>>> +
>>>       mcu_cpsw_pins_default: mcu-cpsw-default-pins {
>>>           pinctrl-single,pins = <
>>>               J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
>>> @@ -560,6 +567,157 @@ eeprom@51 {
>>>           compatible = "atmel,24c512";
>>>           reg = <0x51>;
>>>       };
>>> +
>>> +    tps659413: pmic@48 {
>>> +        bootph-pre-ram;
>> only for the leaf nodes. See
>> https://libera.irclog.whitequark.org/armlinux/2023-10-19
> 
> 
> AFAIK, please correct me, u-boot still needs in all nodes ?
> 

That's what I believe as well, is it better to have only the leaf nodes in 
kernel and have U-Boot DTSI handle the parent bootph properties? If so I'll send 
out v10 making change accordingly.

>>
>>> +        compatible = "ti,tps6594-q1";
>>> +        reg = <0x48>;
>>> +        system-power-controller;
>>> +        pinctrl-names = "default";
>>> +        pinctrl-0 = <&pmic_irq_pins_default>;
>>> +        interrupt-parent = <&wkup_gpio0>;
>>> +        interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
>>> +        ti,primary-pmic;
>>> +
>>> +        gpio-controller;
>>> +        #gpio-cells = <2>;
>>> +
>>> +        buck123-supply = <&vsys_3v3>;
>>> +        buck4-supply = <&vsys_3v3>;
>>> +        buck5-supply = <&vsys_3v3>;
>>> +        ldo1-supply = <&vsys_3v3>;
>>> +        ldo2-supply = <&vsys_3v3>;
>>> +        ldo3-supply = <&vsys_3v3>;
>>> +        ldo4-supply = <&vsys_3v3>;
>>> +
>>> +        regulators {
>>> +            bootph-pre-ram;
>>> +            bucka123: buck123 {
>>> +                bootph-pre-ram;
>>> +                regulator-name = "vdd_cpu_avs";
>>> +                regulator-min-microvolt = <600000>;
>>> +                regulator-max-microvolt = <900000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            bucka4: buck4 {
>>> +                regulator-name = "vdd_mcu_0v85";
>>> +                regulator-min-microvolt = <850000>;
>>> +                regulator-max-microvolt = <850000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            bucka5: buck5 {
>>> +                regulator-name = "vdd_phyio_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldoa1: ldo1 {
>>> +                regulator-name = "vdd1_lpddr4_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldoa2: ldo2 {
>>> +                regulator-name = "vdd_mcuio_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldoa3: ldo3 {
>>> +                regulator-name = "vdda_dll_0v8";
>>> +                regulator-min-microvolt = <800000>;
>>> +                regulator-max-microvolt = <800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldoa4: ldo4 {
>>> +                regulator-name = "vda_mcu_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +        };
>>> +    };
>>> +
>>> +    tps659411: pmic@4c {
>>> +        compatible = "ti,tps6594-q1";
>>> +        reg = <0x4c>;
>>> +        system-power-controller;
>>> +        interrupt-parent = <&wkup_gpio0>;
>>> +        interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
>>> +
>>> +        gpio-controller;
>>> +        #gpio-cells = <2>;
>>> +
>>> +        buck1234-supply = <&vsys_3v3>;
>>> +        buck5-supply = <&vsys_3v3>;
>>> +        ldo1-supply = <&vsys_3v3>;
>>> +        ldo2-supply = <&vsys_3v3>;
>>> +        ldo3-supply = <&vsys_3v3>;
>>> +        ldo4-supply = <&vsys_3v3>;
>>> +
>>> +        regulators {
>>> +            buckb1234: buck1234 {
>>> +                regulator-name = "vdd_core_0v8";
>>> +                regulator-min-microvolt = <800000>;
>>> +                regulator-max-microvolt = <800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            buckb5: buck5 {
>>> +                regulator-name = "vdd_ram_0v85";
>>> +                regulator-min-microvolt = <850000>;
>>> +                regulator-max-microvolt = <850000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldob1: ldo1 {
>>> +                regulator-name = "vdd_sd_dv";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <3300000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldob2: ldo2 {
>>> +                regulator-name = "vdd_usb_3v3";
>>> +                regulator-min-microvolt = <3300000>;
>>> +                regulator-max-microvolt = <3300000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldob3: ldo3 {
>>> +                regulator-name = "vdd_io_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +
>>> +            ldob4: ldo4 {
>>> +                regulator-name = "vda_pll_1v8";
>>> +                regulator-min-microvolt = <1800000>;
>>> +                regulator-max-microvolt = <1800000>;
>>> +                regulator-boot-on;
>>> +                regulator-always-on;
>>> +            };
>>> +        };
>>> +    };
>>>   };
>>>   &mcu_uart0 {
>>> -- 
>>> 2.34.1
>>>
  
Nishanth Menon Dec. 7, 2023, 1:49 p.m. UTC | #4
On 11:01-20231207, Neha Malcom Francis wrote:
> Hi Nishanth, Udit,
> 
> On 07/12/23 10:12, Kumar, Udit wrote:
> > 
> > On 12/5/2023 8:46 PM, Nishanth Menon wrote:
> > > On 15:04-20231205, Neha Malcom Francis wrote:
> > > > This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
> > > > These devices provide regulators (bucks and LDOs), but also GPIOs, a
> > > > RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
> > > > error output signal, and a PFSM (Pre-configurable Finite State Machine)
> > > > which manages the operational modes of the PMIC.
> > > > 
> > > > Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> > > > ---
> > > >   arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
> > > >   1 file changed, 158 insertions(+)
> > > > 
> > > > diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> > > > b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> > > > index 42fe8eee9ec8..e600825f7e78 100644
> > > > --- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> > > > +++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
> > > > @@ -459,6 +459,13 @@ J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3)
> > > > EXT_REFCLK1.GPIO1_12 */
> > > >   };
> > > >   &wkup_pmx0 {
> > > > +    pmic_irq_pins_default: pmic-irq-default-pins {
> > > > +        bootph-pre-ram;
> > > > +        pinctrl-single,pins = <
> > > > +            J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
> > > > +        >;
> > > > +    };
> > > > +
> > > >       mcu_cpsw_pins_default: mcu-cpsw-default-pins {
> > > >           pinctrl-single,pins = <
> > > >               J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
> > > > @@ -560,6 +567,157 @@ eeprom@51 {
> > > >           compatible = "atmel,24c512";
> > > >           reg = <0x51>;
> > > >       };
> > > > +
> > > > +    tps659413: pmic@48 {
> > > > +        bootph-pre-ram;
> > > only for the leaf nodes. See
> > > https://libera.irclog.whitequark.org/armlinux/2023-10-19
> > 
> > 
> > AFAIK, please correct me, u-boot still needs in all nodes ?
> > 
> 
> That's what I believe as well, is it better to have only the leaf nodes in
> kernel and have U-Boot DTSI handle the parent bootph properties? If so I'll
> send out v10 making change accordingly.
> 

Yes, u-boot today needs it in all nodes. BUT, u-boot needs to be fixed in
line to obey the rules of the schema convention that Rob clarified in
the discussion above.

The other choice is NOT to introduce new bootph properties till u-boot
is fixed up (this is also why I haven't sent out further updates for
bootph properties for kernel in this cycle).
  
Neha Malcom Francis Dec. 8, 2023, 5:39 a.m. UTC | #5
Hi Nishanth

On 07/12/23 19:19, Nishanth Menon wrote:
> On 11:01-20231207, Neha Malcom Francis wrote:
>> Hi Nishanth, Udit,
>>
>> On 07/12/23 10:12, Kumar, Udit wrote:
>>>
>>> On 12/5/2023 8:46 PM, Nishanth Menon wrote:
>>>> On 15:04-20231205, Neha Malcom Francis wrote:
>>>>> This patch adds support for TPS6594 PMIC family on wakeup I2C0 bus.
>>>>> These devices provide regulators (bucks and LDOs), but also GPIOs, a
>>>>> RTC, a watchdog, an ESM (Error Signal Monitor) which monitors the SoC
>>>>> error output signal, and a PFSM (Pre-configurable Finite State Machine)
>>>>> which manages the operational modes of the PMIC.
>>>>>
>>>>> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
>>>>> ---
>>>>>    arch/arm64/boot/dts/ti/k3-j721e-sk.dts | 158 +++++++++++++++++++++++++
>>>>>    1 file changed, 158 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>>>> b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>>>> index 42fe8eee9ec8..e600825f7e78 100644
>>>>> --- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>>>> +++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
>>>>> @@ -459,6 +459,13 @@ J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3)
>>>>> EXT_REFCLK1.GPIO1_12 */
>>>>>    };
>>>>>    &wkup_pmx0 {
>>>>> +    pmic_irq_pins_default: pmic-irq-default-pins {
>>>>> +        bootph-pre-ram;
>>>>> +        pinctrl-single,pins = <
>>>>> +            J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
>>>>> +        >;
>>>>> +    };
>>>>> +
>>>>>        mcu_cpsw_pins_default: mcu-cpsw-default-pins {
>>>>>            pinctrl-single,pins = <
>>>>>                J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
>>>>> @@ -560,6 +567,157 @@ eeprom@51 {
>>>>>            compatible = "atmel,24c512";
>>>>>            reg = <0x51>;
>>>>>        };
>>>>> +
>>>>> +    tps659413: pmic@48 {
>>>>> +        bootph-pre-ram;
>>>> only for the leaf nodes. See
>>>> https://libera.irclog.whitequark.org/armlinux/2023-10-19
>>>
>>>
>>> AFAIK, please correct me, u-boot still needs in all nodes ?
>>>
>>
>> That's what I believe as well, is it better to have only the leaf nodes in
>> kernel and have U-Boot DTSI handle the parent bootph properties? If so I'll
>> send out v10 making change accordingly.
>>
> 
> Yes, u-boot today needs it in all nodes. BUT, u-boot needs to be fixed in
> line to obey the rules of the schema convention that Rob clarified in
> the discussion above.
> 
> The other choice is NOT to introduce new bootph properties till u-boot
> is fixed up (this is also why I haven't sent out further updates for
> bootph properties for kernel in this cycle).
> 

I think we can have it following kernel convention here and fix up in the U-Boot 
DTSI for this series since PMIC nodes are needed. Thanks!
  

Patch

diff --git a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
index 42fe8eee9ec8..e600825f7e78 100644
--- a/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-j721e-sk.dts
@@ -459,6 +459,13 @@  J721E_IOPAD(0x234, PIN_INPUT, 7) /* (U3) EXT_REFCLK1.GPIO1_12 */
 };
 
 &wkup_pmx0 {
+	pmic_irq_pins_default: pmic-irq-default-pins {
+		bootph-pre-ram;
+		pinctrl-single,pins = <
+			J721E_WKUP_IOPAD(0x0cc, PIN_INPUT, 7) /* (G28) WKUP_GPIO0_7 */
+		>;
+	};
+
 	mcu_cpsw_pins_default: mcu-cpsw-default-pins {
 		pinctrl-single,pins = <
 			J721E_WKUP_IOPAD(0x84, PIN_INPUT, 0) /* (B24) MCU_RGMII1_RD0 */
@@ -560,6 +567,157 @@  eeprom@51 {
 		compatible = "atmel,24c512";
 		reg = <0x51>;
 	};
+
+	tps659413: pmic@48 {
+		bootph-pre-ram;
+		compatible = "ti,tps6594-q1";
+		reg = <0x48>;
+		system-power-controller;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmic_irq_pins_default>;
+		interrupt-parent = <&wkup_gpio0>;
+		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+		ti,primary-pmic;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		buck123-supply = <&vsys_3v3>;
+		buck4-supply = <&vsys_3v3>;
+		buck5-supply = <&vsys_3v3>;
+		ldo1-supply = <&vsys_3v3>;
+		ldo2-supply = <&vsys_3v3>;
+		ldo3-supply = <&vsys_3v3>;
+		ldo4-supply = <&vsys_3v3>;
+
+		regulators {
+			bootph-pre-ram;
+			bucka123: buck123 {
+				bootph-pre-ram;
+				regulator-name = "vdd_cpu_avs";
+				regulator-min-microvolt = <600000>;
+				regulator-max-microvolt = <900000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			bucka4: buck4 {
+				regulator-name = "vdd_mcu_0v85";
+				regulator-min-microvolt = <850000>;
+				regulator-max-microvolt = <850000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			bucka5: buck5 {
+				regulator-name = "vdd_phyio_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldoa1: ldo1 {
+				regulator-name = "vdd1_lpddr4_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldoa2: ldo2 {
+				regulator-name = "vdd_mcuio_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldoa3: ldo3 {
+				regulator-name = "vdda_dll_0v8";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldoa4: ldo4 {
+				regulator-name = "vda_mcu_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
+
+	tps659411: pmic@4c {
+		compatible = "ti,tps6594-q1";
+		reg = <0x4c>;
+		system-power-controller;
+		interrupt-parent = <&wkup_gpio0>;
+		interrupts = <9 IRQ_TYPE_EDGE_FALLING>;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		buck1234-supply = <&vsys_3v3>;
+		buck5-supply = <&vsys_3v3>;
+		ldo1-supply = <&vsys_3v3>;
+		ldo2-supply = <&vsys_3v3>;
+		ldo3-supply = <&vsys_3v3>;
+		ldo4-supply = <&vsys_3v3>;
+
+		regulators {
+			buckb1234: buck1234 {
+				regulator-name = "vdd_core_0v8";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buckb5: buck5 {
+				regulator-name = "vdd_ram_0v85";
+				regulator-min-microvolt = <850000>;
+				regulator-max-microvolt = <850000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldob1: ldo1 {
+				regulator-name = "vdd_sd_dv";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldob2: ldo2 {
+				regulator-name = "vdd_usb_3v3";
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldob3: ldo3 {
+				regulator-name = "vdd_io_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldob4: ldo4 {
+				regulator-name = "vda_pll_1v8";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
 };
 
 &mcu_uart0 {