]> git.ipfire.org Git - people/ms/u-boot.git/blob - board/omap3/common/power.c
TWL4030 Add power reset button
[people/ms/u-boot.git] / board / omap3 / common / power.c
1 /*
2 * (C) Copyright 2004-2008
3 * Texas Instruments, <www.ti.com>
4 *
5 * Author :
6 * Sunil Kumar <sunilsaini05@gmail.com>
7 * Shashi Ranjan <shashiranjanmca05@gmail.com>
8 *
9 * Derived from Beagle Board and 3430 SDP code by
10 * Richard Woodruff <r-woodruff2@ti.com>
11 * Syed Mohammed Khasim <khasim@ti.com>
12 *
13 *
14 * See file CREDITS for list of people who contributed to this
15 * project.
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License as
19 * published by the Free Software Foundation; either version 2 of
20 * the License, or (at your option) any later version.
21 *
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 */
32 #include <common.h>
33 #include <asm/arch/sys_proto.h>
34 #include <i2c.h>
35
36 /******************************************************************************
37 * Routine: power_init_r
38 * Description: Configure power supply
39 *****************************************************************************/
40 void power_init_r(void)
41 {
42 unsigned char byte;
43
44 #ifdef CONFIG_DRIVER_OMAP34XX_I2C
45 i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
46 #endif
47
48 /*
49 * Configure OMAP3 supply voltages in power management
50 * companion chip.
51 */
52
53 /* set VAUX3 to 2.8V */
54 byte = DEV_GRP_P1;
55 i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEV_GRP, 1, &byte, 1);
56 byte = VAUX3_VSEL_28;
57 i2c_write(PWRMGT_ADDR_ID4, VAUX3_DEDICATED, 1, &byte, 1);
58
59 /* set VPLL2 to 1.8V */
60 byte = DEV_GRP_ALL;
61 i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEV_GRP, 1, &byte, 1);
62 byte = VPLL2_VSEL_18;
63 i2c_write(PWRMGT_ADDR_ID4, VPLL2_DEDICATED, 1, &byte, 1);
64
65 /* set VDAC to 1.8V */
66 byte = DEV_GRP_P1;
67 i2c_write(PWRMGT_ADDR_ID4, VDAC_DEV_GRP, 1, &byte, 1);
68 byte = VDAC_VSEL_18;
69 i2c_write(PWRMGT_ADDR_ID4, VDAC_DEDICATED, 1, &byte, 1);
70
71 /* enable LED */
72 byte = LEDBPWM | LEDAPWM | LEDBON | LEDAON;
73 i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
74 }