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>
21 #include <asm/arch/mmc_host_def.h>
22 #include <asm/arch/mux.h>
23 #include <asm/arch/gpio.h>
24 #include <asm/arch/sys_proto.h>
25 #include <asm/mach-types.h>
28 DECLARE_GLOBAL_DATA_PTR;
30 #define TWL4030_BB_CFG_BBCHEN (1 << 4)
31 #define TWL4030_BB_CFG_BBSEL_3200MV (3 << 2)
32 #define TWL4030_BB_CFG_BBISEL_500UA 2
34 #define CONTROL_WKUP_CTRL 0x48002a5c
35 #define GPIO_IO_PWRDNZ (1 << 6)
36 #define PBIASLITEVMODE1 (1 << 8)
38 static const struct ns16550_platdata pandora_serial = {
39 .base = OMAP34XX_UART3,
41 .clock = V_NS16550_CLK,
42 .fcr = UART_FCR_DEFVAL,
45 U_BOOT_DEVICE(pandora_uart) = {
52 * Description: Early hardware init.
56 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
57 /* board id for Linux */
58 gd->bd->bi_arch_number = MACH_TYPE_OMAP3_PANDORA;
60 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
65 static void set_output_gpio(unsigned int gpio, int value)
69 ret = gpio_request(gpio, "");
71 printf("could not request GPIO %u\n", gpio);
74 ret = gpio_direction_output(gpio, value);
76 printf("could not set GPIO %u to %d\n", gpio, value);
80 * Routine: misc_init_r
81 * Description: Configure board specific parts
85 t2_t *t2_base = (t2_t *)T2_BASE;
88 twl4030_led_init(TWL4030_LED_LEDEN_LEDBON);
90 /* set up dual-voltage GPIOs to 1.8V */
91 pbias_lite = readl(&t2_base->pbias_lite);
92 pbias_lite &= ~PBIASLITEVMODE1;
93 pbias_lite |= PBIASLITEPWRDNZ1;
94 writel(pbias_lite, &t2_base->pbias_lite);
95 if (get_cpu_family() == CPU_OMAP36XX)
96 writel(readl(CONTROL_WKUP_CTRL) | GPIO_IO_PWRDNZ,
99 /* make sure audio and BT chips are in powerdown state */
100 set_output_gpio(14, 0);
101 set_output_gpio(15, 0);
102 set_output_gpio(118, 0);
104 /* enable USB supply */
105 set_output_gpio(164, 1);
107 /* wifi needs a short pulse to enter powersave state */
108 set_output_gpio(23, 1);
110 gpio_direction_output(23, 0);
112 /* Enable battery backup capacitor (3.2V, 0.5mA charge current) */
113 twl4030_i2c_write_u8(TWL4030_CHIP_PM_RECEIVER,
114 TWL4030_PM_RECEIVER_BB_CFG,
115 TWL4030_BB_CFG_BBCHEN | TWL4030_BB_CFG_BBSEL_3200MV |
116 TWL4030_BB_CFG_BBISEL_500UA);
118 omap_die_id_display();
124 * Routine: set_muxconf_regs
125 * Description: Setting up the configuration Mux registers specific to the
126 * hardware. Many pins need to be moved from protect to primary
129 void set_muxconf_regs(void)
132 if (get_cpu_family() == CPU_OMAP36XX) {
138 int board_mmc_init(bd_t *bis)
140 return omap_mmc_init(0, 0, 0, -1, -1);
143 void board_mmc_power_init(void)
145 twl4030_power_mmc_init(0);