Subject: [PATCH v3 00/18] TI TPS6594 PMIC support for multiple TI EVMs

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 series fixes LDO voltage conversion for TPS6594 PMIC, it adds support for its derivatives.
The features implemented are: - Regulators - Watchdog disable
Watchdog disable is not a watchdog driver implementation. Watchdog is active by default causing a reboot even if not used. This implementation allows to disable the watchdog at boot time.
This patch suite can be applied only after u-boot dts upstream is re-synced on latest Linux dts: Link: https://gist.github.com/nmenon/030b11b085473fa008145429b39fcc75
This should be applied on top of Linux patch series (for dts inheritence): Link: https://lore.kernel.org/all/20230417154832.216774-1-eblanc@baylibre.com/
Additionally, it should also be applied on top of U-Boot patch series for j784s4 initial board support: Link: https://lore.kernel.org/all/20230321141028.24456-1-hnagalla@ti.com/
Tested on boards listed below (resynched manually on Linux 6.3 dts)
Supported 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 - j784S4XEVM Link: https://www.ti.com/tool/J784S4XEVM - AM62A-SKEVM: Link: https://www.ti.com/tool/SK-AM62A-LP
basic tests: => pmic list => regulator list => regulator dev reg_name_to_be_tested => regulator info => regulator value => regulator value my_test_val => regulator value Check watchdog reset is not happening when dip switch SW2 on GPIO8 is High.
History:
v1 Changes: - Link: https://lore.kernel.org/all/20230406153820.2800054-1-jneanne@baylibre.com/
v2 Changes: - added support for 2 additional boards: j721s2 and j7200 - Convert driver model tags to use new schema: 8c103c33f - Link: https://lore.kernel.org/all/20230407133347.2957435-1-jneanne@baylibre.com/
v3 Changes: - addressed v2 review comments - clear WD_EN bit in stop_watchdog() function - use generic node names for pmic and watchdog - added support for 1 additional board: j784s4
Apelete Seketeli (3): DONOTMERGE: arch: arm: dts: k3-j784s4-evm: Add TI TPS6594 PMIC support arch: arm: dts: k3-j784s4-r5-evm: Add TI TPS6594 PMIC support configs: j784s4_evm_a72: Enable TI TPS6594 PMIC support
Esteban Blanc (4): configs: j7200_evm: Enable TP6594 family PMICs configs: j721s2_evm: Enable TP6594 PMIC and AVS0 board: ti: k3-j721s2: Force TPS65941 PMIC WD disable board: ti: k3-j721s2: Enable AVS0 on board init
Jerome Neanne (10): drivers: pmic: TPS65941 add support for WD disable drivers: regulator: Fixes for TPS65941 LDO voltage conversion configs: j721e_evm: Add support for TPS65941 PMICs on j721e TI EVM board board: ti: k3-j721e: Force TPS65941 PMIC WD disable on j721e TI EVM board DONOTMERGE: arm: dts: k3-j721e: u-boot overlay for TI tps6594 PMIC DONOTMERGE: arm: dts: k3-j721e: refactor r5 board file to use Linux dts tps6594 description DONOTMERGE: arm: dts: k3-j721e: realign node name on linux dts name DONOTMERGE: arm: dts: k3-am62a7-sk: Add TI TPS6593 PMIC support DONOTMERGE: arm: dts: k3-j7200: Add TP6594 family PMICs DONOTMERGE: arch: arm: dts: k3-j721s2: Add TPS6594 family PMICs
Julien Panis (1): configs: am62ax_evm_a53: Enable support for TI TPS6593 PMIC
arch/arm/dts/k3-am62a7-sk-u-boot.dtsi | 24 +++- .../k3-j7200-common-proc-board-u-boot.dtsi | 27 ++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 56 +++----- .../k3-j721e-common-proc-board-u-boot.dtsi | 22 +++ .../k3-j721e-r5-common-proc-board-u-boot.dtsi | 2 +- .../arm/dts/k3-j721e-r5-common-proc-board.dts | 48 +++---- .../k3-j721s2-common-proc-board-u-boot.dtsi | 37 ++++- .../dts/k3-j721s2-r5-common-proc-board.dts | 44 ++++++ arch/arm/dts/k3-j784s4-evm-u-boot.dtsi | 12 ++ arch/arm/dts/k3-j784s4-r5-evm.dts | 134 ++++++++++++++++++ board/ti/j721e/evm.c | 8 ++ board/ti/j721s2/evm.c | 18 ++- configs/am62ax_evm_a53_defconfig | 8 +- configs/j7200_evm_a72_defconfig | 6 + configs/j721e_evm_a72_defconfig | 6 + configs/j721s2_evm_a72_defconfig | 6 + configs/j721s2_evm_r5_defconfig | 6 + configs/j784s4_evm_a72_defconfig | 19 +-- drivers/power/pmic/tps65941.c | 61 ++++++++ drivers/power/regulator/tps65941_regulator.c | 71 ++++++++-- include/power/tps65941.h | 27 +++- 21 files changed, 558 insertions(+), 84 deletions(-)

