2023-08-09 21:45:56

by Jai Luthra

[permalink] [raw]
Subject: [PATCH v6 0/7] Add TPS6594 PMIC support on several boards

TPS6594 is a Power Management IC which provides regulators and others
features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and
PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can
communicate through the I2C or SPI interfaces.
TPS6594 is the super-set device while TPS6593 and LP8764 are derivatives.

This serie adds device tree nodes for TI TPS6594 PMICs found in the
following boards:
- J721EXSOMXEVM:
Link: https://www.ti.com/tool/J721EXSOMXEVM
- J721S2XSOMXEVM:
Link: https://www.ti.com/tool/J721S2XSOMXEVM
- J7200XSOMXEVM:
Link: https://www.ti.com/tool/J7200XSOMXEVM
- AM62A-SKEVM:
Link: https://www.ti.com/tool/SK-AM62A-LP
- J784S4XEVM
Link: https://www.ti.com/tool/J784S4XEVM

---
Changes from v5:
https://lore.kernel.org/all/[email protected]
- Range-diff: http://0x0.st/H_fD.diff
- Reword the patch fixing interrupt ranges for mcu domain gpio intr, and
add Fixes: tag
- Also fix interrupt ranges for main domain gpio intr in the same patch
- Change pinctrl node names to end in -pins to fix dtbs_check warnings
- (New Patch) Enable TPS6594 in defconfig

Changes from v4:
https://lore.kernel.org/all/[email protected]/
- Range-diff: https://0x0.st/H_L7.diff
- Rebased on top of linux-next
- Fix min voltage on vdd_usb_3v3 regulator (ldo2) on j721e-som
- Use 3-hex-digit format for pinctrl values

Changes from v3:
https://lore.kernel.org/all/[email protected]/
- Rebased on top of v6.5-rc1.
- Change pinctrl number for irq pin as wkup_pmx0 was split on some boards.
- Use already present wkup_i2c0 node instead of creating a new one.

Changes from v2:
https://lore.kernel.org/lkml/[email protected]/
- Change node name as per Krzysztof review.
- Add a fix for the interrupt range of wakeup gpio used by TPS6594 pmic
on J784S4.
The interruptions of the PMIC were not working before that.
- Remove dependencies on other patch series as that was a mistake, see
https://lore.kernel.org/lkml/CRYY2V3HJ0CP.96JQ18PLZB3C@burritosblues/

Changes from v1:
https://lore.kernel.org/lkml/[email protected]/
- Harmonize regulators names across the different boards.
- Adjust AVS voltage range.
- Remove some outdated comments.
- Add PMIC to J784S4 board.
- Compatible string modified to match dt-bindings.
- Add gpio-controller and gpio-cells properties.

---
Apelete Seketeli (1):
arm64: dts: ti: k3-j784s4: Fix interrupt ranges for wkup & main gpio

Esteban Blanc (2):
arm64: dts: ti: k3-j7200-som-p0: Add TP6594 family PMICs
arm64: dts: ti: k3-j721s2-som-p0: Add TP6594 family PMICs

Jai Luthra (1):
arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A

Jerome Neanne (2):
arm64: dts: ti: k3-j721e-som-p0: Add TP6594 family PMICs
arm64: dts: ti: k3-j784s4-evm: Add support for TPS6594 PMIC

Julien Panis (1):
arm64: dts: ti: k3-am62a7-sk: Add support for TPS6593 PMIC

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 95 +++++++++++
arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi | 157 ++++++++++++++++++
arch/arm64/boot/dts/ti/k3-j721e-som-p0.dtsi | 163 +++++++++++++++++++
arch/arm64/boot/dts/ti/k3-j721s2-som-p0.dtsi | 199 +++++++++++++++++++++++
arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 104 ++++++++++++
arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +-
arch/arm64/configs/defconfig | 1 +
8 files changed, 721 insertions(+), 2 deletions(-)
---
base-commit: 21ef7b1e17d039053edaeaf41142423810572741
change-id: 20230809-tps6594-e450b5738e66

Best regards,
--
Jai Luthra <[email protected]>



2023-08-09 22:03:37

by Jai Luthra

[permalink] [raw]
Subject: [PATCH v6 1/7] arm64: dts: ti: k3-j7200-som-p0: Add TP6594 family PMICs

From: Esteban Blanc <[email protected]>

