summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-10-21 17:52:40 -0600
committerTom Rini <[email protected]>2024-10-21 17:52:40 -0600
commit63a3dbb7b9e1c352c85b4fa6508f1c895e163458 (patch)
treef3dc4bb569b5eb6ea3ee5c119556867c8a9cbcf0 /drivers
parent33da135f7e186642921995a478bd2b2b02939a67 (diff)
parent1b379f4a410c30a842184703e80079731d5cf139 (diff)
Merge patch series "Add AVS support for J721S2"
Manorit Chawdhry <[email protected]> says: This series adds support for Adaptive voltage scaling on J721S2 device [0]. [0]: https://www.ti.com/lit/pdf/spruj28 (Section 5.2.4.1 AVS Support) AVS Test for J721S2: https://gist.github.com/manorit2001/b2fd9f6764a863294d4aa0755c83c84f Boot Test results: https://gist.github.com/manorit2001/d44e035552cb19aadeb0d928d5cb5f26 Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/k3_avs.c40
-rw-r--r--drivers/power/pmic/Kconfig1
2 files changed, 40 insertions, 1 deletions
diff --git a/drivers/misc/k3_avs.c b/drivers/misc/k3_avs.c
index 87471cc3b16..99a18a109b7 100644
--- a/drivers/misc/k3_avs.c
+++ b/drivers/misc/k3_avs.c
@@ -352,6 +352,9 @@ static int k3_avs_probe(struct udevice *dev)
struct k3_avs_privdata *priv;
struct vd_data *vd;
int ret;
+ ofnode node;
+ struct ofnode_phandle_args phandle_args;
+ int i = 0;
priv = dev_get_priv(dev);
priv->dev = dev;
@@ -367,6 +370,32 @@ static int k3_avs_probe(struct udevice *dev)
return -ENODEV;
for (vd = priv->vd_config->vds; vd->id >= 0; vd++) {
+ /* Get the clock and dev id for Jacinto platforms */
+ if (vd->id == J721E_VDD_MPU) {
+ node = ofnode_by_compatible(ofnode_null(), "ti,am654-rproc");
+ if (!ofnode_valid(node))
+ return -ENODEV;
+
+ i = ofnode_stringlist_search(node, "clock-names", "core");
+ if (i < 0)
+ return -ENODEV;
+
+ ret = ofnode_parse_phandle_with_args(node, "clocks",
+ "#clock-cells",
+ 0, i,
+ &phandle_args);
+ if (ret) {
+ printf("Couldn't get the clock node, ret = %d\n", ret);
+ return ret;
+ }
+
+ vd->dev_id = phandle_args.args[0];
+ vd->clk_id = phandle_args.args[1];
+
+ debug("%s: MPU dev_id: %d, clk_id: %d", __func__,
+ vd->dev_id, vd->clk_id);
+ }
+
if (!(readl(AM6_VTM_DEVINFO(vd->id)) &
AM6_VTM_AVS0_SUPPORTED)) {
dev_warn(dev, "AVS-class 0 not supported for VD%d\n",
@@ -391,7 +420,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, vd->opp=%d, ret=%d\n",
+ vd->id, vd->opp, ret);
}
if (!device_is_compatible(priv->dev, "ti,am654-avs"))
@@ -460,6 +492,12 @@ static struct vd_data j721e_vd_data[] = {
{
.id = J721E_VDD_MPU,
.opp = AM6_OPP_NOM,
+ /*
+ * XXX: DEPRECATION WARNING: Around 2 u-boot versions
+ *
+ * These values will be picked up from DT, kept for backward
+ * compatibility
+ */
.dev_id = 202, /* J721E_DEV_A72SS0_CORE0 */
.clk_id = 2, /* ARM clock */
.opps = {
diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
index 562c1a3b122..bbcbcee4c35 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.