From: Jerome Neanne jneanne@baylibre.com
This is not a proper WD driver because it's not planned to support WD driver for PMIC in u-boot at any time. The purpose is just WD disable.
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- drivers/power/pmic/tps65941.c | 61 +++++++++++++++++++++++++++++++++++ include/power/tps65941.h | 27 ++++++++++++++-- 2 files changed, 86 insertions(+), 2 deletions(-)
diff --git a/drivers/power/pmic/tps65941.c b/drivers/power/pmic/tps65941.c index 83d0f83c64..974c8c90dc 100644 --- a/drivers/power/pmic/tps65941.c +++ b/drivers/power/pmic/tps65941.c @@ -47,6 +47,9 @@ static int tps65941_bind(struct udevice *dev) ofnode regulators_node; int children;
+ if (dev->driver_data == TPS65941_WD) + return 0; + regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { debug("%s: %s regulators subnode not found!\n", __func__, @@ -64,6 +67,61 @@ static int tps65941_bind(struct udevice *dev) return dm_scan_fdt_dev(dev); }
+static int stop_watchdog(struct udevice *wd_i2c_dev) +{ + int ret; + + /* Maintain WD long window */ + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_MODE_REG); + if (ret < 0) { + debug("failed to read i2c reg (%d)\n", ret); + return ret; + } + + ret &= ~TPS65941_WD_PWRHOLD_MASK; + ret |= TPS65941_WD_PWRHOLD_MASK; + ret = dm_i2c_reg_write(wd_i2c_dev, TPS65941_WD_MODE_REG, ret); + if (ret) { + debug("%s: %s write WD_PWRHOLD fail!\n", __func__, wd_i2c_dev->name); + return ret; + } + + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_MODE_REG); + if (ret < 0) { + debug("failed to read back i2c reg (%d)\n", ret); + return ret; + } + + /* Disable WD */ + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_THR_CFG); + if (ret < 0) { + debug("failed to read i2c reg (%d)\n", ret); + return ret; + } + + ret &= ~TPS65941_WD_EN_MASK; + ret = dm_i2c_reg_write(wd_i2c_dev, TPS65941_WD_THR_CFG, ret); + if (ret) { + debug("%s: %s write WD_EN fail!\n", __func__, wd_i2c_dev->name); + return ret; + } + + ret = dm_i2c_reg_read(wd_i2c_dev, TPS65941_WD_THR_CFG); + if (ret < 0) { + debug("failed to read back i2c reg (%d)\n", ret); + return ret; + } + + return 0; +} + +static int tps65941_probe(struct udevice *dev) +{ + if (dev->driver_data == TPS65941_WD) + return stop_watchdog(dev); + return 0; +} + static struct dm_pmic_ops tps65941_ops = { .read = tps65941_read, .write = tps65941_write, @@ -73,7 +131,9 @@ static const struct udevice_id tps65941_ids[] = { { .compatible = "ti,tps659411", .data = TPS659411 }, { .compatible = "ti,tps659412", .data = TPS659411 }, { .compatible = "ti,tps659413", .data = TPS659413 }, + { .compatible = "ti,tps659312", .data = TPS659312 }, { .compatible = "ti,lp876441", .data = LP876441 }, + { .compatible = "ti,tps65941_watchdog", .data = TPS65941_WD }, { } };
@@ -82,5 +142,6 @@ U_BOOT_DRIVER(pmic_tps65941) = { .id = UCLASS_PMIC, .of_match = tps65941_ids, .bind = tps65941_bind, + .probe = tps65941_probe, .ops = &tps65941_ops, }; diff --git a/include/power/tps65941.h b/include/power/tps65941.h index a2bc6814ba..f3bf25a6d2 100644 --- a/include/power/tps65941.h +++ b/include/power/tps65941.h @@ -2,7 +2,9 @@ #define TPS659412 0x1 #define TPS659413 0x2 #define TPS659414 0x3 -#define LP876441 0x4 +#define TPS659312 0x4 +#define LP876441 0x5 +#define TPS65941_WD 0x20
/* I2C device address for pmic tps65941 */ #define TPS65941_I2C_ADDR (0x12 >> 1) @@ -18,10 +20,31 @@ #define TPS65941_BUCK_VOLT_MAX 3340000 #define TPS65941_BUCK_MODE_MASK 0x1
-#define TPS65941_LDO_VOLT_MASK 0x3E +#define TPS65941_LDO_VOLT_MASK 0x7F #define TPS65941_LDO_VOLT_MAX_HEX 0x3A #define TPS65941_LDO_VOLT_MIN_HEX 0x4 #define TPS65941_LDO_VOLT_MAX 3300000 #define TPS65941_LDO_MODE_MASK 0x1 #define TPS65941_LDO_BYPASS_EN 0x80 #define TP65941_BUCK_CONF_SLEW_MASK 0x7 + +/* BYPASS is bit7 of VOUT TPS65941_LDO_BYP_MASK */ +#define TPS65941_LDO123_BYP_CONFIG 7 + +#define TPS65941_LDO123_VOLT_BYP_MIN 1700000 +#define TPS65941_LDO123_VOLT_BYP_MAX 3600000 +#define TPS65941_LDO123_VOLT_MIN 600000 +#define TPS65941_LDO4_VOLT_MIN 1200000 +#define TPS65941_LDO4_VOLT_MIN 1200000 +#define TPS65941_LDO123_VSET_MIN 0x04 +#define TPS65941_LDO4_VSET_MIN 0x20 +#define TPS65941_LDO123_VSET_MAX 0x3A +#define TPS65941_LDO4_VSET_MAX 0x74 +#define TPS65941_LDO123_STEP 50000 +#define TPS65941_LDO4_STEP 25000 + +#define TPS65941_WD_MODE_REG 0x406 +#define TPS65941_WD_PWRHOLD_MASK BIT(2) + +#define TPS65941_WD_THR_CFG 0x409 +#define TPS65941_WD_EN_MASK BIT(6)

From: Jerome Neanne jneanne@baylibre.com
Fixes: 065a452ae6a power: regulator: tps65941: add regulator support
LDO voltage conversion was incorrect. This was checked by writing and reading back value.
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- drivers/power/regulator/tps65941_regulator.c | 71 +++++++++++++++++--- 1 file changed, 63 insertions(+), 8 deletions(-)
diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c index b041126775..7afd68c5c4 100644 --- a/drivers/power/regulator/tps65941_regulator.c +++ b/drivers/power/regulator/tps65941_regulator.c @@ -212,12 +212,55 @@ static int tps65941_ldo_enable(struct udevice *dev, int op, bool *enable) return 0; }
-static int tps65941_ldo_val2volt(int val) +static int tps65941_ldo_volt2val(int idx, int uV) { - if (val > TPS65941_LDO_VOLT_MAX_HEX || val < TPS65941_LDO_VOLT_MIN_HEX) + int base = TPS65941_LDO123_VOLT_MIN; + int max = TPS65941_LDO_VOLT_MAX; + int offset = TPS65941_LDO123_VSET_MIN; + int step = TPS65941_LDO123_STEP; + + if (idx > 2) { + base = TPS65941_LDO4_VOLT_MIN; + offset = TPS65941_LDO4_VSET_MIN; + step = TPS65941_LDO4_STEP; + } + + if (uV > max) return -EINVAL; - else if (val >= TPS65941_LDO_VOLT_MIN_HEX) - return 600000 + (val - TPS65941_LDO_VOLT_MIN_HEX) * 50000; + else if (uV >= base) + return (uV - base) / step + offset; + else + return -EINVAL; +} + +static int tps65941_ldo_val2volt(int idx, int val) +{ + int reg_base = TPS65941_LDO123_VSET_MIN; + int reg_max = TPS65941_LDO123_VSET_MAX; + int base = TPS65941_LDO123_VOLT_MIN; + int max = TPS65941_LDO_VOLT_MAX; + int step = TPS65941_LDO123_STEP; + int mask = TPS65941_LDO_VOLT_MASK >> 1; + + if (idx > 2) { + base = TPS65941_LDO4_VOLT_MIN; + max = TPS65941_LDO_VOLT_MAX; + reg_base = TPS65941_LDO4_VSET_MIN; + reg_max = TPS65941_LDO4_VSET_MAX; + step = TPS65941_LDO4_STEP; + mask = TPS65941_LDO_VOLT_MASK; + } else { + val = val >> 1; + } + + if (val > mask || val < 0) + return -EINVAL; + else if (val >= reg_max) + return max; + else if (val <= reg_base) + return base; + else if (val >= 0) + return base + (step * (val - reg_base)); else return -EINVAL; } @@ -227,7 +270,9 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) unsigned int hex, adr; int ret; struct dm_regulator_uclass_plat *uc_pdata; + int idx;
+ idx = dev->driver_data - 1; uc_pdata = dev_get_uclass_plat(dev);
if (op == PMIC_OP_GET) @@ -240,7 +285,8 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) return ret;
ret &= TPS65941_LDO_VOLT_MASK; - ret = tps65941_ldo_val2volt(ret); + ret = tps65941_ldo_val2volt(idx, ret); + if (ret < 0) return ret;
@@ -249,12 +295,21 @@ static int tps65941_ldo_val(struct udevice *dev, int op, int *uV) return 0; }
- hex = tps65941_buck_volt2val(*uV); + /* LDO1, LDO2 & LDO3 in BYPASS mode only supports 1.7V min to 3.6V max */ + if (idx < 2 && + (ret & BIT(TPS65941_LDO123_BYP_CONFIG)) && + *uV < TPS65941_LDO123_VOLT_BYP_MIN) + return -EINVAL; + + hex = tps65941_ldo_volt2val(idx, *uV); if (hex < 0) return hex;
- ret &= 0x0; - ret = hex; + if (idx < 2) + hex = hex << 1; + + ret &= ~TPS65941_LDO_VOLT_MASK; + ret |= hex;
ret = pmic_reg_write(dev->parent, adr, ret);