This patch adds support for TPS6594 PMIC family on wakup I2C0 bus.
Theses devices provides 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: Esteban Blanc <[email protected]>
Signed-off-by: Jai Luthra <[email protected]>
---
arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi | 157 ++++++++++++++++++++++++++++
1 file changed, 157 insertions(+)

diff --git a/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi b/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
index b37f4f88ece4..51ed611585dd 100644
--- a/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi
@@ -127,6 +127,14 @@ J721E_WKUP_IOPAD(0x9c, PIN_INPUT_PULLUP, 0) /* (H21) WKUP_I2C0_SDA */
};
};

+&wkup_pmx3 {
+ pmic_irq_pins_default: pmic-irq-default-pins {
+ pinctrl-single,pins = <
+ J721E_WKUP_IOPAD(0x01c, PIN_INPUT, 7) /* (E18) WKUP_GPIO0_84 */
+ >;
+ };
+};
+
&main_pmx0 {
main_i2c0_pins_default: main-i2c0-default-pins {
pinctrl-single,pins = <
@@ -264,6 +272,155 @@ eeprom@50 {
compatible = "atmel,24c256";
reg = <0x50>;
};
+
+ tps659414: pmic@48 {
+ compatible = "ti,tps6594-q1";
+ reg = <0x48>;
+ ti,primary-pmic;
+ system-power-controller;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&pmic_irq_pins_default>;
+ interrupt-parent = <&wkup_gpio0>;
+ interrupts = <84 IRQ_TYPE_EDGE_FALLING>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ buck1-supply = <&vsys_3v3>;
+ buck2-supply = <&vsys_3v3>;
+ buck3-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 {
+ bucka1: buck1 {
+ regulator-name = "vda_mcu_1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ bucka2: buck2 {
+ regulator-name = "vdd_mcuio_1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ bucka3: buck3 {
+ regulator-name = "vdd_mcu_0v85";
+ regulator-min-microvolt = <850000>;
+ regulator-max-microvolt = <850000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ bucka4: buck4 {
+ regulator-name = "vdd_ddr_1v1";
+ regulator-min-microvolt = <1100000>;
+ regulator-max-microvolt = <1100000>;
+ 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 = "vda_dll_0v8";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ ldoa3: ldo3 {
+ regulator-name = "vdd_wk_0v8";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ ldoa4: ldo4 {
+ regulator-name = "vda_pll_1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+ };
+ };
+
+ lp876441: pmic@4c {
+ compatible = "ti,lp8764-q1";
+ reg = <0x4c>;
+ system-power-controller;
+ interrupt-parent = <&wkup_gpio0>;
+ interrupts = <84 IRQ_TYPE_EDGE_FALLING>;
+
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ buck1-supply = <&vsys_3v3>;
+ buck2-supply = <&vsys_3v3>;
+ buck3-supply = <&vsys_3v3>;
+ buck4-supply = <&vsys_3v3>;
+
+ regulators: regulators {
+ buckb1: buck1 {
+ regulator-name = "vdd_cpu_avs";
+ regulator-min-microvolt = <600000>;
+ regulator-max-microvolt = <900000>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ buckb2: buck2 {
+ regulator-name = "vdd_ram_0v85";
+ regulator-min-microvolt = <850000>;
+ regulator-max-microvolt = <850000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ buckb3: buck3 {
+ regulator-name = "vdd_core_0v85";
+ regulator-min-microvolt = <850000>;
+ regulator-max-microvolt = <850000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+
+ buckb4: buck4 {
+ regulator-name = "vdd_io_1v8";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+ };
+ };
};

&ospi0 {

--
2.41.0


2023-08-10 04:00:27

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH v6 0/7] Add TPS6594 PMIC support on several boards

On 01:16-20230810, Jai Luthra wrote:
> arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 95 +++++++++++
> arch/arm64/boot/dts/ti/k3-j7200-som-p0.dtsi | 157 ++++++++++++++++++
> arch/arm64/boot/dts/ti/k3-j721e-som-p0.dtsi | 163 +++++++++++++++++++
> arch/arm64/boot/dts/ti/k3-j721s2-som-p0.dtsi | 199 +++++++++++++++++++++++

Sigh.. Thanks Jai for stepping and trying to make this work, but I think
this series is a lot out of whack. Apparently somewhere in this series
is a patch for j721s2 that breaks proper boot. I spent quite a while
bisecting across boards to find it, So, I am just going to skip this
series for this release (and dependencies)

Next time for this series: I recommend submitter provide test
logs for every single platform touched.

https://gist.github.com/nmenon/72e5f9b344e9207863d93491f5bf4f8e

I have'nt debugged, but typically that looks like some one decided to
pull the voltage low on a key rail.

Let me see if I can pick the interrupt range fix at least since
should'nt be dependent on this.

> arch/arm64/boot/dts/ti/k3-j784s4-evm.dts | 104 ++++++++++++
> arch/arm64/boot/dts/ti/k3-j784s4-main.dtsi | 2 +-
> arch/arm64/boot/dts/ti/k3-j784s4-mcu-wakeup.dtsi | 2 +-
> arch/arm64/configs/defconfig | 1 +
> 8 files changed, 721 insertions(+), 2 deletions(-)
> ---
> base-commit: 21ef7b1e17d039053edaeaf41142423810572741
> change-id: 20230809-tps6594-e450b5738e66
>
> Best regards,
> --
> Jai Luthra <[email protected]>
>


bisect log: (commit sha's dont mean a thing.. but anyways..)
git bisect start
# good: [f2e72716f089d6fcc4bf7b8cb7ac874b79ed05b1] iommu: dev->iommu->iommu_dev must be set before ops->device_group()
git bisect good f2e72716f089d6fcc4bf7b8cb7ac874b79ed05b1
# bad: [31f83ee5e42290c39e0bce42118ad1267eaf2790] arm64: dts: ti: k3-am64: Enable TSCADC nodes at the board level
git bisect bad 31f83ee5e42290c39e0bce42118ad1267eaf2790
# bad: [f51a52fc98cddb7b99ecb19d86c40845f7e8d91e] arm64: dts: ti: k3-am62a7-sk: Split vcc_3v3 regulators
git bisect bad f51a52fc98cddb7b99ecb19d86c40845f7e8d91e
# good: [0cc1aecdc1024eced6914f015dbc43c28f5ac6aa] arm64: dts: ti: k3-j721s2-som-p0: Add TP6594 family PMICs
git bisect good 0cc1aecdc1024eced6914f015dbc43c28f5ac6aa
# good: [8b4e4f23f60df9c8aadb0e26cb86b13735ed810b] arm64: dts: ti: k3-j784s4-evm: Add support for TPS6594 PMIC
git bisect good 8b4e4f23f60df9c8aadb0e26cb86b13735ed810b
# bad: [38ff20140c2cf09ba140234732dd03a9743ebd32] arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A
git bisect bad 38ff20140c2cf09ba140234732dd03a9743ebd32
# good: [3e98e865a6135bef7d801b5c5236a42a0ef1bff2] arm64: dts: ti: k3-am62a7-sk: Add support for TPS6593 PMIC
git bisect good 3e98e865a6135bef7d801b5c5236a42a0ef1bff2
# first bad commit: [38ff20140c2cf09ba140234732dd03a9743ebd32] arm64: defconfig: Enable TPS6593 PMIC for SK-AM62A


--

Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

2023-08-10 07:23:21

by Nishanth Menon

[permalink] [raw]
Subject: Re: (subset) [PATCH v6 0/7] Add TPS6594 PMIC support on several boards

Hi Jai Luthra,

On Thu, 10 Aug 2023 01:16:18 +0530, Jai Luthra wrote:
> TPS6594 is a Power Management IC which provides regulators and others
> features like GPIOs, RTC, watchdog, ESMs (Error Signal Monitor), and
> PFSM (Pre-configurable Finite State Machine). The SoC and the PMIC can
> communicate through the I2C or SPI interfaces.
> TPS6594 is the super-set device while TPS6593 and LP8764 are derivatives.
>
> This serie adds device tree nodes for TI TPS6594 PMICs found in the
> following boards:
> - J721EXSOMXEVM:
> - J721S2XSOMXEVM:
> - J7200XSOMXEVM:
> - AM62A-SKEVM:
> - J784S4XEVM
>
> [...]

As I mentioned in the previous response - this needs much deeper review - I
recommend actual test log and board schematics links to cross verify we are
modifying the correct platforms in the right manner. So, I am not picking up
the defconfig either as it did'nt make sense to pick it up without dts
actually using it.

Only patch I could reasonably pick is the one below (ideally should
have been sent independent of the series, but, ok.).

I have applied the following to branch ti-k3-dts-next on [1].
Thank you!

[4/7] arm64: dts: ti: k3-j784s4: Fix interrupt ranges for wkup & main gpio
commit: 05a1f130101e7a49ff1e8734939facd43596ea26

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--

Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D