1 // SPDX-License-Identifier: GPL-2.0+
4 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
6 * Copyright (C) 2009 TechNexion Ltd.
12 #include <asm/arch/mem.h>
13 #include <asm/arch/mux.h>
14 #include <asm/arch/sys_proto.h>
15 #include <asm/omap_gpio.h>
16 #include <asm/arch/mmc_host_def.h>
22 #include <asm/ehci-omap.h>
25 DECLARE_GLOBAL_DATA_PTR;
27 /* Timing definitions for Ethernet Controller */
28 static const u32 gpmc_smc911[] = {
37 static const u32 gpmc_XR16L2751[] = {
38 XR16L2751_GPMC_CONFIG1,
39 XR16L2751_GPMC_CONFIG2,
40 XR16L2751_GPMC_CONFIG3,
41 XR16L2751_GPMC_CONFIG4,
42 XR16L2751_GPMC_CONFIG5,
43 XR16L2751_GPMC_CONFIG6,
46 #ifdef CONFIG_USB_EHCI_OMAP
47 static struct omap_usbhs_board_data usbhs_bdata = {
48 .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
49 .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
50 .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
53 int ehci_hcd_init(int index, enum usb_init_type init,
54 struct ehci_hccr **hccr, struct ehci_hcor **hcor)
56 return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor);
59 int ehci_hcd_stop(int index)
61 return omap_ehci_hcd_stop();
67 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
70 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
72 /* Chip select 1 and 3 are used for XR16L2751 UART controller */
73 enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[1],
74 XR16L2751_UART1_BASE, GPMC_SIZE_16M);
76 enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[3],
77 XR16L2751_UART2_BASE, GPMC_SIZE_16M);
79 gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB_PHY1_RESET");
80 gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
85 #ifndef CONFIG_SPL_BUILD
89 struct tam3517_module_info info;
92 omap_die_id_display();
94 eth_addr = env_get("ethaddr");
98 TAM3517_READ_EEPROM(&info, ret);
100 TAM3517_READ_MAC_FROM_EEPROM(&info);
107 * Routine: set_muxconf_regs
108 * Description: Setting up the configuration Mux registers specific to the
109 * hardware. Many pins need to be moved from protect to primary
112 void set_muxconf_regs(void)
117 int board_eth_init(bd_t *bis)
119 #ifdef CONFIG_DRIVER_TI_EMAC
120 davinci_emac_initialize();
122 /* init cs for extern lan */
123 enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
124 CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
125 #ifdef CONFIG_SMC911X
126 return smc911x_initialize(0, CONFIG_SMC911X_BASE);
132 #if defined(CONFIG_MMC_OMAP_HS)
133 int board_mmc_init(bd_t *bis)
135 return omap_mmc_init(0, 0, 0, -1, -1);
139 #ifdef CONFIG_SPL_OS_BOOT
141 * Do board specific preparation before SPL
144 void spl_board_prepare_for_linux(void)
146 /* init cs for extern lan */
147 enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
148 CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
150 int spl_start_uboot(void)
153 if (!gpio_request(SPL_OS_BOOT_KEY, "U-Boot key")) {
154 gpio_direction_input(SPL_OS_BOOT_KEY);
155 val = gpio_get_value(SPL_OS_BOOT_KEY);
156 gpio_free(SPL_OS_BOOT_KEY);