From: Jerome Neanne jneanne@baylibre.com
Add PMIC and regulators feature support for j721e. PMIC is controlled by SoC through I2C interface.
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- configs/j721e_evm_a72_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index d5f37b134c..af9a755c36 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -67,6 +67,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_SYS_MAXARGS=64 CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y +CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y @@ -79,6 +80,8 @@ CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus" CONFIG_MTDPARTS_DEFAULT="mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),1m(ospi.sysfw),256k(ospi.env.backup),57344k@8m(ospi.rootfs),256k(ospi.phypattern);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)" @@ -169,9 +172,12 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_REMOTEPROC_TI_K3_DSP=y

From: Jerome Neanne jneanne@baylibre.com
Using uclass_probe_all forces probe on all devices: Only probe for WD stop is really needed here. Probing other devices has no impact.
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- board/ti/j721e/evm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 2398bead78..c6391c1bae 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -25,6 +25,8 @@
#include "../common/board_detect.h"
+#include <power/tps65941.h> + #define board_is_j721e_som() (board_ti_k3_is("J721EX-PM1-SOM") || \ board_ti_k3_is("J721EX-PM2-SOM"))
@@ -41,6 +43,12 @@ DECLARE_GLOBAL_DATA_PTR;
int board_init(void) { + int ret; + + /* WD stop is applied unconditionally on all platforms*/ + ret = uclass_probe_all(UCLASS_PMIC); + if (ret) + printf("Failed to probe! stop tps65941 wd\n"); return 0; }

