3 * Texas Instruments Incorporated, <www.ti.com>
4 * Aneesh V <aneesh@ti.com>
5 * Steve Sakoman <steve@sakoman.com>
7 * SPDX-License-Identifier: GPL-2.0+
11 #include <asm/arch/sys_proto.h>
12 #include <asm/arch/mmc_host_def.h>
17 #ifdef CONFIG_USB_EHCI
19 #include <asm/arch/clock.h>
20 #include <asm/arch/ehci.h>
21 #include <asm/ehci-omap.h>
24 DECLARE_GLOBAL_DATA_PTR;
26 const struct omap_sysinfo sysinfo = {
27 "Board: OMAP5432 uEVM\n"
31 * @brief tca642x_init - uEVM default values for the GPIO expander
32 * input reg, output reg, polarity reg, configuration reg
34 struct tca642x_bank_info tca642x_init[] = {
38 .configuration_reg = 0x80 },
42 .configuration_reg = 0xff },
46 .configuration_reg = 0x40 },
57 gd->bd->bi_arch_number = MACH_TYPE_OMAP5_SEVM;
58 gd->bd->bi_boot_params = (0x80000000 + 0x100); /* boot param addr */
60 tca642x_set_inital_state(CONFIG_SYS_I2C_TCA642X_ADDR, tca642x_init);
65 int board_eth_init(bd_t *bis)
71 * @brief misc_init_r - Configure EVM board specific configurations
72 * such as power configurations, ethernet initialization as phase2 of
79 #ifdef CONFIG_PALMAS_POWER
80 palmas_init_settings();
85 void set_muxconf_regs_essential(void)
87 do_set_mux((*ctrl)->control_padconf_core_base,
88 core_padconf_array_essential,
89 sizeof(core_padconf_array_essential) /
90 sizeof(struct pad_conf_entry));
92 do_set_mux((*ctrl)->control_padconf_wkup_base,
93 wkup_padconf_array_essential,
94 sizeof(wkup_padconf_array_essential) /
95 sizeof(struct pad_conf_entry));
98 void set_muxconf_regs_non_essential(void)
100 do_set_mux((*ctrl)->control_padconf_core_base,
101 core_padconf_array_non_essential,
102 sizeof(core_padconf_array_non_essential) /
103 sizeof(struct pad_conf_entry));
105 do_set_mux((*ctrl)->control_padconf_wkup_base,
106 wkup_padconf_array_non_essential,
107 sizeof(wkup_padconf_array_non_essential) /
108 sizeof(struct pad_conf_entry));
111 #if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_GENERIC_MMC)
112 int board_mmc_init(bd_t *bis)
114 omap_mmc_init(0, 0, 0, -1, -1);
115 omap_mmc_init(1, 0, 0, -1, -1);
120 #ifdef CONFIG_USB_EHCI
121 static struct omap_usbhs_board_data usbhs_bdata = {
122 .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
123 .port_mode[1] = OMAP_EHCI_PORT_MODE_HSIC,
124 .port_mode[2] = OMAP_EHCI_PORT_MODE_HSIC,
127 static void enable_host_clocks(void)
129 int hs_clk_ctrl_val = (OPTFCLKEN_HSIC60M_P3_CLK |
130 OPTFCLKEN_HSIC480M_P3_CLK |
131 OPTFCLKEN_HSIC60M_P2_CLK |
132 OPTFCLKEN_HSIC480M_P2_CLK |
133 OPTFCLKEN_UTMI_P3_CLK | OPTFCLKEN_UTMI_P2_CLK);
135 /* Enable port 2 and 3 clocks*/
136 setbits_le32((*prcm)->cm_l3init_hsusbhost_clkctrl, hs_clk_ctrl_val);
138 /* Enable port 2 and 3 usb host ports tll clocks*/
139 setbits_le32((*prcm)->cm_l3init_hsusbtll_clkctrl,
140 (OPTFCLKEN_USB_CH1_CLK_ENABLE | OPTFCLKEN_USB_CH2_CLK_ENABLE));
143 int ehci_hcd_init(int index, struct ehci_hccr **hccr, struct ehci_hcor **hcor)
148 enable_host_clocks();
150 auxclk = readl((*prcm)->scrm_auxclk1);
151 /* Request auxilary clock */
152 auxclk |= AUXCLK_ENABLE_MASK;
153 writel(auxclk, (*prcm)->scrm_auxclk1);
155 ret = omap_ehci_hcd_init(&usbhs_bdata, hccr, hcor);
157 puts("Failed to initialize ehci\n");
164 int ehci_hcd_stop(void)
168 ret = omap_ehci_hcd_stop();