]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
am33xx: Add a function to query MPU voltage in uV
authorFelix Brack <fb@ltec.ch>
Wed, 11 Oct 2017 16:42:23 +0000 (18:42 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 17 Nov 2017 12:43:32 +0000 (07:43 -0500)
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>
arch/arm/include/asm/arch-am33xx/sys_proto.h
arch/arm/mach-omap2/am33xx/sys_info.c

index 4e78aafb0b96a3b239fda435d7b7f136afcd4bc9..57fbfa4625aa4954c8f69c6b69696c8e3abf4a1f 100644 (file)
@@ -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
 
index ea434aaf33f1c452907839a2c5f599ec61f49f4b..0181a8cb0cc5c7cf75be63fb59eab55799d5561e 100644 (file)
@@ -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. */