]> git.sur5r.net Git - u-boot/commitdiff
ARM: DRA7xx: power Add support for tps659038 PMIC
authorLokesh Vutla <lokeshvutla@ti.com>
Thu, 30 May 2013 03:19:29 +0000 (03:19 +0000)
committerTom Rini <trini@ti.com>
Mon, 10 Jun 2013 12:43:09 +0000 (08:43 -0400)
TPS659038 is the power IC used in DRA7XX boards.
Adding support for this and also adding pmic data
for DRA7XX boards.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
arch/arm/cpu/armv7/omap-common/clocks-common.c
arch/arm/cpu/armv7/omap5/hw_data.c
arch/arm/include/asm/arch-omap4/sys_proto.h
arch/arm/include/asm/arch-omap5/clock.h
arch/arm/include/asm/arch-omap5/sys_proto.h
arch/arm/include/asm/omap_common.h

index 6c8e0632c1f36e0cf1bbcf73d00bde17ec3f15bb..eda3451e73460a6b4a3e3ea502f55230234dc6f1 100644 (file)
@@ -30,6 +30,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <i2c.h>
 #include <asm/omap_common.h>
 #include <asm/gpio.h>
 #include <asm/arch/clock.h>
@@ -487,6 +488,9 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
        u32 offset = volt_mv;
        int ret = 0;
 
+       if (!volt_mv)
+               return;
+
        pmic->pmic_bus_init();
        /* See if we can first get the GPIO if needed */
        if (pmic->gpio_en)
@@ -543,6 +547,15 @@ void scale_vcores(struct vcores_data const *vcores)
        do_scale_vcore(vcores->mm.addr, vcores->mm.value,
                                          vcores->mm.pmic);
 
+       do_scale_vcore(vcores->gpu.addr, vcores->gpu.value,
+                      vcores->gpu.pmic);
+
+       do_scale_vcore(vcores->eve.addr, vcores->eve.value,
+                      vcores->eve.pmic);
+
+       do_scale_vcore(vcores->iva.addr, vcores->iva.value,
+                      vcores->iva.pmic);
+
         if (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3) {
                /* Configure LDO SRAM "magic" bits */
                writel(2, (*prcm)->prm_sldo_core_setup);
@@ -732,3 +745,13 @@ void prcm_init(void)
        if (OMAP_INIT_CONTEXT_SPL != omap_hw_init_context())
                enable_basic_uboot_clocks();
 }
+
+void gpi2c_init(void)
+{
+       static int gpi2c = 1;
+
+       if (gpi2c) {
+               i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+               gpi2c = 0;
+       }
+}
index 585e318671f7af973798a7d4a6ba22efaad3689b..90274a02cfdeeac70af20108ec29bb329216c446 100644 (file)
@@ -26,6 +26,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <palmas.h>
 #include <asm/arch/omap.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/omap_common.h>
@@ -294,6 +295,19 @@ struct pmic_data palmas = {
        .pmic_write     = omap_vc_bypass_send_value,
 };
 
