aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalaji T K2013-05-03 04:28:08 -0500
committerLokesh Vutla2013-05-29 04:35:01 -0500
commit199c824818fd534c38b767595f0f62d03c3a68db (patch)
tree02baa8a2431a56000d48336bfc3ec7c7662c2ced
parent25051b53364c510dc24da274f180424a2a2dd27a (diff)
downloadu-boot-199c824818fd534c38b767595f0f62d03c3a68db.tar.gz
u-boot-199c824818fd534c38b767595f0f62d03c3a68db.tar.xz
u-boot-199c824818fd534c38b767595f0f62d03c3a68db.zip
mmc: omap_hsmmc: add mmc1 pbias, ldo1
add dra mmc pbias support and ldo1 power on Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
-rw-r--r--arch/arm/include/asm/arch-omap5/omap.h3
-rw-r--r--drivers/mmc/omap_hsmmc.c26
-rw-r--r--drivers/power/palmas.c25
-rw-r--r--include/configs/omap5_common.h4
-rw-r--r--include/configs/omap5_uevm.h5
-rw-r--r--include/palmas.h5
6 files changed, 48 insertions, 20 deletions
diff --git a/arch/arm/include/asm/arch-omap5/omap.h b/arch/arm/include/asm/arch-omap5/omap.h
index 15d429f4f9..63378fb10c 100644
--- a/arch/arm/include/asm/arch-omap5/omap.h
+++ b/arch/arm/include/asm/arch-omap5/omap.h
@@ -96,9 +96,10 @@
96/* CONTROL_EFUSE_2 */ 96/* CONTROL_EFUSE_2 */
97#define CONTROL_EFUSE_2_NMOS_PMOS_PTV_CODE_1 0x00ffc000 97#define CONTROL_EFUSE_2_NMOS_PMOS_PTV_CODE_1 0x00ffc000
98 98
99#define SDCARD_BIAS_PWRDNZ (1 << 27)
99#define SDCARD_PWRDNZ (1 << 26) 100#define SDCARD_PWRDNZ (1 << 26)
100#define SDCARD_BIAS_HIZ_MODE (1 << 25) 101#define SDCARD_BIAS_HIZ_MODE (1 << 25)
101#define SDCARD_BIAS_PWRDNZ (1 << 22) 102#define SDCARD_BIAS_PWRDNZ2 (1 << 22)
102#define SDCARD_PBIASLITE_VMODE (1 << 21) 103#define SDCARD_PBIASLITE_VMODE (1 << 21)
103 104
104#ifndef __ASSEMBLY__ 105#ifndef __ASSEMBLY__
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index afdfa886e8..60807df24e 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -113,23 +113,25 @@ static void omap5_pbias_config(struct mmc *mmc)
113 u32 value = 0; 113 u32 value = 0;
114 114
115 value = readl((*ctrl)->control_pbias); 115 value = readl((*ctrl)->control_pbias);
116 value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ); 116 value &= ~SDCARD_PWRDNZ;
117 value |= SDCARD_BIAS_HIZ_MODE; 117 writel(value, (*ctrl)->control_pbias);
118 udelay(10); /* wait 10 us */
119 value &= ~SDCARD_BIAS_PWRDNZ;
118 writel(value, (*ctrl)->control_pbias); 120 writel(value, (*ctrl)->control_pbias);
119 121
120 palmas_mmc1_poweron_ldo(); 122#if defined(CONFIG_DRA7XX)
123 palmas_mmc1_poweron_ldo1();
124#else
125 palmas_mmc1_poweron_ldo9();
126#endif
121 127
122 value = readl((*ctrl)->control_pbias); 128 value = readl((*ctrl)->control_pbias);
123 value &= ~SDCARD_BIAS_HIZ_MODE; 129 value |= SDCARD_BIAS_PWRDNZ;
124 value |= SDCARD_PBIASLITE_VMODE | SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ;
125 writel(value, (*ctrl)->control_pbias); 130 writel(value, (*ctrl)->control_pbias);
126 131 udelay(150); /* wait 10 us */
127 value = readl((*ctrl)->control_pbias); 132 value |= SDCARD_PWRDNZ;
128 if (value & (1 << 23)) { 133 writel(value, (*ctrl)->control_pbias);
129 value &= ~(SDCARD_PWRDNZ | SDCARD_BIAS_PWRDNZ); 134 udelay(150); /* wait 10 us */
130 value |= SDCARD_BIAS_HIZ_MODE;
131 writel(value, (*ctrl)->control_pbias);
132 }
133} 135}
134#endif 136#endif
135 137
diff --git a/drivers/power/palmas.c b/drivers/power/palmas.c
index 09c832d8b6..84ec8818b6 100644
--- a/drivers/power/palmas.c
+++ b/drivers/power/palmas.c
@@ -28,7 +28,7 @@ void palmas_init_settings(void)
28 return; 28 return;
29} 29}
30 30
31int palmas_mmc1_poweron_ldo(void) 31int palmas_mmc1_poweron_ldo9(void)
32{ 32{
33 u8 val = 0; 33 u8 val = 0;
34 34
@@ -50,3 +50,26 @@ int palmas_mmc1_poweron_ldo(void)
50 50
51 return 0; 51 return 0;
52} 52}
53
54int palmas_mmc1_poweron_ldo1(void)
55{
56 u8 val = 0;
57
58 /* set LDO9 TWL6035 to 3V */
59 val = 0x2b; /* (3 -.9)*20 +1 */
60
61 if (palmas_i2c_write_u8(0x58, LDO1_VOLTAGE, val)) {
62 printf("twl6035: could not set LDO1 voltage\n");
63 return 1;
64 }
65
66 /* TURN ON LDO9 */
67 val = LDO_ON | LDO_MODE_SLEEP | LDO_MODE_ACTIVE;
68
69 if (palmas_i2c_write_u8(0x58, LDO1_CTRL, val)) {
70 printf("twl6035: could not turn on LDO1\n");
71 return 1;
72 }
73
74 return 0;
75}
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index 9fef21c7d9..f2c4c70323 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -241,6 +241,10 @@
241#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS 241#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
242#endif 242#endif
243 243
244#ifndef CONFIG_SPL_BUILD
245#define CONFIG_PALMAS_POWER
246#endif
247
244/* Defines for SPL */ 248/* Defines for SPL */
245#define CONFIG_SPL 249#define CONFIG_SPL
246#define CONFIG_SPL_FRAMEWORK 250#define CONFIG_SPL_FRAMEWORK
diff --git a/include/configs/omap5_uevm.h b/include/configs/omap5_uevm.h
index 96c5955b62..69754c6a1c 100644
--- a/include/configs/omap5_uevm.h
+++ b/include/configs/omap5_uevm.h
@@ -39,11 +39,6 @@
39#define CONFIG_SYS_NS16550_COM3 UART3_BASE 39#define CONFIG_SYS_NS16550_COM3 UART3_BASE
40#define CONFIG_BAUDRATE 115200 40#define CONFIG_BAUDRATE 115200
41 41
42/* TWL6035 */
43#ifndef CONFIG_SPL_BUILD
44#define CONFIG_PALMAS_POWER
45#endif
46
47/* MMC ENV related defines */ 42/* MMC ENV related defines */
48#define CONFIG_ENV_IS_IN_MMC 43#define CONFIG_ENV_IS_IN_MMC
49#define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */ 44#define CONFIG_SYS_MMC_ENV_DEV 1 /* SLOT2: eMMC(1) */
diff --git a/include/palmas.h b/include/palmas.h
index 3b185896d6..18a25ffa75 100644
--- a/include/palmas.h
+++ b/include/palmas.h
@@ -30,6 +30,8 @@
30#define PALMAS_CHIP_ADDR 0x48 30#define PALMAS_CHIP_ADDR 0x48
31 31
32/* 0x1XY translates to page 1, register address 0xXY */ 32/* 0x1XY translates to page 1, register address 0xXY */
33#define LDO1_CTRL 0x50
34#define LDO1_VOLTAGE 0x51
33#define LDO9_CTRL 0x60 35#define LDO9_CTRL 0x60
34#define LDO9_VOLTAGE 0x61 36#define LDO9_VOLTAGE 0x61
35 37
@@ -53,6 +55,7 @@ static inline int palmas_i2c_read_u8(u8 chip_no, u8 reg, u8 *val)
53} 55}
54 56
55void palmas_init_settings(void); 57void palmas_init_settings(void);
56int palmas_mmc1_poweron_ldo(void); 58int palmas_mmc1_poweron_ldo9(void);
59int palmas_mmc1_poweron_ldo1(void);
57 60
58#endif /* PALMAS_H */ 61#endif /* PALMAS_H */