1 // SPDX-License-Identifier: GPL-2.0+
4 * Grazvydas Ignotas <notasas@gmail.com>
6 * Derived from Beagle Board, 3430 SDP, and OMAP3EVM code by
7 * Richard Woodruff <r-woodruff2@ti.com>
8 * Syed Mohammed Khasim <khasim@ti.com>
9 * Sunil Kumar <sunilsaini05@gmail.com>
10 * Shashi Ranjan <shashiranjanmca05@gmail.com>
12 * (C) Copyright 2004-2008
13 * Texas Instruments, <www.ti.com>
22 #include <asm/arch/mmc_host_def.h>
23 #include <asm/arch/mux.h>
24 #include <asm/arch/gpio.h>
25 #include <asm/arch/sys_proto.h>
26 #include <asm/mach-types.h>
27 #include <linux/delay.h>
30 DECLARE_GLOBAL_DATA_PTR;
32 #define TWL4030_BB_CFG_BBCHEN (1 << 4)
33 #define TWL4030_BB_CFG_BBSEL_3200MV (3 << 2)
34 #define TWL4030_BB_CFG_BBISEL_500UA 2
36 #define CONTROL_WKUP_CTRL 0x48002a5c
37 #define GPIO_IO_PWRDNZ (1 << 6)
38 #define PBIASLITEVMODE1 (1 << 8)
40 static const struct ns16550_platdata pandora_serial = {
41 .base = OMAP34XX_UART3,
43 .clock = V_NS16550_CLK,
44 .fcr = UART_FCR_DEFVAL,
47 U_BOOT_DEVICE(pandora_uart) = {
54 * Description: Early hardware init.
58 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
59 /* board id for Linux */
60 gd->bd->bi_arch_number = MACH_TYPE_OMAP3_PANDORA;
62 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
67 static void set_output_gpio(unsigned int gpio, int value)
71 ret = gpio_request(gpio, "");
73 printf("could not request GPIO %u\n", gpio);
76 ret = gpio_direction_output(gpio, value);
78 printf("could not set GPIO %u to %d\n", gpio, value);
82 * Routine: misc_init_r
83 * Description: Configure board specific parts
87 t2_t *t2_base = (t2_t *)T2_BASE;
90 twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
92 /* set up dual-voltage GPIOs to 1.8V */
93 pbias_lite = readl(&t2_base->pbias_lite);
94 pbias_lite &= ~PBIASLITEVMODE1;
95 pbias_lite |= PBIASLITEPWRDNZ1;
96 writel(pbias_lite, &t2_base->pbias_lite);
97 if (get_cpu_family() == CPU_OMAP36XX)
98 writel(readl(CONTROL_WKUP_CTRL) | GPIO_IO_PWRDNZ,
101 /* make sure audio and BT chips are in powerdown state */
102 set_output_gpio(14, 0);
103 set_output_gpio(15, 0);
104 set_output_gpio(118, 0);
106 /* enable USB supply */
107 set_output_gpio(164, 1);
109 /* wifi needs a short pulse to enter powersave state */
110 set_output_gpio(23, 1);
112 gpio_direction_output(23, 0);
114 /* Enable battery backup capacitor (3.2V, 0.5mA charge current) */
115 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER,
116 TWL4030_PM_RECEIVER_BB_CFG,
117 TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
118 TWL4030_BB_CFG_BBISEL_500UA);
120 omap_die_id_display();
126 * Routine: set_muxconf_regs
127 * Description: Setting up the configuration Mux registers specific to the
128 * hardware. Many pins need to be moved from protect to primary
131 void set_muxconf_regs(void)
134 if (get_cpu_family() == CPU_OMAP36XX) {
140 int board_mmc_init(bd_t *bis)
142 return omap_mmc_init(0, 0, 0, -1, -1);
145 void board_mmc_power_init(void)
147 twl4030_power_mmc_init(0);