From: Jerome Neanne jneanne@baylibre.com
j721e board includes 2 instances of TPS6594: - Primary PMIC - Secondary PMIC
Add AVS class0 in u-boot SPL. AVS is supported only on CPU rail: vdd_cpu_avs. This rail is supplied by the primary PMIC: tps659413 This rail is supplied by a dual-phased buck: buck12.
Other PMICs rails are not AVS capable.
Each PMIC includes a Watchdog that is active by default at boot. This would issue a platform reset unless pmic GPIO8 is driven or this is handled by SW. Watchdog driver is not required for identified use of this product. This software disable inside u-boot avoids parasitic wd reset. GPIO8 can then be used for other purpose.
Board documentation: Link: https://www.ti.com/tool/J721EXSOMXEVM
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- .../k3-j721e-common-proc-board-u-boot.dtsi | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi index 867ec2bb1a..857d0c0529 100644 --- a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi @@ -79,6 +79,14 @@ chipid@43000014 { bootph-pre-ram; }; + + mcu_i2c0: i2c@40b00000 { + status = "okay"; + tps65941_wd: watchdog@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; + }; };
&secure_proxy_main { @@ -170,6 +178,20 @@
&wkup_i2c0 { bootph-pre-ram; + tps659413: pmic@48 { + bootph-pre-ram; + compatible = "ti,tps659413"; + + regulators { + bootph-pre-ram; + bucka12: buck12 { + bootph-pre-ram; + }; + }; + }; + tps659411: pmic@4c { + compatible = "ti,tps659411"; + }; };
&main_i2c0 {

From: Jerome Neanne jneanne@baylibre.com
Use a copy of Linux dts for TPS6594 PMIC description instead of custom u-boot
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- .../arm/dts/k3-j721e-r5-common-proc-board.dts | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-)
diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts index 1b40cf2580..f6456034d4 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board.dts @@ -21,6 +21,27 @@ tick-timer = &timer1; };
+ evm_12v0: fixedregulator-evm12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "evm_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + a72_0: a72@0 { compatible = "ti,am654-rproc"; reg = <0x0 0x00a90000 0x0 0x10>; @@ -277,33 +298,8 @@ ti,driver-strength-ohm = <50>; };
-&wkup_i2c0 { - bootph-pre-ram; - tps659413a: tps659413a@48 { - reg = <0x48>; - compatible = "ti,tps659413"; - bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&wkup_i2c0_pins_default>; - clock-frequency = <400000>; - - regulators: regulators { - bootph-pre-ram; - buck12_reg: buck12 { - /*VDD_CPU*/ - regulator-name = "buck12"; - regulator-min-microvolt = <600000>; - regulator-max-microvolt = <900000>; - regulator-always-on; - regulator-boot-on; - bootph-pre-ram; - }; - }; - }; -}; - &wkup_vtm0 { - vdd-supply-2 = <&buck12_reg>; + vdd-supply-2 = <&bucka12>; bootph-pre-ram; };

