power on devices that kernel does not turn on yet
[pandora-u-boot.git] / board / omap3 / pandora / pandora.c
index dfd51ec..92f3366 100644 (file)
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <twl4030.h>
 #include <asm/io.h>
 #include <asm/arch/mux.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/mach-types.h>
+#include <i2c.h>
 #include "pandora.h"
 
-/******************************************************************************
+/*
  * Routine: board_init
  * Description: Early hardware init.
- *****************************************************************************/
+ */
 int board_init(void)
 {
        DECLARE_GLOBAL_DATA_PTR;
@@ -53,18 +55,20 @@ int board_init(void)
        return 0;
 }
 
-/******************************************************************************
+/*
  * Routine: misc_init_r
  * Description: Configure board specific parts
- *****************************************************************************/
+ */
 int misc_init_r(void)
 {
-       gpio_t *gpio1_base = (gpio_t *)OMAP34XX_GPIO1_BASE;
-       gpio_t *gpio4_base = (gpio_t *)OMAP34XX_GPIO4_BASE;
-       gpio_t *gpio5_base = (gpio_t *)OMAP34XX_GPIO5_BASE;
-       gpio_t *gpio6_base = (gpio_t *)OMAP34XX_GPIO6_BASE;
+       struct gpio *gpio1_base = (struct gpio *)OMAP34XX_GPIO1_BASE;
+       struct gpio *gpio4_base = (struct gpio *)OMAP34XX_GPIO4_BASE;
+       struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE;
+       struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE;
+       unsigned char byte;
 
-       power_init_r();
+       twl4030_power_init();
+       twl4030_led_init();
 
        /* Configure GPIOs to output */
        writel(~(GPIO14 | GPIO15 | GPIO16 | GPIO23), &gpio1_base->oe);
@@ -79,15 +83,28 @@ int misc_init_r(void)
 
        dieid_num_r();
 
+       /* this stuff should move to kernel. */
+       /* set vaux4 to 2.8V (TOUCH, NUBS) */
+       byte = 0x0A;
+       i2c_write(0x4B, 0x81, 1, &byte, 1);
+       byte = 0x20;
+       i2c_write(0x4B, 0x7E, 1, &byte, 1);
+
+       /* set vsim to 2.8V (AUDIO DAC external) */
+       byte = 0x04;
+       i2c_write(0x4B, 0x95, 1, &byte, 1);
+       byte = 0x20;
+       i2c_write(0x4B, 0x92, 1, &byte, 1);
+
        return 0;
 }
 
-/******************************************************************************
+/*
  * Routine: set_muxconf_regs
  * Description: Setting up the configuration Mux registers specific to the
  *             hardware. Many pins need to be moved from protect to primary
  *             mode.
- *****************************************************************************/
+ */
 void set_muxconf_regs(void)
 {
        MUX_PANDORA();