+struct pmic_data tps659038 = {
+       .base_offset = PALMAS_SMPS_BASE_VOLT_UV,
+       .step = 10000, /* 10 mV represented in uV */
+       /*
+        * Offset codes 1-6 all give the base voltage in Palmas
+        * Offset code 0 switches OFF the SMPS
+        */
+       .start_code = 6,
+       .i2c_slave_addr = TPS659038_I2C_SLAVE_ADDR,
+       .pmic_bus_init  = gpi2c_init,
+       .pmic_write     = palmas_i2c_write_u8,
+};
+
 struct vcores_data omap5430_volts = {
        .mpu.value = VDD_MPU,
        .mpu.addr = SMPS_REG_ADDR_12_MPU,
@@ -322,6 +336,28 @@ struct vcores_data omap5430_volts_es2 = {
        .mm.pmic = &palmas,
 };
 
+struct vcores_data dra752_volts = {
+       .mpu.value      = VDD_MPU_DRA752,
+       .mpu.addr       = TPS659038_REG_ADDR_SMPS12_MPU,
+       .mpu.pmic       = &tps659038,
+
+       .eve.value      = VDD_EVE_DRA752,
+       .eve.addr       = TPS659038_REG_ADDR_SMPS45_EVE,
+       .eve.pmic       = &tps659038,
+
+       .gpu.value      = VDD_GPU_DRA752,
+       .gpu.addr       = TPS659038_REG_ADDR_SMPS6_GPU,
+       .gpu.pmic       = &tps659038,
+
+       .core.value     = VDD_CORE_DRA752,
+       .core.addr      = TPS659038_REG_ADDR_SMPS7_CORE,
+       .core.pmic      = &tps659038,
+
+       .iva.value      = VDD_IVA_DRA752,
+       .iva.addr       = TPS659038_REG_ADDR_SMPS8_IVA,
+       .iva.pmic       = &tps659038,
+};
+
 /*
  * Enable essential clock domains, modules and
  * do some additional special settings needed
@@ -562,7 +598,7 @@ void hw_data_init(void)
        case DRA752_ES1_0:
        *prcm = &dra7xx_prcm;
        *dplls_data = &dra7xx_dplls;
-       *omap_vcores = &omap5430_volts_es2;
+       *omap_vcores = &dra752_volts;
        *ctrl = &dra7xx_ctrl;
        break;
 
index 15e368224fc77edd902cdd26af44b75d0bc2fa5c..e4134661484fbc4a9687cfffd95a104d21d3eecb 100644 (file)
@@ -58,6 +58,7 @@ void save_omap_boot_params(void);
 void init_omap_revision(void);
 void do_io_settings(void);
 void sri2c_init(void);
+void gpi2c_init(void);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
 u32 warm_reset(void);
 void force_emif_self_refresh(void);
index 6673a025f5d58441fd4e960a8be0d61167eddbe8..f7ddd5ffe51db6e4d538aabbef28641c967583b9 100644 (file)
 #define VDD_MPU_ES2_LOW 880
 #define VDD_MM_ES2_LOW 880
 
+/* TPS659038 Voltage settings in mv for OPP_NOMINAL */
+#define VDD_MPU_DRA752         1090
+#define VDD_EVE_DRA752         1060
+#define VDD_GPU_DRA752         1060
+#define VDD_CORE_DRA752                1030
+#define VDD_IVA_DRA752         1060
+
 /* Standard offset is 0.5v expressed in uv */
 #define PALMAS_SMPS_BASE_VOLT_UV 500000
 
+/* TPS659038 */
+#define TPS659038_I2C_SLAVE_ADDR               0x58
+#define TPS659038_REG_ADDR_SMPS12_MPU          0x23
+#define TPS659038_REG_ADDR_SMPS45_EVE          0x2B
+#define TPS659038_REG_ADDR_SMPS6_GPU           0x2F
+#define TPS659038_REG_ADDR_SMPS7_CORE          0x33
+#define TPS659038_REG_ADDR_SMPS8_IVA           0x37
+
 /* TPS */
 #define TPS62361_I2C_SLAVE_ADDR                0x60
 #define TPS62361_REG_ADDR_SET0         0x0
index 91eb36cf8b872e57c14b8b386759c5c7fa396e0b..0bb59d869b5f92dd76e743f66e1eefe13d95f801 100644 (file)
@@ -62,6 +62,7 @@ void save_omap_boot_params(void);
 void init_omap_revision(void);
 void do_io_settings(void);
 void sri2c_init(void);
+void gpi2c_init(void);
 int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
 u32 warm_reset(void);
 void force_emif_self_refresh(void);
index b70575b1b51892ed65adc270e7da404c831d68c0..3b8bece699d631e99de30a3685625c81853437eb 100644 (file)
@@ -516,6 +516,9 @@ struct vcores_data {
        struct volts mpu;
        struct volts core;
        struct volts mm;
+       struct volts gpu;
+       struct volts eve;
+       struct volts iva;
 };
 
 extern struct prcm_regs const **prcm;