3 * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
5 * Copyright (C) 2009 TechNexion Ltd.
7 * SPDX-License-Identifier: GPL-2.0+
13 #include <asm/arch/mem.h>
14 #include <asm/arch/mux.h>
15 #include <asm/arch/sys_proto.h>
16 #include <asm/omap_gpio.h>
17 #include <asm/arch/mmc_host_def.h>
22 #ifdef CONFIG_USB_EHCI_HCD
24 #include <asm/ehci-omap.h>
28 DECLARE_GLOBAL_DATA_PTR
;
30 /* Timing definitions for Ethernet Controller */
31 static const u32 gpmc_smc911
[] = {
40 static const u32 gpmc_XR16L2751
[] = {
41 XR16L2751_GPMC_CONFIG1
,
42 XR16L2751_GPMC_CONFIG2
,
43 XR16L2751_GPMC_CONFIG3
,
44 XR16L2751_GPMC_CONFIG4
,
45 XR16L2751_GPMC_CONFIG5
,
46 XR16L2751_GPMC_CONFIG6
,
49 #ifdef CONFIG_USB_EHCI_HCD
50 static struct omap_usbhs_board_data usbhs_bdata
= {
51 .port_mode
[0] = OMAP_EHCI_PORT_MODE_PHY
,
52 .port_mode
[1] = OMAP_EHCI_PORT_MODE_PHY
,
53 .port_mode
[2] = OMAP_USBHS_PORT_MODE_UNUSED
,
56 int ehci_hcd_init(int index
, enum usb_init_type init
,
57 struct ehci_hccr
**hccr
, struct ehci_hcor
**hcor
)
59 return omap_ehci_hcd_init(index
, &usbhs_bdata
, hccr
, hcor
);
62 int ehci_hcd_stop(int index
)
64 return omap_ehci_hcd_stop();
70 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
73 gd
->bd
->bi_boot_params
= (OMAP34XX_SDRC_CS0
+ 0x100);
75 /* Chip select 1 and 3 are used for XR16L2751 UART controller */
76 enable_gpmc_cs_config(gpmc_XR16L2751
, &gpmc_cfg
->cs
[1],
77 XR16L2751_UART1_BASE
, GPMC_SIZE_16M
);
79 enable_gpmc_cs_config(gpmc_XR16L2751
, &gpmc_cfg
->cs
[3],
80 XR16L2751_UART2_BASE
, GPMC_SIZE_16M
);
82 gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
, "USB_PHY1_RESET");
83 gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO
, 1);
88 #ifndef CONFIG_SPL_BUILD
92 struct tam3517_module_info info
;
95 omap_die_id_display();
97 eth_addr
= getenv("ethaddr");
101 TAM3517_READ_EEPROM(&info
, ret
);
103 TAM3517_READ_MAC_FROM_EEPROM(&info
);
110 * Routine: set_muxconf_regs
111 * Description: Setting up the configuration Mux registers specific to the
112 * hardware. Many pins need to be moved from protect to primary
115 void set_muxconf_regs(void)
120 int board_eth_init(bd_t
*bis
)
122 davinci_emac_initialize();
124 /* init cs for extern lan */
125 enable_gpmc_cs_config(gpmc_smc911
, &gpmc_cfg
->cs
[5],
126 CONFIG_SMC911X_BASE
, GPMC_SIZE_16M
);
127 if (smc911x_initialize(0, CONFIG_SMC911X_BASE
) <= 0)
128 printf("\nError initializing SMC911x controlleri\n");
133 #if defined(CONFIG_MMC_OMAP_HS) && \
134 !defined(CONFIG_SPL_BUILD)
135 int board_mmc_init(bd_t
*bis
)
137 return omap_mmc_init(0, 0, 0, -1, -1);
141 #ifdef CONFIG_SPL_OS_BOOT
143 * Do board specific preparation before SPL
146 void spl_board_prepare_for_linux(void)
148 /* init cs for extern lan */
149 enable_gpmc_cs_config(gpmc_smc911
, &gpmc_cfg
->cs
[5],
150 CONFIG_SMC911X_BASE
, GPMC_SIZE_16M
);
152 int spl_start_uboot(void)
155 if (!gpio_request(SPL_OS_BOOT_KEY
, "U-Boot key")) {
156 gpio_direction_input(SPL_OS_BOOT_KEY
);
157 val
= gpio_get_value(SPL_OS_BOOT_KEY
);
158 gpio_free(SPL_OS_BOOT_KEY
);