From: Jerome Neanne jneanne@baylibre.com
Change node name to reuse Linux common dts naming style.
Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi index f9746d33ec..332f3f4672 100644 --- a/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721e-r5-common-proc-board-u-boot.dtsi @@ -21,7 +21,7 @@ }; };
-&tps659413a { +&tps659413 { esm: esm { compatible = "ti,tps659413-esm"; bootph-pre-ram;

From: Julien Panis jpanis@baylibre.com
Add support for TPS6593 regulators and watchdog. PMIC is controlled by SoC through I2C interface.
Signed-off-by: Julien Panis jpanis@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- configs/am62ax_evm_a53_defconfig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig index 41fa6f38aa..70d1a03e6a 100644 --- a/configs/am62ax_evm_a53_defconfig +++ b/configs/am62ax_evm_a53_defconfig @@ -33,6 +33,7 @@ CONFIG_SPL_STACK_R=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" +CONFIG_SPL_I2C=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_POWER_DOMAIN=y CONFIG_CMD_MMC=y @@ -52,7 +53,8 @@ CONFIG_SPL_CLK=y CONFIG_CLK_TI_SCI=y CONFIG_TI_SCI_PROTOCOL=y # CONFIG_GPIO is not set -# CONFIG_I2C is not set +CONFIG_DM_I2C=y +CONFIG_SYS_I2C_OMAP24XX=y CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y CONFIG_MMC_SDHCI=y @@ -64,6 +66,10 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_REMOTEPROC_TI_K3_ARM64=y CONFIG_RESET_TI_SCI=y

From: Jerome Neanne jneanne@baylibre.com
Add support for TPS6593 PMIC devices: - regulators (bucks and LDOs) on main I2C0 bus, - watchdog on MCU I2C0 bus.
Signed-off-by: Julien Panis jpanis@baylibre.com Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- arch/arm/dts/k3-am62a7-sk-u-boot.dtsi | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi index cf938c43b8..fe392054c8 100644 --- a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi +++ b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi @@ -84,7 +84,14 @@ };
&mcu_pmx0 { - bootph-pre-ram; + status = "okay"; + + mcu_i2c0_pins_default: mcu_i2c0_pins_default { + pinctrl-single,pins = < + AM62X_MCU_IOPAD(0x044, PIN_INPUT_PULLUP, 0) /* (E12) MCU_I2C0_SCL */ + AM62X_MCU_IOPAD(0x048, PIN_INPUT_PULLUP, 0) /* (D9) MCU_I2C0_SDA */ + >; + }; };
&wkup_uart0 { @@ -96,7 +103,20 @@ };
&main_i2c0 { - bootph-pre-ram; + tps659312: pmic@48 { + compatible = "ti,tps659312"; + }; +}; + +&mcu_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mcu_i2c0_pins_default>; + + tps65931_wd: watchdog@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; };
&main_i2c0_pins_default {

From: Esteban Blanc eblanc@baylibre.com
Add support for TPS6594 family regulators and watchdog. PMIC is controlled by SoC through I2C interface.
Add dm, pmic and regulators commands to allow testing
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- configs/j7200_evm_a72_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/configs/j7200_evm_a72_defconfig b/configs/j7200_evm_a72_defconfig index e40900fffa..8850187924 100644 --- a/configs/j7200_evm_a72_defconfig +++ b/configs/j7200_evm_a72_defconfig @@ -70,6 +70,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_SYS_MAXARGS=64 CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y +CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y @@ -82,6 +83,8 @@ CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus" CONFIG_MTDPARTS_DEFAULT="mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),128k(ospi.env),128k(ospi.env.backup),1m(ospi.sysfw),-@8m(ospi.rootfs);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),1m(hbmc.sysfw),-@8m(hbmc.rootfs)" @@ -167,9 +170,12 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_REMOTEPROC_TI_K3_R5F=y

