summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorFelix Brack <fb@ltec.ch>2017-10-11 19:42:23 +0300
committerTom Rini <trini@konsulko.com>2017-11-17 15:43:32 +0300
commitc07bf9bea7781f282944508573e38b18ec50062d (patch)
tree032bc610a8a00e6c7695e840d8d07bd4cd0263f7 /arch
parentebca2083d3689c77c7d1365f1e6862b55abef8a2 (diff)
downloadu-boot-c07bf9bea7781f282944508573e38b18ec50062d.tar.xz
am33xx: Add a function to query MPU voltage in uV
For the DM TPS65910 driver I'm working on, querying the MPU voltage should return a value in uV. This value can then be used by the regulator's standard function set_value to set the MPU voltage. Signed-off-by: Felix Brack <fb@ltec.ch> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch-am33xx/sys_proto.h1
-rw-r--r--arch/arm/mach-omap2/am33xx/sys_info.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 4e78aafb0b..57fbfa4625 100644
--- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
+++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
@@ -40,6 +40,7 @@ void enable_norboot_pin_mux(void);
#endif
void am33xx_spl_board_init(void);
int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev);
+int am335x_get_mpu_vdd(int sil_rev, int frequency);
int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency);
#endif
diff --git a/arch/arm/mach-omap2/am33xx/sys_info.c b/arch/arm/mach-omap2/am33xx/sys_info.c
index ea434aaf33..0181a8cb0c 100644
--- a/arch/arm/mach-omap2/am33xx/sys_info.c
+++ b/arch/arm/mach-omap2/am33xx/sys_info.c
@@ -175,6 +175,22 @@ int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev)
return MPUPLL_M_720;
}
+int am335x_get_mpu_vdd(int sil_rev, int frequency)
+{
+ int sel_mask = am335x_get_tps65910_mpu_vdd(sil_rev, frequency);
+
+ switch (sel_mask) {
+ case TPS65910_OP_REG_SEL_1_3_2_5:
+ return 1325000;
+ case TPS65910_OP_REG_SEL_1_2_0:
+ return 1200000;
+ case TPS65910_OP_REG_SEL_1_1_0:
+ return 1100000;
+ default:
+ return 1262500;
+ }
+}
+
int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency)
{
/* For PG2.0 and later, we have one set of values. */