public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV
@ 2017-10-11 16:42 Felix Brack
  2017-10-14  3:07 ` Lokesh Vutla
  2017-11-17 15:42 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 3+ messages in thread
From: Felix Brack @ 2017-10-11 16:42 UTC (permalink / raw)
  To: u-boot

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>
---

 arch/arm/include/asm/arch-am33xx/sys_proto.h |  1 +
 arch/arm/mach-omap2/am33xx/sys_info.c        | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
index 4e78aaf..57fbfa4 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 ea434aa..0181a8c 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. */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV
  2017-10-11 16:42 [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV Felix Brack
@ 2017-10-14  3:07 ` Lokesh Vutla
  2017-11-17 15:42 ` [U-Boot] " Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Lokesh Vutla @ 2017-10-14  3:07 UTC (permalink / raw)
  To: u-boot



On Wednesday 11 October 2017 10:12 PM, Felix Brack wrote:
> 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>

Thanks and regards,
Lokesh


> ---
> 
>  arch/arm/include/asm/arch-am33xx/sys_proto.h |  1 +
>  arch/arm/mach-omap2/am33xx/sys_info.c        | 16 ++++++++++++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> index 4e78aaf..57fbfa4 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 ea434aa..0181a8c 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. */
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] am33xx: Add a function to query MPU voltage in uV
  2017-10-11 16:42 [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV Felix Brack
  2017-10-14  3:07 ` Lokesh Vutla
@ 2017-11-17 15:42 ` Tom Rini
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2017-11-17 15:42 UTC (permalink / raw)
  To: u-boot

On Wed, Oct 11, 2017 at 06:42:23PM +0200, Felix Brack wrote:

> 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>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171117/858cd968/attachment.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-17 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-11 16:42 [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV Felix Brack
2017-10-14  3:07 ` Lokesh Vutla
2017-11-17 15:42 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox