2 * am3517evm.c - board file for TI's AM3517 family of devices.
4 * Author: Vaibhav Hiremath <hvaibhav@ti.com>
6 * Based on ti/evm/evm.c
9 * Texas Instruments Incorporated - http://www.ti.com/
11 * SPDX-License-Identifier: GPL-2.0+
16 #include <asm/omap_musb.h>
17 #include <asm/arch/am35x_def.h>
18 #include <asm/arch/mem.h>
19 #include <asm/arch/mux.h>
20 #include <asm/arch/sys_proto.h>
21 #include <asm/arch/mmc_host_def.h>
22 #include <asm/arch/musb.h>
23 #include <asm/mach-types.h>
24 #include <asm/errno.h>
25 #include <linux/usb/ch9.h>
26 #include <linux/usb/gadget.h>
27 #include <linux/usb/musb.h>
30 #include "am3517evm.h"
32 DECLARE_GLOBAL_DATA_PTR;
36 * Description: Early hardware init.
40 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
41 /* board id for Linux */
42 gd->bd->bi_arch_number = MACH_TYPE_OMAP3517EVM;
44 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
49 #ifdef CONFIG_USB_MUSB_AM35X
50 static struct musb_hdrc_config musb_config = {
57 static struct omap_musb_board_data musb_board_data = {
58 .set_phy_power = am35x_musb_phy_power,
59 .clear_irq = am35x_musb_clear_irq,
60 .reset = am35x_musb_reset,
63 static struct musb_hdrc_platform_data musb_plat = {
64 #if defined(CONFIG_MUSB_HOST)
66 #elif defined(CONFIG_MUSB_GADGET)
67 .mode = MUSB_PERIPHERAL,
69 #error "Please define either CONFIG_MUSB_HOST or CONFIG_MUSB_GADGET"
71 .config = &musb_config,
73 .platform_ops = &am35x_ops,
74 .board_data = &musb_board_data,
77 static void am3517_evm_musb_init(void)
80 * Set up USB clock/mode in the DEVCONF2 register.
81 * USB2.0 PHY reference clock is 13 MHz
83 clrsetbits_le32(&am35x_scm_general_regs->devconf2,
84 CONF2_REFFREQ | CONF2_OTGMODE | CONF2_PHY_GPIOMODE,
85 CONF2_REFFREQ_13MHZ | CONF2_SESENDEN |
86 CONF2_VBDTCTEN | CONF2_DATPOL);
88 musb_register(&musb_plat, &musb_board_data,
89 (void *)AM35XX_IPSS_USBOTGSS_BASE);
92 #define am3517_evm_musb_init() do {} while (0)
96 * Routine: misc_init_r
97 * Description: Init i2c, ethernet, etc... (done here so udelay works)
101 #ifdef CONFIG_SYS_I2C_OMAP34XX
102 i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
107 am3517_evm_musb_init();
113 * Routine: set_muxconf_regs
114 * Description: Setting up the configuration Mux registers specific to the
115 * hardware. Many pins need to be moved from protect to primary
118 void set_muxconf_regs(void)
123 #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD)
124 int board_mmc_init(bd_t *bis)
126 return omap_mmc_init(0, 0, 0, -1, -1);
130 #if defined(CONFIG_USB_ETHER) && defined(CONFIG_MUSB_GADGET)
131 int board_eth_init(bd_t *bis)
135 rv = cpu_eth_init(bis);
139 rv = usb_eth_initialize(bis);