3 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
5 * Copyright (C) 2009 TechNexion Ltd.
7 * See file CREDITS for list of people who contributed to this
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License as
12 * published by the Free Software Foundation; either version 2 of
13 * the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 #include <asm/arch/mem.h>
30 #include <asm/arch/mux.h>
31 #include <asm/arch/sys_proto.h>
32 #include <asm/omap_gpio.h>
33 #include <asm/arch/mmc_host_def.h>
36 #ifdef CONFIG_USB_EHCI
38 #include <asm/ehci-omap.h>
42 DECLARE_GLOBAL_DATA_PTR;
44 /* Timing definitions for Ethernet Controller */
45 static const u32 gpmc_smc911[] = {
54 static const u32 gpmc_XR16L2751[] = {
55 XR16L2751_GPMC_CONFIG1,
56 XR16L2751_GPMC_CONFIG2,
57 XR16L2751_GPMC_CONFIG3,
58 XR16L2751_GPMC_CONFIG4,
59 XR16L2751_GPMC_CONFIG5,
60 XR16L2751_GPMC_CONFIG6,
63 #ifdef CONFIG_USB_EHCI
64 static struct omap_usbhs_board_data usbhs_bdata = {
65 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
66 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
67 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
70 int ehci_hcd_init(void)
72 return omap_ehci_hcd_init(&usbhs_bdata);
75 int ehci_hcd_stop(void)
77 return omap_ehci_hcd_stop();
83 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
86 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
88 /* Chip select 1 and 3 are used for XR16L2751 UART controller */
89 enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[1],
90 XR16L2751_UART1_BASE, GPMC_SIZE_16M);
92 enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[3],
93 XR16L2751_UART2_BASE, GPMC_SIZE_16M);
95 gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB_PHY1_RESET");
96 gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
101 int misc_init_r(void)
109 * Routine: set_muxconf_regs
110 * Description: Setting up the configuration Mux registers specific to the
111 * hardware. Many pins need to be moved from protect to primary
114 void set_muxconf_regs(void)
119 int board_eth_init(bd_t *bis)
121 davinci_emac_initialize();
123 /* init cs for extern lan */
124 enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
125 CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
126 if (smc911x_initialize(0, CONFIG_SMC911X_BASE) <= 0)
127 printf("\nError initializing SMC911x controlleri\n");
132 #if defined(CONFIG_OMAP_HSMMC) && \
133 !defined(CONFIG_SPL_BUILD)
134 int board_mmc_init(bd_t *bis)
136 return omap_mmc_init(0);
140 #ifdef CONFIG_SPL_OS_BOOT
142 * Do board specific preperation before SPL
145 void spl_board_prepare_for_linux(void)
147 /* init cs for extern lan */
148 enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
149 CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
151 int spl_start_uboot(void)
154 if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
155 gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
156 val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
157 gpio_free(CONFIG_SPL_OS_BOOT_KEY);