summaryrefslogtreecommitdiff
path: root/drivers/ram
diff options
context:
space:
mode:
authorLokesh Vutla <lokeshvutla@ti.com>2021-05-11 10:22:13 -0500
committerLokesh Vutla <lokeshvutla@ti.com>2021-05-12 16:30:52 +0530
commit2ce6dedf0b3cb8a4ff97f47061ca10526ea95370 (patch)
tree235ca2e332ca42bea54c9f9811a7644d9c7ec21d /drivers/ram
parent9f9b5c1c16ddbb0a3a42e0424887d9cad34d89f4 (diff)
downloadu-boot-2ce6dedf0b3cb8a4ff97f47061ca10526ea95370.tar.gz
ram: k3-ddrss: Enable vtt regulator if present
Attempt to get and enable a vtt regulator if one is provided from the dts. If we do not find one, continue as not all platforms have this. Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Diffstat (limited to 'drivers/ram')
-rw-r--r--drivers/ram/k3-ddrss/k3-ddrss.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ram/k3-ddrss/k3-ddrss.c b/drivers/ram/k3-ddrss/k3-ddrss.c
index 8d9e7d2adb..cb8edcbc15 100644
--- a/drivers/ram/k3-ddrss/k3-ddrss.c
+++ b/drivers/ram/k3-ddrss/k3-ddrss.c
@@ -15,6 +15,7 @@
#include <asm/io.h>
#include <power-domain.h>
#include <wait_bit.h>
+#include <power/regulator.h>
#include "lpddr4_obj_if.h"
#include "lpddr4_if.h"
@@ -40,6 +41,7 @@ struct k3_ddrss_desc {
u32 ddr_freq1;
u32 ddr_freq2;
u32 ddr_fhs_cnt;
+ struct udevice *vtt_supply;
};
static lpddr4_obj *driverdt;
@@ -215,6 +217,18 @@ static int k3_ddrss_power_on(struct k3_ddrss_desc *ddrss)
return ret;
}
+ ret = device_get_supply_regulator(ddrss->dev, "vtt-supply",
+ &ddrss->vtt_supply);
+ if (ret) {
+ dev_dbg(ddrss->dev, "vtt-supply not found.\n");
+ } else {
+ ret = regulator_set_value(ddrss->vtt_supply, 3300000);
+ if (ret)
+ return ret;
+ dev_dbg(ddrss->dev, "VTT regulator enabled, volt = %d\n",
+ regulator_get_value(ddrss->vtt_supply));
+ }
+
return 0;
}