aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLokesh Vutla2013-04-01 22:55:31 -0500
committerLokesh Vutla2013-05-29 04:34:30 -0500
commit791560e6156563e5be8eb1297bfeee2c4789ec5b (patch)
treecf1d9fd8e72bd4e0a205111705ca73ea5fcb2296
parenteaed79285b1b893277e93bcfef0a4bd31fe7edcd (diff)
downloadu-boot-791560e6156563e5be8eb1297bfeee2c4789ec5b.tar.gz
u-boot-791560e6156563e5be8eb1297bfeee2c4789ec5b.tar.xz
u-boot-791560e6156563e5be8eb1297bfeee2c4789ec5b.zip
ARM: DRA7xx: power Add support for tps659038 PMIC
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>
-rw-r--r--arch/arm/cpu/armv7/omap-common/clocks-common.c23
-rw-r--r--arch/arm/cpu/armv7/omap5/hw_data.c38
-rw-r--r--arch/arm/include/asm/arch-omap4/sys_proto.h1
-rw-r--r--arch/arm/include/asm/arch-omap5/clocks.h15
-rw-r--r--arch/arm/include/asm/arch-omap5/sys_proto.h1
-rw-r--r--arch/arm/include/asm/omap_common.h3
6 files changed, 80 insertions, 1 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 0daf98cad9..c51c3590c2 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -30,6 +30,7 @@
30 * MA 02111-1307 USA 30 * MA 02111-1307 USA
31 */ 31 */
32#include <common.h> 32#include <common.h>
33#include <i2c.h>
33#include <asm/omap_common.h> 34#include <asm/omap_common.h>
34#include <asm/gpio.h> 35#include <asm/gpio.h>
35#include <asm/arch/clocks.h> 36#include <asm/arch/clocks.h>
@@ -487,6 +488,9 @@ void do_scale_vcore(u32 vcore_reg, u32 volt_mv, struct pmic_data *pmic)
487 u32 offset = volt_mv; 488 u32 offset = volt_mv;
488 int ret = 0; 489 int ret = 0;
489 490
491 if (!volt_mv)
492 return;
493
490 pmic->pmic_bus_init(); 494 pmic->pmic_bus_init();
491 /* See if we can first get the GPIO if needed */ 495 /* See if we can first get the GPIO if needed */
492 if (pmic->gpio_en) 496 if (pmic->gpio_en)
@@ -534,6 +538,15 @@ void scale_vcores(struct vcores_data const *vcores)
534 do_scale_vcore(vcores->mm.addr, vcores->mm.value, 538 do_scale_vcore(vcores->mm.addr, vcores->mm.value,
535 vcores->mm.pmic); 539 vcores->mm.pmic);
536 540
541 do_scale_vcore(vcores->gpu.addr, vcores->gpu.value,
542 vcores->gpu.pmic);
543
544 do_scale_vcore(vcores->eve.addr, vcores->eve.value,
545 vcores->eve.pmic);
546
547 do_scale_vcore(vcores->iva.addr, vcores->iva.value,
548 vcores->iva.pmic);
549
537 if (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3) { 550 if (emif_sdram_type() == EMIF_SDRAM_TYPE_DDR3) {
538 /* Configure LDO SRAM "magic" bits */ 551 /* Configure LDO SRAM "magic" bits */
539 writel(2, (*prcm)->prm_sldo_core_setup); 552 writel(2, (*prcm)->prm_sldo_core_setup);
@@ -723,3 +736,13 @@ void prcm_init(void)
723 if (OMAP_INIT_CONTEXT_SPL != omap_hw_init_context()) 736 if (OMAP_INIT_CONTEXT_SPL != omap_hw_init_context())
724 enable_basic_uboot_clocks(); 737 enable_basic_uboot_clocks();
725} 738}
739
740void gpi2c_init(void)
741{
742 static int gpi2c = 1;
743
744 if (gpi2c) {
745 i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
746 gpi2c = 0;
747 }
748}
diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
index 74e473d83a..e9d34c13b1 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -26,6 +26,7 @@
26 * MA 02111-1307 USA 26 * MA 02111-1307 USA
27 */ 27 */
28#include <common.h> 28#include <common.h>
29#include <palmas.h>
29#include <asm/arch/omap.h> 30#include <asm/arch/omap.h>
30#include <asm/arch/sys_proto.h> 31#include <asm/arch/sys_proto.h>
31#include <asm/omap_common.h> 32#include <asm/omap_common.h>
@@ -294,6 +295,19 @@ struct pmic_data palmas = {
294 .pmic_write = omap_vc_bypass_send_value, 295 .pmic_write = omap_vc_bypass_send_value,
295}; 296};
296 297
298struct pmic_data tps659038 = {
299 .base_offset = PALMAS_SMPS_BASE_VOLT_UV,
300 .step = 10000, /* 10 mV represented in uV */
301 /*
302 * Offset codes 1-6 all give the base voltage in Palmas
303 * Offset code 0 switches OFF the SMPS
304 */
305 .start_code = 6,
306 .i2c_slave_addr = TPS659038_I2C_SLAVE_ADDR,
307 .pmic_bus_init = gpi2c_init,
308 .pmic_write = palmas_i2c_write_u8,
309};
310
297struct vcores_data omap5430_volts = { 311struct vcores_data omap5430_volts = {
298 .mpu.value = VDD_MPU, 312 .mpu.value = VDD_MPU,
299 .mpu.addr = SMPS_REG_ADDR_12_MPU, 313 .mpu.addr = SMPS_REG_ADDR_12_MPU,
@@ -322,6 +336,28 @@ struct vcores_data omap5430_volts_es2 = {
322 .mm.pmic = &palmas, 336 .mm.pmic = &palmas,
323}; 337};
324 338
339struct vcores_data dra752_volts = {
340 .mpu.value = VDD_MPU_DRA752,
341 .mpu.addr = TPS659038_REG_ADDR_SMPS12_MPU,
342 .mpu.pmic = &tps659038,
343
344 .eve.value = VDD_EVE_DRA752,
345 .eve.addr = TPS659038_REG_ADDR_SMPS45_EVE,
346 .eve.pmic = &tps659038,
347
348 .gpu.value = VDD_GPU_DRA752,
349 .gpu.addr = TPS659038_REG_ADDR_SMPS6_GPU,
350 .gpu.pmic = &tps659038,
351
352 .core.value = VDD_CORE_DRA752,
353 .core.addr = TPS659038_REG_ADDR_SMPS7_CORE,
354 .core.pmic = &tps659038,
355
356 .iva.value = VDD_IVA_DRA752,
357 .iva.addr = TPS659038_REG_ADDR_SMPS8_IVA,
358 .iva.pmic = &tps659038,
359};
360
325/* 361/*
326 * Enable essential clock domains, modules and 362 * Enable essential clock domains, modules and
327 * do some additional special settings needed 363 * do some additional special settings needed
@@ -562,7 +598,7 @@ void hw_data_init(void)
562 case DRA752_ES1_0: 598 case DRA752_ES1_0:
563 *prcm = &dra7xx_prcm; 599 *prcm = &dra7xx_prcm;
564 *dplls_data = &dra7xx_dplls; 600 *dplls_data = &dra7xx_dplls;
565 *omap_vcores = &omap5430_volts_es2; 601 *omap_vcores = &dra752_volts;
566 *ctrl = &dra7xx_ctrl; 602 *ctrl = &dra7xx_ctrl;
567 break; 603 break;
568 604
diff --git a/arch/arm/include/asm/arch-omap4/sys_proto.h b/arch/arm/include/asm/arch-omap4/sys_proto.h
index 37d6c69352..438cb96a96 100644
--- a/arch/arm/include/asm/arch-omap4/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap4/sys_proto.h
@@ -57,6 +57,7 @@ u32 cortex_rev(void);
57void init_omap_revision(void); 57void init_omap_revision(void);
58void do_io_settings(void); 58void do_io_settings(void);
59void sri2c_init(void); 59void sri2c_init(void);
60void gpi2c_init(void);
60int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data); 61int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
61u32 warm_reset(void); 62u32 warm_reset(void);
62void force_emif_self_refresh(void); 63void force_emif_self_refresh(void);
diff --git a/arch/arm/include/asm/arch-omap5/clocks.h b/arch/arm/include/asm/arch-omap5/clocks.h
index ca75f6333f..b43737ed42 100644
--- a/arch/arm/include/asm/arch-omap5/clocks.h
+++ b/arch/arm/include/asm/arch-omap5/clocks.h
@@ -212,9 +212,24 @@
212#define VDD_MPU_ES2_LOW 880 212#define VDD_MPU_ES2_LOW 880
213#define VDD_MM_ES2_LOW 880 213#define VDD_MM_ES2_LOW 880
214 214
215/* TPS659038 Voltage settings in mv for OPP_NOMINAL */
216#define VDD_MPU_DRA752 1090
217#define VDD_EVE_DRA752 1060
218#define VDD_GPU_DRA752 1060
219#define VDD_CORE_DRA752 1030
220#define VDD_IVA_DRA752 1060
221
215/* Standard offset is 0.5v expressed in uv */ 222/* Standard offset is 0.5v expressed in uv */
216#define PALMAS_SMPS_BASE_VOLT_UV 500000 223#define PALMAS_SMPS_BASE_VOLT_UV 500000
217 224
225/* TPS659038 */
226#define TPS659038_I2C_SLAVE_ADDR 0x58
227#define TPS659038_REG_ADDR_SMPS12_MPU 0x23
228#define TPS659038_REG_ADDR_SMPS45_EVE 0x2B
229#define TPS659038_REG_ADDR_SMPS6_GPU 0x2F
230#define TPS659038_REG_ADDR_SMPS7_CORE 0x33
231#define TPS659038_REG_ADDR_SMPS8_IVA 0x37
232
218/* TPS */ 233/* TPS */
219#define TPS62361_I2C_SLAVE_ADDR 0x60 234#define TPS62361_I2C_SLAVE_ADDR 0x60
220#define TPS62361_REG_ADDR_SET0 0x0 235#define TPS62361_REG_ADDR_SET0 0x0
diff --git a/arch/arm/include/asm/arch-omap5/sys_proto.h b/arch/arm/include/asm/arch-omap5/sys_proto.h
index 32ced5fbde..36cfc6f74e 100644
--- a/arch/arm/include/asm/arch-omap5/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap5/sys_proto.h
@@ -61,6 +61,7 @@ u32 cortex_rev(void);
61void init_omap_revision(void); 61void init_omap_revision(void);
62void do_io_settings(void); 62void do_io_settings(void);
63void sri2c_init(void); 63void sri2c_init(void);
64void gpi2c_init(void);
64int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data); 65int omap_vc_bypass_send_value(u8 sa, u8 reg_addr, u8 reg_data);
65u32 warm_reset(void); 66u32 warm_reset(void);
66void force_emif_self_refresh(void); 67void force_emif_self_refresh(void);
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 3f1d31dbd9..6b28f2e3f7 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -510,6 +510,9 @@ struct vcores_data {
510 struct volts mpu; 510 struct volts mpu;
511 struct volts core; 511 struct volts core;
512 struct volts mm; 512 struct volts mm;
513 struct volts gpu;
514 struct volts eve;
515 struct volts iva;
513}; 516};
514 517
515extern struct prcm_regs const **prcm; 518extern struct prcm_regs const **prcm;