* [PATCH v2 0/7] Add AVS support for J721S2
@ 2024-05-28 8:12 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency Manorit Chawdhry
` (6 more replies)
0 siblings, 7 replies; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:12 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
This series adds support for AVS on J721S2.
AVS Test for J721S2: https://gist.github.com/manorit2001/d7690ded6ef685aa8ffa5b16746cc529
Boot Test results: https://gist.github.com/manorit2001/6775d721b3df5a690497d94d012b93c4
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
Changes in v2:
- Move AVS Initialization point to after do_dt_magic
( Otherwise AM68 unknowingly ends up probing AVS and fails )
- Rebase on top of OF_UPSTREAM Support
- Link to v1: https://lore.kernel.org/r/20240206-b4-upstream-j721s2-avs-v1-0-b75043c59969@ti.com
---
Manorit Chawdhry (7):
power: pmic: tps65941: Add DM_PMIC dependency
drivers: misc: k3_avs: Use soc_match_device instead of compatible.
drivers: misc: k3_avs: Check return code while programming AVS
drivers: misc: k3_avs: Add AVS Support for J721S2.
arm: mach-k3: j721s2_init: Initialize AVS Class 0
arm: dts: j721s2: Add VTM node in R5
configs: j721s2_evm_r5_defconfig: Add AVS Configs
arch/arm/dts/k3-j721s2-r5-common-proc-board.dts | 9 +
arch/arm/mach-k3/j721s2/j721s2_init.c | 10 ++
configs/am68_sk_r5_defconfig | 4 +
configs/j721s2_evm_r5_defconfig | 6 +
drivers/misc/k3_avs.c | 216 ++++++++++++++----------
drivers/power/pmic/Kconfig | 1 +
6 files changed, 159 insertions(+), 87 deletions(-)
---
base-commit: 377e91c162ab09ec20f96f966f380cb55c590edd
change-id: 20240130-b4-upstream-j721s2-avs-8c187d3fe26a
Best regards,
--
Manorit Chawdhry <m-chawdhry@ti.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-28 9:03 ` Neha Malcom Francis
2024-05-28 8:13 ` [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible Manorit Chawdhry
` (5 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
This Kconfig depends on DM_PMIC but hadn't be explicitly stated which
could cause config related issues.
Adds the dependency in Kconfig for tps65941.
Fixes: 6b86dd0c1ead ("power: pmic: tps65941: Add support for tps65941 family of PMICs")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
drivers/power/pmic/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index 562c1a3b122a..bbcbcee4c355 100644
--- a/drivers/power/pmic/Kconfig
+++ b/drivers/power/pmic/Kconfig
@@ -394,6 +394,7 @@ config SPL_PMIC_LP87565
config PMIC_TPS65941
bool "Enable driver for Texas Instruments TPS65941 PMIC"
+ depends on DM_PMIC
help
The TPS65941 is a PMIC containing a bunch of SMPS & LDOs.
This driver binds the pmic children.
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible.
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-29 4:21 ` Kumar, Udit
2024-06-13 14:20 ` Tom Rini
2024-05-28 8:13 ` [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS Manorit Chawdhry
` (4 subsequent siblings)
6 siblings, 2 replies; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
vd_data remains the same for most of the SoCs but there are some
differences in power domains and clocks that don't need a change to
compatible and can be handled at SoC level.
Change the data population logic from compatible to soc_match_device to
add support for newer devices.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
drivers/misc/k3_avs.c | 189 +++++++++++++++++++++++++++-----------------------
1 file changed, 103 insertions(+), 86 deletions(-)
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
index 87471cc3b16a..a0d7bb7595b3 100644
--- a/drivers/misc/k3_avs.c
+++ b/drivers/misc/k3_avs.c
@@ -12,6 +12,7 @@
#include <asm/io.h>
#include <i2c.h>
#include <k3-avs.h>
+#include <soc.h>
#include <dm/device_compat.h>
#include <linux/bitops.h>
#include <linux/delay.h>
@@ -111,6 +112,95 @@ static u32 am6_efuse_xlate(struct k3_avs_privdata *priv, int idx, int opp)
return 300000 + 20000 * val;
}
+static struct vd_data am654_vd_data[] = {
+ {
+ .id = AM6_VDD_CORE,
+ .dev_id = 82, /* AM6_DEV_CBASS0 */
+ .clk_id = 0, /* main sysclk0 */
+ .opp = AM6_OPP_NOM,
+ .opps = {
+ [AM6_OPP_NOM] = {
+ .volt = 1000000,
+ .freq = 250000000, /* CBASS0 */
+ },
+ },
+ },
+ {
+ .id = AM6_VDD_MPU0,
+ .dev_id = 202, /* AM6_DEV_COMPUTE_CLUSTER_A53_0 */
+ .clk_id = 0, /* ARM clock */
+ .opp = AM6_OPP_NOM,
+ .opps = {
+ [AM6_OPP_NOM] = {
+ .volt = 1100000,
+ .freq = 800000000,
+ },
+ [AM6_OPP_OD] = {
+ .volt = 1200000,
+ .freq = 1000000000,
+ },
+ [AM6_OPP_TURBO] = {
+ .volt = 1240000,
+ .freq = 1100000000,
+ },
+ },
+ },
+ {
+ .id = AM6_VDD_MPU1,
+ .opp = AM6_OPP_NOM,
+ .dev_id = 204, /* AM6_DEV_COMPUTE_CLUSTER_A53_2 */
+ .clk_id = 0, /* ARM clock */
+ .opps = {
+ [AM6_OPP_NOM] = {
+ .volt = 1100000,
+ .freq = 800000000,
+ },
+ [AM6_OPP_OD] = {
+ .volt = 1200000,
+ .freq = 1000000000,
+ },
+ [AM6_OPP_TURBO] = {
+ .volt = 1240000,
+ .freq = 1100000000,
+ },
+ },
+ },
+ { .id = -1 },
+};
+
+static struct vd_data j721e_vd_data[] = {
+ {
+ .id = J721E_VDD_MPU,
+ .opp = AM6_OPP_NOM,
+ .dev_id = 202, /* J721E_DEV_A72SS0_CORE0 */
+ .clk_id = 2, /* ARM clock */
+ .opps = {
+ [AM6_OPP_NOM] = {
+ .volt = 880000, /* TBD in DM */
+ .freq = 2000000000,
+ },
+ },
+ },
+ { .id = -1 },
+};
+
+static struct vd_config j721e_vd_config = {
+ .efuse_xlate = am6_efuse_xlate,
+ .vds = j721e_vd_data,
+};
+
+static struct vd_config am654_vd_config = {
+ .efuse_xlate = am6_efuse_xlate,
+ .vds = am654_vd_data,
+};
+
+const struct soc_attr vtm_soc_list[] = {
+ { .family = "AM65X", .data = (void *)&am654_vd_config },
+ { .family = "J721E", .data = (void *)&j721e_vd_config },
+ { .family = "J7200", .data = (void *)&j721e_vd_config },
+ {}
+};
+
static int k3_avs_program_voltage(struct k3_avs_privdata *priv,
struct vd_data *vd,
int opp_id)
@@ -234,8 +324,16 @@ static int k3_avs_configure(struct udevice *dev, struct k3_avs_privdata *priv)
int ret;
char pname[20];
struct vd_data *vd;
+ const struct soc_attr *soc;
+
+ soc = soc_device_match(vtm_soc_list);
+ if (soc && soc->data)
+ conf = (void *)soc->data;
- conf = (void *)dev_get_driver_data(dev);
+ if (!conf) {
+ printf("No SoC support for AVS\n");
+ return -ENOSYS;
+ }
priv->vd_config = conf;
@@ -400,93 +498,12 @@ static int k3_avs_probe(struct udevice *dev)
return 0;
}
-static struct vd_data am654_vd_data[] = {
- {
- .id = AM6_VDD_CORE,
- .dev_id = 82, /* AM6_DEV_CBASS0 */
- .clk_id = 0, /* main sysclk0 */
- .opp = AM6_OPP_NOM,
- .opps = {
- [AM6_OPP_NOM] = {
- .volt = 1000000,
- .freq = 250000000, /* CBASS0 */
- },
- },
- },
- {
- .id = AM6_VDD_MPU0,
- .dev_id = 202, /* AM6_DEV_COMPUTE_CLUSTER_A53_0 */
- .clk_id = 0, /* ARM clock */
- .opp = AM6_OPP_NOM,
- .opps = {
- [AM6_OPP_NOM] = {
- .volt = 1100000,
- .freq = 800000000,
- },
- [AM6_OPP_OD] = {
- .volt = 1200000,
- .freq = 1000000000,
- },
- [AM6_OPP_TURBO] = {
- .volt = 1240000,
- .freq = 1100000000,
- },
- },
- },
- {
- .id = AM6_VDD_MPU1,
- .opp = AM6_OPP_NOM,
- .dev_id = 204, /* AM6_DEV_COMPUTE_CLUSTER_A53_2 */
- .clk_id = 0, /* ARM clock */
- .opps = {
- [AM6_OPP_NOM] = {
- .volt = 1100000,
- .freq = 800000000,
- },
- [AM6_OPP_OD] = {
- .volt = 1200000,
- .freq = 1000000000,
- },
- [AM6_OPP_TURBO] = {
- .volt = 1240000,
- .freq = 1100000000,
- },
- },
- },
- { .id = -1 },
-};
-
-static struct vd_data j721e_vd_data[] = {
- {
- .id = J721E_VDD_MPU,
- .opp = AM6_OPP_NOM,
- .dev_id = 202, /* J721E_DEV_A72SS0_CORE0 */
- .clk_id = 2, /* ARM clock */
- .opps = {
- [AM6_OPP_NOM] = {
- .volt = 880000, /* TBD in DM */
- .freq = 2000000000,
- },
- },
- },
- { .id = -1 },
-};
-
-static struct vd_config j721e_vd_config = {
- .efuse_xlate = am6_efuse_xlate,
- .vds = j721e_vd_data,
-};
-
-static struct vd_config am654_vd_config = {
- .efuse_xlate = am6_efuse_xlate,
- .vds = am654_vd_data,
-};
static const struct udevice_id k3_avs_ids[] = {
- { .compatible = "ti,am654-avs", .data = (ulong)&am654_vd_config },
- { .compatible = "ti,j721e-avs", .data = (ulong)&j721e_vd_config },
- { .compatible = "ti,j721e-vtm", .data = (ulong)&j721e_vd_config },
- { .compatible = "ti,j7200-vtm", .data = (ulong)&j721e_vd_config },
+ { .compatible = "ti,am654-avs" },
+ { .compatible = "ti,j721e-avs" },
+ { .compatible = "ti,j721e-vtm" },
+ { .compatible = "ti,j7200-vtm" },
{}
};
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-29 4:23 ` Kumar, Udit
2024-05-28 8:13 ` [PATCH v2 4/7] drivers: misc: k3_avs: Add AVS Support for J721S2 Manorit Chawdhry
` (3 subsequent siblings)
6 siblings, 1 reply; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
Check if AVS could not be programmed and print a warning.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
drivers/misc/k3_avs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
index a0d7bb7595b3..d9037b4512c6 100644
--- a/drivers/misc/k3_avs.c
+++ b/drivers/misc/k3_avs.c
@@ -489,7 +489,10 @@ static int k3_avs_probe(struct udevice *dev)
if (vd->flags & VD_FLAG_INIT_DONE)
continue;
- k3_avs_program_voltage(priv, vd, vd->opp);
+ ret = k3_avs_program_voltage(priv, vd, vd->opp);
+ if (ret)
+ dev_warn(dev, "Could not program AVS voltage for VD%d\n",
+ vd->id);
}
if (!device_is_compatible(priv->dev, "ti,am654-avs"))
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 4/7] drivers: misc: k3_avs: Add AVS Support for J721S2.
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
` (2 preceding siblings ...)
2024-05-28 8:13 ` [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 5/7] arm: mach-k3: j721s2_init: Initialize AVS Class 0 Manorit Chawdhry
` (2 subsequent siblings)
6 siblings, 0 replies; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
Add AVS Support for J721S2.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
drivers/misc/k3_avs.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
index d9037b4512c6..3527e427ac97 100644
--- a/drivers/misc/k3_avs.c
+++ b/drivers/misc/k3_avs.c
@@ -184,6 +184,22 @@ static struct vd_data j721e_vd_data[] = {
{ .id = -1 },
};
+static struct vd_data j721s2_vd_data[] = {
+ {
+ .id = J721E_VDD_MPU,
+ .opp = AM6_OPP_NOM,
+ .dev_id = 202, /* J721S2_DEV_A72SS0_CORE0 */
+ .clk_id = 0, /* ARM clock */
+ .opps = {
+ [AM6_OPP_NOM] = {
+ .volt = 880000, /* TBD in DM */
+ .freq = 2000000000,
+ },
+ },
+ },
+ { .id = -1 },
+};
+
static struct vd_config j721e_vd_config = {
.efuse_xlate = am6_efuse_xlate,
.vds = j721e_vd_data,
@@ -194,10 +210,16 @@ static struct vd_config am654_vd_config = {
.vds = am654_vd_data,
};
+static struct vd_config j721s2_vd_config = {
+ .efuse_xlate = am6_efuse_xlate,
+ .vds = j721s2_vd_data,
+};
+
const struct soc_attr vtm_soc_list[] = {
{ .family = "AM65X", .data = (void *)&am654_vd_config },
{ .family = "J721E", .data = (void *)&j721e_vd_config },
{ .family = "J7200", .data = (void *)&j721e_vd_config },
+ { .family = "J721S2", .data = (void *)&j721s2_vd_config },
{}
};
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 5/7] arm: mach-k3: j721s2_init: Initialize AVS Class 0
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
` (3 preceding siblings ...)
2024-05-28 8:13 ` [PATCH v2 4/7] drivers: misc: k3_avs: Add AVS Support for J721S2 Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 6/7] arm: dts: j721s2: Add VTM node in R5 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs Manorit Chawdhry
6 siblings, 0 replies; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
Initialize AVS Class 0.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
arch/arm/mach-k3/j721s2/j721s2_init.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/mach-k3/j721s2/j721s2_init.c b/arch/arm/mach-k3/j721s2/j721s2_init.c
index fe9766e9b4b2..cc49662367f0 100644
--- a/arch/arm/mach-k3/j721s2/j721s2_init.c
+++ b/arch/arm/mach-k3/j721s2/j721s2_init.c
@@ -290,11 +290,21 @@ void do_dt_magic(void)
#ifdef CONFIG_SPL_BUILD
void board_init_f(ulong dummy)
{
+ struct udevice *dev;
+ int ret;
+
k3_spl_init();
#if defined(CONFIG_SPL_OF_LIST) && defined(CONFIG_TI_I2C_BOARD_DETECT)
do_dt_magic();
#endif
k3_mem_init();
+
+ if (IS_ENABLED(CONFIG_CPU_V7R) && IS_ENABLED(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
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 6/7] arm: dts: j721s2: Add VTM node in R5
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
` (4 preceding siblings ...)
2024-05-28 8:13 ` [PATCH v2 5/7] arm: mach-k3: j721s2_init: Initialize AVS Class 0 Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs Manorit Chawdhry
6 siblings, 0 replies; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
Add bootph-pre-ram property to VTM node and the pmic node.
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
arch/arm/dts/k3-j721s2-r5-common-proc-board.dts | 9 +++++++++
1 file changed, 9 insertions(+)
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 e92b1917df4e..506ad9b7910d 100644
--- a/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts
+++ b/arch/arm/dts/k3-j721s2-r5-common-proc-board.dts
@@ -10,3 +10,12 @@
#include "k3-j721s2-ddr.dtsi"
#include "k3-j721s2-common-proc-board-u-boot.dtsi"
#include "k3-j721s2-r5.dtsi"
+
+&tps659411 {
+ bootph-pre-ram;
+};
+
+&wkup_vtm0 {
+ bootph-pre-ram;
+ vdd-supply-2 = <&bucka1234>;
+};
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
` (5 preceding siblings ...)
2024-05-28 8:13 ` [PATCH v2 6/7] arm: dts: j721s2: Add VTM node in R5 Manorit Chawdhry
@ 2024-05-28 8:13 ` Manorit Chawdhry
2024-05-29 4:29 ` Kumar, Udit
6 siblings, 1 reply; 13+ messages in thread
From: Manorit Chawdhry @ 2024-05-28 8:13 UTC (permalink / raw)
To: Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar, Aniket Limaye,
Tom Rini, Vignesh Raghavendra, Andrew Davis, Nishanth Menon,
Manorit Chawdhry
Add AVS and PMIC regulator configs
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
---
configs/am68_sk_r5_defconfig | 4 ++++
configs/j721s2_evm_r5_defconfig | 6 ++++++
2 files changed, 10 insertions(+)
diff --git a/configs/am68_sk_r5_defconfig b/configs/am68_sk_r5_defconfig
index e9b6882c1f68..f4800ef1b8ac 100644
--- a/configs/am68_sk_r5_defconfig
+++ b/configs/am68_sk_r5_defconfig
@@ -5,6 +5,10 @@ CONFIG_ARCH_K3=y
CONFIG_SOC_K3_J721S2=y
CONFIG_TARGET_J721S2_R5_EVM=y
+CONFIG_K3_AVS0=n
+CONFIG_DM_REGULATOR_TPS65941=n
+CONFIG_PMIC_TPS65941=n
+
CONFIG_DEFAULT_DEVICE_TREE="k3-am68-sk-r5-base-board"
CONFIG_SPL_OF_LIST="k3-am68-sk-r5-base-board"
CONFIG_OF_LIST="k3-am68-sk-r5-base-board"
diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig
index 3c958cafbe8f..f8a42a9a2ef6 100644
--- a/configs/j721s2_evm_r5_defconfig
+++ b/configs/j721s2_evm_r5_defconfig
@@ -111,6 +111,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
@@ -140,6 +141,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
--
2.43.2
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency
2024-05-28 8:13 ` [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency Manorit Chawdhry
@ 2024-05-28 9:03 ` Neha Malcom Francis
0 siblings, 0 replies; 13+ messages in thread
From: Neha Malcom Francis @ 2024-05-28 9:03 UTC (permalink / raw)
To: Manorit Chawdhry, Jaehoon Chung
Cc: u-boot, Keerthy J, Udit Kumar, Aniket Limaye, Tom Rini,
Vignesh Raghavendra, Andrew Davis, Nishanth Menon
Hi Manorit
On 28/05/24 13:43, Manorit Chawdhry wrote:
> This Kconfig depends on DM_PMIC but hadn't be explicitly stated which
> could cause config related issues.
>
> Adds the dependency in Kconfig for tps65941.
>
> Fixes: 6b86dd0c1ead ("power: pmic: tps65941: Add support for tps65941 family of PMICs")
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
> drivers/power/pmic/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
> index 562c1a3b122a..bbcbcee4c355 100644
> --- a/drivers/power/pmic/Kconfig
> +++ b/drivers/power/pmic/Kconfig
> @@ -394,6 +394,7 @@ config SPL_PMIC_LP87565
>
> config PMIC_TPS65941
> bool "Enable driver for Texas Instruments TPS65941 PMIC"
> + depends on DM_PMIC
> help
> The TPS65941 is a PMIC containing a bunch of SMPS & LDOs.
> This driver binds the pmic children.
>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
--
Thanking You
Neha Malcom Francis
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible.
2024-05-28 8:13 ` [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible Manorit Chawdhry
@ 2024-05-29 4:21 ` Kumar, Udit
2024-06-13 14:20 ` Tom Rini
1 sibling, 0 replies; 13+ messages in thread
From: Kumar, Udit @ 2024-05-29 4:21 UTC (permalink / raw)
To: Manorit Chawdhry, Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Aniket Limaye, Tom Rini,
Vignesh Raghavendra, Andrew Davis, Nishanth Menon
Hi Manorit
On 5/28/2024 1:43 PM, Manorit Chawdhry wrote:
> vd_data remains the same for most of the SoCs but there are some
> differences in power domains and clocks that don't need a change to
> compatible and can be handled at SoC level.
>
> Change the data population logic from compatible to soc_match_device to
> add support for newer devices.
>
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
> drivers/misc/k3_avs.c | 189 +++++++++++++++++++++++++++-----------------------
> 1 file changed, 103 insertions(+), 86 deletions(-)
>
> diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
> index 87471cc3b16a..a0d7bb7595b3 100644
> --- a/drivers/misc/k3_avs.c
> +++ b/drivers/misc/k3_avs.c
> @@ -12,6 +12,7 @@
> #include <asm/io.h>
> #include <i2c.h>
> #include <k3-avs.h>
> +#include <soc.h>
> #include <dm/device_compat.h>
> #include <linux/bitops.h>
> #include <linux/delay.h>
> @@ -111,6 +112,95 @@ static u32 am6_efuse_xlate(struct k3_avs_privdata *priv, int idx, int opp)
> return 300000 + 20000 * val;
> }
>
> [..]
> +const struct soc_attr vtm_soc_list[] = {
> + { .family = "AM65X", .data = (void *)&am654_vd_config },
> + { .family = "J721E", .data = (void *)&j721e_vd_config },
> + { .family = "J7200", .data = (void *)&j721e_vd_config },
> + {}
> +};
We may end up updating this driver for each SOC family,
Even if VTM IP remain same in two SOC family.
In my view, driver should be specific to IP not specific to SOC or SOC
family.
> [..]
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS
2024-05-28 8:13 ` [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS Manorit Chawdhry
@ 2024-05-29 4:23 ` Kumar, Udit
0 siblings, 0 replies; 13+ messages in thread
From: Kumar, Udit @ 2024-05-29 4:23 UTC (permalink / raw)
To: Manorit Chawdhry, Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Aniket Limaye, Tom Rini,
Vignesh Raghavendra, Andrew Davis, Nishanth Menon
On 5/28/2024 1:43 PM, Manorit Chawdhry wrote:
> Check if AVS could not be programmed and print a warning.
>
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
> drivers/misc/k3_avs.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
> index a0d7bb7595b3..d9037b4512c6 100644
> --- a/drivers/misc/k3_avs.c
> +++ b/drivers/misc/k3_avs.c
> @@ -489,7 +489,10 @@ static int k3_avs_probe(struct udevice *dev)
> if (vd->flags & VD_FLAG_INIT_DONE)
> continue;
>
> - k3_avs_program_voltage(priv, vd, vd->opp);
> + ret = k3_avs_program_voltage(priv, vd, vd->opp);
> + if (ret)
> + dev_warn(dev, "Could not program AVS voltage for VD%d\n",
> + vd->id);
Could you extend print with vd->opp as well.
With this change
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
> }
>
> if (!device_is_compatible(priv->dev, "ti,am654-avs"))
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs
2024-05-28 8:13 ` [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs Manorit Chawdhry
@ 2024-05-29 4:29 ` Kumar, Udit
0 siblings, 0 replies; 13+ messages in thread
From: Kumar, Udit @ 2024-05-29 4:29 UTC (permalink / raw)
To: Manorit Chawdhry, Jaehoon Chung
Cc: u-boot, Neha Malcom Francis, Keerthy J, Aniket Limaye, Tom Rini,
Vignesh Raghavendra, Andrew Davis, Nishanth Menon
On 5/28/2024 1:43 PM, Manorit Chawdhry wrote:
> Add AVS and PMIC regulator configs
>
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
> ---
> configs/am68_sk_r5_defconfig | 4 ++++
> configs/j721s2_evm_r5_defconfig | 6 ++++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/configs/am68_sk_r5_defconfig b/configs/am68_sk_r5_defconfig
> index e9b6882c1f68..f4800ef1b8ac 100644
> --- a/configs/am68_sk_r5_defconfig
> +++ b/configs/am68_sk_r5_defconfig
> @@ -5,6 +5,10 @@ CONFIG_ARCH_K3=y
> CONFIG_SOC_K3_J721S2=y
> CONFIG_TARGET_J721S2_R5_EVM=y
>
> +CONFIG_K3_AVS0=n
> +CONFIG_DM_REGULATOR_TPS65941=n
> +CONFIG_PMIC_TPS65941=n
> +
Extra line
> CONFIG_DEFAULT_DEVICE_TREE="k3-am68-sk-r5-base-board"
> CONFIG_SPL_OF_LIST="k3-am68-sk-r5-base-board"
> CONFIG_OF_LIST="k3-am68-sk-r5-base-board"
> diff --git a/configs/j721s2_evm_r5_defconfig b/configs/j721s2_evm_r5_defconfig
> index 3c958cafbe8f..f8a42a9a2ef6 100644
> --- a/configs/j721s2_evm_r5_defconfig
> +++ b/configs/j721s2_evm_r5_defconfig
> @@ -111,6 +111,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
> @@ -140,6 +141,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
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible.
2024-05-28 8:13 ` [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible Manorit Chawdhry
2024-05-29 4:21 ` Kumar, Udit
@ 2024-06-13 14:20 ` Tom Rini
1 sibling, 0 replies; 13+ messages in thread
From: Tom Rini @ 2024-06-13 14:20 UTC (permalink / raw)
To: Manorit Chawdhry
Cc: Jaehoon Chung, u-boot, Neha Malcom Francis, Keerthy J, Udit Kumar,
Aniket Limaye, Vignesh Raghavendra, Andrew Davis, Nishanth Menon
[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]
On Tue, May 28, 2024 at 01:43:01PM +0530, Manorit Chawdhry wrote:
> vd_data remains the same for most of the SoCs but there are some
> differences in power domains and clocks that don't need a change to
> compatible and can be handled at SoC level.
>
> Change the data population logic from compatible to soc_match_device to
> add support for newer devices.
>
> Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
On am65x_evm_r5_usbdfu am65x_evm_r5_usbmsc:
arm: + am65x_evm_r5_usbmsc
+(am65x_evm_r5_usbmsc) In function 'k3_avs_configure',
+(am65x_evm_r5_usbmsc) inlined from 'k3_avs_probe' at drivers/misc/k3_avs.c:459:8:
+(am65x_evm_r5_usbmsc) drivers/misc/k3_avs.c:333:12: error: 'conf' is used uninitialized [-Werror=uninitialized]
+(am65x_evm_r5_usbmsc) 333 | if (!conf) {
+(am65x_evm_r5_usbmsc) | ^
+(am65x_evm_r5_usbmsc) drivers/misc/k3_avs.c: In function 'k3_avs_probe':
+(am65x_evm_r5_usbmsc) drivers/misc/k3_avs.c:323:27: note: 'conf' was declared here
+(am65x_evm_r5_usbmsc) 323 | struct vd_config *conf;
+(am65x_evm_r5_usbmsc) | ^~~~
+(am65x_evm_r5_usbmsc) cc1: all warnings being treated as errors
+(am65x_evm_r5_usbmsc) make[3]: *** [scripts/Makefile.build:256: drivers/misc/k3_avs.o] Error 1
+(am65x_evm_r5_usbmsc) make[2]: *** [scripts/Makefile.build:397: drivers/misc] Error 2
+(am65x_evm_r5_usbmsc) make[1]: *** [Makefile:1892: drivers] Error 2
+(am65x_evm_r5_usbmsc) make: *** [Makefile:177: sub-make] Error 2
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2024-06-13 14:20 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 8:12 [PATCH v2 0/7] Add AVS support for J721S2 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 1/7] power: pmic: tps65941: Add DM_PMIC dependency Manorit Chawdhry
2024-05-28 9:03 ` Neha Malcom Francis
2024-05-28 8:13 ` [PATCH v2 2/7] drivers: misc: k3_avs: Use soc_match_device instead of compatible Manorit Chawdhry
2024-05-29 4:21 ` Kumar, Udit
2024-06-13 14:20 ` Tom Rini
2024-05-28 8:13 ` [PATCH v2 3/7] drivers: misc: k3_avs: Check return code while programming AVS Manorit Chawdhry
2024-05-29 4:23 ` Kumar, Udit
2024-05-28 8:13 ` [PATCH v2 4/7] drivers: misc: k3_avs: Add AVS Support for J721S2 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 5/7] arm: mach-k3: j721s2_init: Initialize AVS Class 0 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 6/7] arm: dts: j721s2: Add VTM node in R5 Manorit Chawdhry
2024-05-28 8:13 ` [PATCH v2 7/7] configs: j721s2_evm_r5_defconfig: Add AVS Configs Manorit Chawdhry
2024-05-29 4:29 ` Kumar, Udit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox