diff mbox

[U-Boot,09/10] arm: am437x: cm-t43: set MPU and CORE voltages on boot

Message ID 1455902390-5387-10-git-send-email-nikita@compulab.co.il
State Accepted
Commit 43e568c4ae9a35e2458737c7d995b183e21b8a6f
Delegated to: Tom Rini
Headers show

Commit Message

Nikita Kiryanov Feb. 19, 2016, 5:19 p.m. UTC
During boot, U-Boot raises the CPU frequency but the CORE and MPU regulators
are not updated. This is not a problem in cold boot since the default values
that the pmic outputs are correct, but if Linux were to switch the module to a
low power OPP, the new voltage values will be retained after a reboot and the
module will likely hang once U-Boot raises the CPU frequency back up.

Set both CORE and MPU regulators to to 1.1V on boot.

Cc: Tom Rini <trini@konsulko.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
---
 board/compulab/cm_t43/spl.c | 15 +++++++++++++++
 include/configs/cm_t43.h    |  2 ++
 2 files changed, 17 insertions(+)

Comments

Tom Rini Feb. 20, 2016, 12:56 a.m. UTC | #1
On Fri, Feb 19, 2016 at 07:19:49PM +0200, Nikita Kiryanov wrote:

> During boot, U-Boot raises the CPU frequency but the CORE and MPU regulators
> are not updated. This is not a problem in cold boot since the default values
> that the pmic outputs are correct, but if Linux were to switch the module to a
> low power OPP, the new voltage values will be retained after a reboot and the
> module will likely hang once U-Boot raises the CPU frequency back up.
> 
> Set both CORE and MPU regulators to to 1.1V on boot.
> 
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>

Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini Feb. 25, 2016, 3:25 p.m. UTC | #2
On Fri, Feb 19, 2016 at 07:19:49PM +0200, Nikita Kiryanov wrote:

> During boot, U-Boot raises the CPU frequency but the CORE and MPU regulators
> are not updated. This is not a problem in cold boot since the default values
> that the pmic outputs are correct, but if Linux were to switch the module to a
> low power OPP, the new voltage values will be retained after a reboot and the
> module will likely hang once U-Boot raises the CPU frequency back up.
> 
> Set both CORE and MPU regulators to to 1.1V on boot.
> 
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
> Reviewed-by: Tom Rini <trini@konsulko.com>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/compulab/cm_t43/spl.c b/board/compulab/cm_t43/spl.c
index 520de24..b7d118e 100644
--- a/board/compulab/cm_t43/spl.c
+++ b/board/compulab/cm_t43/spl.c
@@ -6,9 +6,13 @@ 
 
 #include <common.h>
 #include <spl.h>
+#include <i2c.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/ddr_defs.h>
 #include <asm/gpio.h>
+#include <power/pmic.h>
+#include <power/tps65218.h>
+#include "board.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -100,6 +104,17 @@  const struct dpll_params *get_dpll_per_params(void)
 	return &dpll_per;
 }
 
+void scale_vcores(void)
+{
+	set_i2c_pin_mux();
+	i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
+	if (i2c_probe(TPS65218_CHIP_PM))
+		return;
+
+	tps65218_voltage_update(TPS65218_DCDC1, TPS65218_DCDC_VOLT_SEL_1100MV);
+	tps65218_voltage_update(TPS65218_DCDC2, TPS65218_DCDC_VOLT_SEL_1100MV);
+}
+
 void sdram_init(void)
 {
 	unsigned long ram_size;
diff --git a/include/configs/cm_t43.h b/include/configs/cm_t43.h
index 3bc3336..329a5ea 100644
--- a/include/configs/cm_t43.h
+++ b/include/configs/cm_t43.h
@@ -167,5 +167,7 @@ 
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_I2C_SUPPORT
+#define CONFIG_SPL_POWER_SUPPORT
 
 #endif	/* __CONFIG_CM_T43_H */