1 From a1a4ba7a5fce36522a994cb06d6d76931964578c Mon Sep 17 00:00:00 2001
2 From: Steve Sakoman <steve@sakoman.com>
3 Date: Wed, 10 Feb 2010 15:23:19 -0800
4 Subject: [PATCH 04/50] OMAP3: Set VAUX2 to 1.8V for EHCI PHY on Beagle Rev C4 boards
7 board/ti/beagle/beagle.c | 5 +++++
8 drivers/power/twl4030.c | 45 +++++++++++++++++++++++++--------------------
9 include/twl4030.h | 15 +++++++++++++++
10 3 files changed, 45 insertions(+), 20 deletions(-)
12 diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
13 index ba16dd7..b4ea7e6 100644
14 --- a/board/ti/beagle/beagle.c
15 +++ b/board/ti/beagle/beagle.c
16 @@ -120,6 +120,11 @@ int misc_init_r(void)
20 + /* Set VAUX2 to 1.8V for EHCI PHY */
21 + twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED,
22 + TWL4030_PM_RECEIVER_VAUX2_VSEL_18,
23 + TWL4030_PM_RECEIVER_VAUX2_DEV_GRP,
24 + TWL4030_PM_RECEIVER_DEV_GRP_P1);
28 diff --git a/drivers/power/twl4030.c b/drivers/power/twl4030.c
29 index eb066cb..f354834 100644
30 --- a/drivers/power/twl4030.c
31 +++ b/drivers/power/twl4030.c
32 @@ -59,57 +59,62 @@ void twl4030_power_reset_init(void)
40 -#define DEV_GRP_P1 0x20
41 -#define VAUX3_VSEL_28 0x03
42 -#define DEV_GRP_ALL 0xE0
43 -#define VPLL2_VSEL_18 0x05
44 -#define VDAC_VSEL_18 0x03
46 void twl4030_power_init(void)
50 /* set VAUX3 to 2.8V */
52 + byte = TWL4030_PM_RECEIVER_DEV_GRP_P1;
53 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
54 TWL4030_PM_RECEIVER_VAUX3_DEV_GRP);
55 - byte = VAUX3_VSEL_28;
56 + byte = TWL4030_PM_RECEIVER_VAUX3_VSEL_28;
57 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
58 TWL4030_PM_RECEIVER_VAUX3_DEDICATED);
60 /* set VPLL2 to 1.8V */
62 + byte = TWL4030_PM_RECEIVER_DEV_GRP_ALL;
63 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
64 TWL4030_PM_RECEIVER_VPLL2_DEV_GRP);
65 - byte = VPLL2_VSEL_18;
66 + byte = TWL4030_PM_RECEIVER_VPLL2_VSEL_18;
67 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
68 TWL4030_PM_RECEIVER_VPLL2_DEDICATED);
70 /* set VDAC to 1.8V */
72 + byte = TWL4030_PM_RECEIVER_DEV_GRP_P1;
73 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
74 TWL4030_PM_RECEIVER_VDAC_DEV_GRP);
75 - byte = VDAC_VSEL_18;
76 + byte = TWL4030_PM_RECEIVER_VDAC_VSEL_18;
77 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
78 TWL4030_PM_RECEIVER_VDAC_DEDICATED);
81 -#define VMMC1_VSEL_30 0x02
83 void twl4030_power_mmc_init(void)
88 + byte = TWL4030_PM_RECEIVER_DEV_GRP_P1;
89 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
90 TWL4030_PM_RECEIVER_VMMC1_DEV_GRP);
93 - byte = VMMC1_VSEL_30;
94 + byte = TWL4030_PM_RECEIVER_VMMC1_VSEL_30;
95 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, byte,
96 TWL4030_PM_RECEIVER_VMMC1_DEDICATED);
100 + * Generic function to select Device Group and Voltage
102 +void twl4030_pmrecv_vsel_cfg(u8 vsel_reg, u8 vsel_val,
103 + u8 dev_grp, u8 dev_grp_sel)
105 + /* Select the Device Group */
106 + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, dev_grp_sel,
109 + /* Select the Voltage */
110 + twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER, vsel_val,
115 diff --git a/include/twl4030.h b/include/twl4030.h
116 index 2b2f5ae..cc99403 100644
117 --- a/include/twl4030.h
118 +++ b/include/twl4030.h
120 #define TWL4030_USB_PHY_CLK_CTRL_STS 0xFF
123 + * Voltage Selection in PM Receiver Module
125 +#define TWL4030_PM_RECEIVER_VAUX2_VSEL_18 0x05
126 +#define TWL4030_PM_RECEIVER_VAUX3_VSEL_28 0x03
127 +#define TWL4030_PM_RECEIVER_VPLL2_VSEL_18 0x05
128 +#define TWL4030_PM_RECEIVER_VDAC_VSEL_18 0x03
129 +#define TWL4030_PM_RECEIVER_VMMC1_VSEL_30 0x02
132 + * Device Selection in PM Receiver Module
134 +#define TWL4030_PM_RECEIVER_DEV_GRP_P1 0x20
135 +#define TWL4030_PM_RECEIVER_DEV_GRP_ALL 0xE0
138 * Convience functions to read and write from TWL4030
140 * chip_no is the i2c address, it must be one of the chip addresses