From: Jerome Neanne jneanne@baylibre.com
Add support for TPS6594 PMIC family devices: - regulators (bucks and LDOs) on WKUP_I2C0 bus, - watchdog on MCU_I2C0 bus.
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- .../k3-j7200-common-proc-board-u-boot.dtsi | 27 +++++++++ .../arm/dts/k3-j7200-r5-common-proc-board.dts | 56 ++++++++----------- 2 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi index f57c2306ba..5088f918e8 100644 --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi @@ -120,6 +120,15 @@
&wkup_i2c0 { bootph-pre-ram; + status = "okay"; +}; + +&mcu_i2c0 { + status="okay"; + tps65941_wd: watchdog@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; };
&main_i2c0 { @@ -196,3 +205,21 @@ &main_r5fss0 { ti,cluster-mode = <0>; }; + +&wkup_i2c0 { + bootph-pre-ram; + lp876441: pmic@4c { + bootph-pre-ram; + compatible = "ti,lp876441"; + regulators { + bootph-pre-ram; + buckb1: buck1 { + bootph-pre-ram; + }; + }; + }; +}; + +&tps659414 { + compatible = "ti,tps659411"; +}; diff --git a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts index e62f9218e8..1318edf9af 100644 --- a/arch/arm/dts/k3-j7200-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j7200-r5-common-proc-board.dts @@ -21,6 +21,27 @@ firmware-loader = &fs_loader0; };
+ evm_12v0: fixedregulator-evm12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "evm_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + fs_loader0: fs_loader@0 { bootph-all; compatible = "u-boot,fs-loader"; @@ -126,13 +147,6 @@ >; };
- wkup_i2c0_pins_default: wkup-i2c0-pins-default { - pinctrl-single,pins = < - J721E_WKUP_IOPAD(0x100, PIN_INPUT_PULLUP, 0) /* (F20) WKUP_I2C0_SCL */ - J721E_WKUP_IOPAD(0x104, PIN_INPUT_PULLUP, 0) /* (H21) WKUP_I2C0_SDA */ - >; - }; - mcu_fss0_hpb0_pins_default: mcu-fss0-hpb0-pins-default { pinctrl-single,pins = < J721E_WKUP_IOPAD(0x0, PIN_OUTPUT, 1) /* (E20) MCU_OSPI0_CLK.MCU_HYPERBUS0_CK */ @@ -247,35 +261,9 @@ ti,driver-strength-ohm = <50>; };
-&wkup_i2c0 { - bootph-pre-ram; - lp876441: lp876441@4c { - compatible = "ti,lp876441"; - reg = <0x4c>; - bootph-pre-ram; - pinctrl-names = "default"; - pinctrl-0 = <&wkup_i2c0_pins_default>; - clock-frequency = <400000>; - - regulators: regulators { - bootph-pre-ram; - buck1_reg: buck1 { - /*VDD_CPU_AVS_REG*/ - regulator-name = "buck1"; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1250000>; - regulator-always-on; - regulator-boot-on; - bootph-pre-ram; - }; - }; - }; - -}; - &wkup_vtm0 { - vdd-supply-2 = <&buck1_reg>; bootph-pre-ram; + vdd-supply-2 = <&buckb1>; };
&main_i2c0 {

From: Jerome Neanne jneanne@baylibre.com
Add support for TPS6594 PMIC family devices: - regulators (bucks and LDOs) on main WKUP_I2C0 bus, - watchdog on MCU_I2C0 bus.
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- .../k3-j721s2-common-proc-board-u-boot.dtsi | 37 +++++++++++++++- .../dts/k3-j721s2-r5-common-proc-board.dts | 44 +++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-)
diff --git a/arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi index 4fd6d36417..cb9f9ab86d 100644 --- a/arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi +++ b/arch/arm/dts/k3-j721s2-common-proc-board-u-boot.dtsi @@ -21,8 +21,26 @@ }; };
-&wkup_i2c0 { +&wkup_i2c0{ bootph-pre-ram; + tps659411: pmic@48 { + bootph-pre-ram; + compatible = "ti,tps659411"; + regulators { + bootph-pre-ram; + bucka1234: buck1234 { + bootph-pre-ram; + }; + }; + }; +}; + +&tps659414 { + compatible = "ti,tps659411"; +}; + +&lp876411 { + compatible = "ti,lp876441"; };
&cbass_main { @@ -47,6 +65,17 @@ chipid@43000014 { bootph-pre-ram; }; + + mcu_i2c0: i2c@40b00000 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mcu_i2c0_pins_default>; + + tps65941_wd: watchdog@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; + }; };
&mcu_navss { @@ -101,6 +130,12 @@
&wkup_pmx0 { bootph-pre-ram; + mcu_i2c0_pins_default: mcu_i2c0_pins_default { + pinctrl-single,pins = < + J721S2_WKUP_IOPAD(0x108, PIN_INPUT, 0) /* (G24) MCU_I2C0_SCL */ + J721S2_WKUP_IOPAD(0x10c, PIN_INPUT, 0) /* (J25) MCU_I2C0_SDA */ + >; + }; };
&k3_pds { diff --git a/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts b/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts index e02b334d10..8a24002045 100644 --- a/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts +++ b/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts @@ -21,6 +21,38 @@ remoteproc1 = &a72_0; };
+ evm_12v0: fixedregulator-evm12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "evm_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_5v0: fixedregulator-vsys5v0 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_5v0"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + fs_loader0: fs_loader@0 { compatible = "u-boot,fs-loader"; bootph-all; @@ -95,6 +127,13 @@ <&mcu_secproxy 23>; bootph-pre-ram; }; + + wkup_vtm0: vtm@42040000 { + compatible = "ti,am654-vtm", "ti,j721e-avs"; + reg = <0x0 0x42040000 0x0 0x330>; + power-domains = <&k3_pds 180 TI_SCI_PD_EXCLUSIVE>; + #thermal-sensor-cells = <1>; + }; };
&main_pmx0 { @@ -196,4 +235,9 @@ ti,sci = <&dm_tifs>; };
+&wkup_vtm0 { + vdd-supply-2 = <&bucka1234>; + bootph-pre-ram; +}; + #include "k3-j721s2-common-proc-board-u-boot.dtsi"

From: Esteban Blanc eblanc@baylibre.com
Add support for TPS6594 family regulators and watchdog. Add support for AVS0. PMIC is controlled by SoC through I2C interface.
Add dm, pmic and regulators commands to allow testing.
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Jerome Neanne jneanne@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- configs/j721s2_evm_a72_defconfig | 6 ++++++ configs/j721s2_evm_r5_defconfig | 6 ++++++ 2 files changed, 12 insertions(+)
diff --git a/configs/j721s2_evm_a72_defconfig b/configs/j721s2_evm_a72_defconfig index 594c8dad2c..407d43509d 100644 --- a/configs/j721s2_evm_a72_defconfig +++ b/configs/j721s2_evm_a72_defconfig @@ -68,6 +68,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_SYS_MAXARGS=64 CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y +CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y @@ -80,6 +81,8 @@ CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus" CONFIG_MTDPARTS_DEFAULT="mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),-@8m(hbmc.rootfs)" @@ -173,9 +176,12 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_REMOTEPROC_TI_K3_DSP=y diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig index 4ddbe8faef..01096fa937 100644 --- a/configs/j721s2_evm_r5_defconfig +++ b/configs/j721s2_evm_r5_defconfig @@ -114,6 +114,7 @@ CONFIG_DM_MAILBOX=y CONFIG_K3_SEC_PROXY=y CONFIG_FS_LOADER=y CONFIG_SPL_FS_LOADER=y +CONFIG_K3_AVS0=y CONFIG_SUPPORT_EMMC_BOOT=y CONFIG_SPL_MMC_HS400_SUPPORT=y CONFIG_MMC_SDHCI=y @@ -143,6 +144,11 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y +CONFIG_DM_REGULATOR=y +CONFIG_SPL_DM_REGULATOR=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_REMOTEPROC_TI_K3_ARM64=y CONFIG_RESET_TI_SCI=y

From: Esteban Blanc eblanc@baylibre.com
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- board/ti/j721s2/evm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c index 8eaca9d5af..ec7abea387 100644 --- a/board/ti/j721s2/evm.c +++ b/board/ti/j721s2/evm.c @@ -29,7 +29,14 @@ DECLARE_GLOBAL_DATA_PTR;
int board_init(void) { - return 0; + int ret = 0; + + /* WD stop is applied unconditionally on all platforms*/ + ret = uclass_probe_all(UCLASS_PMIC); + if (ret) + printf("Failed to probe! stop tps65941 wd\n"); + + return ret; }
int dram_init(void)

From: Esteban Blanc eblanc@baylibre.com
Signed-off-by: Esteban Blanc eblanc@baylibre.com Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- board/ti/j721s2/evm.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/board/ti/j721s2/evm.c b/board/ti/j721s2/evm.c index ec7abea387..818edea686 100644 --- a/board/ti/j721s2/evm.c +++ b/board/ti/j721s2/evm.c @@ -326,4 +326,13 @@ int board_late_init(void)
void spl_board_init(void) { + struct udevice *dev; + int ret; + +#if defined(CONFIG_CPU_V7R) && defined(CONFIG_K3_AVS0) + ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(k3_avs), + &dev); + if (ret) + printf("AVS init failed: %d\n", ret); +#endif }

Add support for TPS6594 PMIC devices : - overlaying regulators definition with compatible device, - watchdog on MCU_I2C0 bus.
Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- arch/arm/dts/k3-j784s4-evm-u-boot.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/arch/arm/dts/k3-j784s4-evm-u-boot.dtsi b/arch/arm/dts/k3-j784s4-evm-u-boot.dtsi index cd2e1e1df5..22bcf2cebe 100644 --- a/arch/arm/dts/k3-j784s4-evm-u-boot.dtsi +++ b/arch/arm/dts/k3-j784s4-evm-u-boot.dtsi @@ -24,6 +24,14 @@ u-boot,dm-spl; };
+&mcu_i2c0 { + status="okay"; + tps65941_wd: watchdog@12 { + compatible = "ti,tps65941_watchdog"; + reg = <0x12>; + }; +}; + &cbass_main { u-boot,dm-spl; }; @@ -133,3 +141,7 @@ &main_sdhci1 { u-boot,dm-spl; }; + +&tps659413 { + compatible = "ti,tps659411"; +};

Add support for TPS6594 PMIC devices : - regulators (bucks and LDOs) on WKUP_I2C0 bus, - watchdog on MCU_I2C0 bus.
Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- arch/arm/dts/k3-j784s4-r5-evm.dts | 134 ++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+)
diff --git a/arch/arm/dts/k3-j784s4-r5-evm.dts b/arch/arm/dts/k3-j784s4-r5-evm.dts index 7350a9be34..27b91100af 100644 --- a/arch/arm/dts/k3-j784s4-r5-evm.dts +++ b/arch/arm/dts/k3-j784s4-r5-evm.dts @@ -22,6 +22,27 @@ remoteproc1 = &a72_0; };
+ evm_12v0: fixedregulator-evm12v0 { + /* main supply */ + compatible = "regulator-fixed"; + regulator-name = "evm_12v0"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + regulator-always-on; + regulator-boot-on; + }; + + vsys_3v3: fixedregulator-vsys3v3 { + /* Output of LM5140 */ + compatible = "regulator-fixed"; + regulator-name = "vsys_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&evm_12v0>; + regulator-always-on; + regulator-boot-on; + }; + fs_loader0: fs_loader@0 { compatible = "u-boot,fs-loader"; u-boot,dm-pre-reloc; @@ -97,6 +118,105 @@ }; };
+&wkup_gpio0 { + status = "okay"; +}; + +&wkup_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&wkup_i2c0_pins_default>; + clock-frequency = <400000>; + tps659413: pmic@48 { + compatible = "ti,tps65941-q1"; + reg = <0x48>; + system-power-controller; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_irq_pins_default>; + interrupt-parent = <&wkup_gpio0>; + interrupts = <39 IRQ_TYPE_EDGE_FALLING>; + ti,primary-pmic; + + gpio-controller; + #gpio-cells = <2>; + + buck12-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 { + bucka12: buck12 { + regulator-name = "vdd_ddr_1v1"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-boot-on; + regulator-always-on; + }; + + bucka3: buck3 { + regulator-name = "vdd_ram_0v85"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-boot-on; + regulator-always-on; + }; + + bucka4: buck4 { + regulator-name = "vdd_io_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + bucka5: buck5 { + regulator-name = "vdd_mcu_0v85"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-boot-on; + regulator-always-on; + }; + + ldoa1: ldo1 { + regulator-name = "vdd_mcuio_1v8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + ldoa2: ldo2 { + regulator-name = "vdd_mcuio_3v3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + ldoa3: ldo3 { + regulator-name = "vds_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; + }; + }; + }; +}; + &main_pmx0 { u-boot,dm-spl;
@@ -144,6 +264,20 @@ J784S4_WKUP_IOPAD(0x0b4, PIN_OUTPUT, 0) /* (K34) WKUP_UART0_TXD */ >; }; + + wkup_i2c0_pins_default: wkup_i2c0_pins_default { + pinctrl-single,pins = < + J784S4_WKUP_IOPAD(0x100, PIN_INPUT, 0) /* (N33) WKUP_I2C0_SCL */ + J784S4_WKUP_IOPAD(0x104, PIN_INPUT, 0) /* (N35) WKUP_I2C0_SDA */ + >; + }; + + pmic_irq_pins_default: pmic-irq-pins-default { + pinctrl-single,pins = < + /* (G33) MCU_OSPI1_CSn1.WKUP_GPIO0_39 */ + J784S4_WKUP_IOPAD(0x060, PIN_INPUT, 7) + >; + }; };
&sms {

Enable TPS6594 PMIC support (regulators and watchdog) for j784s4 SoC. PMIC is controlled by SoC through I2C interface.
Signed-off-by: Apelete Seketeli aseketeli@baylibre.com --- configs/j784s4_evm_a72_defconfig | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/configs/j784s4_evm_a72_defconfig b/configs/j784s4_evm_a72_defconfig index 7de8925b27..df95bd58fd 100644 --- a/configs/j784s4_evm_a72_defconfig +++ b/configs/j784s4_evm_a72_defconfig @@ -8,12 +8,16 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y CONFIG_NR_DRAM_BANKS=2 CONFIG_SOC_K3_J784S4=y CONFIG_TARGET_J784S4_A72_EVM=y +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000 CONFIG_ENV_SIZE=0x20000 CONFIG_ENV_OFFSET=0x680000 CONFIG_DM_GPIO=y CONFIG_SPL_DM_SPI=y CONFIG_DEFAULT_DEVICE_TREE="k3-j784s4-evm" CONFIG_SPL_TEXT_BASE=0x80080000 +CONFIG_OF_LIBFDT_OVERLAY=y +CONFIG_DM_RESET=y CONFIG_SPL_MMC=y CONFIG_SPL_SERIAL=y CONFIG_SPL_DRIVERS_MISC=y @@ -24,14 +28,11 @@ CONFIG_SPL_LIBDISK_SUPPORT=y CONFIG_SPL_SPI_FLASH_SUPPORT=y CONFIG_SPL_SPI=y # CONFIG_PSCI_RESET is not set -CONFIG_DISTRO_DEFAULTS=y -CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y -CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80480000 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 -# CONFIG_USE_SPL_FIT_GENERATOR is not set CONFIG_OF_BOARD_SETUP=y +CONFIG_DISTRO_DEFAULTS=y CONFIG_BOOTCOMMAND="run findfdt; run envboot; run init_${boot}; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; setenv fdtfile ti/${name_fdt}; run distro_bootcmd" CONFIG_LOGLEVEL=7 CONFIG_SPL_MAX_SIZE=0xc0000 @@ -52,7 +53,6 @@ CONFIG_SPL_I2C=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_DM_SPI_FLASH=y -# CONFIG_SPL_NOR_SUPPORT=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_POWER_DOMAIN=y CONFIG_SPL_RAM_SUPPORT=y @@ -68,6 +68,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_SYS_MAXARGS=64 CONFIG_CMD_ASKENV=y CONFIG_CMD_DFU=y +CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPIO=y CONFIG_CMD_GPT=y @@ -80,6 +81,8 @@ CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y CONFIG_CMD_EXT4_WRITE=y CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0,nor0=47034000.hyperbus" CONFIG_MTDPARTS_DEFAULT="mtdparts=47040000.spi.0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),57088k@8m(ospi.rootfs),256k(ospi.phypattern);47034000.hyperbus:512k(hbmc.tiboot3),2m(hbmc.tispl),4m(hbmc.u-boot),256k(hbmc.env),-@8m(hbmc.rootfs)" @@ -89,7 +92,6 @@ CONFIG_CMD_UBI=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_SPL_MULTI_DTB_FIT=y -CONFIG_OF_LIST="k3-j784s4-evm" CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y CONFIG_ENV_OVERWRITE=y CONFIG_ENV_IS_IN_MMC=y @@ -171,14 +173,16 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_TPS65941=y CONFIG_DM_REGULATOR=y CONFIG_DM_REGULATOR_FIXED=y CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_REGULATOR_TPS65941=y CONFIG_RAM=y CONFIG_SPL_RAM=y CONFIG_REMOTEPROC_TI_K3_DSP=y CONFIG_REMOTEPROC_TI_K3_R5F=y -CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_SCSI=y CONFIG_DM_SCSI=y @@ -210,4 +214,3 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6168 CONFIG_UFS=y CONFIG_CADENCE_UFS=y CONFIG_TI_J721E_UFS=y -CONFIG_OF_LIBFDT_OVERLAY=y
participants (1)
-
Apelete Seketeli