X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=board%2Fovero%2Fovero.c;h=b7f85e711b46fed4bed4b35774599d929d382c7a;hb=ecfc19f31f1fa25f739d11c81d4810f9b35b29aa;hp=488246bcc57c603e035eefa55e7917c7bae2498f;hpb=4ed914a2430775973730562c2c880318536b9586;p=u-boot diff --git a/board/overo/overo.c b/board/overo/overo.c index 488246bcc5..b7f85e711b 100644 --- a/board/overo/overo.c +++ b/board/overo/overo.c @@ -13,6 +13,8 @@ * SPDX-License-Identifier: GPL-2.0+ */ #include +#include +#include #include #include #include @@ -25,6 +27,11 @@ #include #include "overo.h" +#ifdef CONFIG_USB_EHCI +#include +#include +#endif + DECLARE_GLOBAL_DATA_PTR; #define TWL4030_I2C_BUS 0 @@ -60,6 +67,17 @@ static struct { char env_setting[64]; } expansion_config = {0x0}; +static const struct ns16550_platdata overo_serial = { + OMAP34XX_UART3, + 2, + V_NS16550_CLK +}; + +U_BOOT_DEVICE(overo_uart) = { + "serial_omap", + &overo_serial +}; + /* * Routine: board_init * Description: Early hardware init. @@ -474,3 +492,39 @@ int board_mmc_init(bd_t *bis) return omap_mmc_init(0, 0, 0, -1, -1); } #endif + +#if defined(CONFIG_GENERIC_MMC) +void board_mmc_power_init(void) +{ + twl4030_power_mmc_init(0); +} +#endif + +#if defined(CONFIG_USB_EHCI) && !defined(CONFIG_SPL_BUILD) +static struct omap_usbhs_board_data usbhs_bdata = { + .port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, + .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED +}; + +#define GUMSTIX_GPIO_USBH_CPEN 168 +int ehci_hcd_init(int index, enum usb_init_type init, + struct ehci_hccr **hccr, struct ehci_hcor **hcor) +{ + /* Enable USB power */ + if (!gpio_request(GUMSTIX_GPIO_USBH_CPEN, "usbh_cpen")) + gpio_direction_output(GUMSTIX_GPIO_USBH_CPEN, 1); + + return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); +} + +int ehci_hcd_stop(void) +{ + /* Disable USB power */ + gpio_set_value(GUMSTIX_GPIO_USBH_CPEN, 0); + gpio_free(GUMSTIX_GPIO_USBH_CPEN); + + return omap_ehci_hcd_stop(); +} + +#endif /* CONFIG_USB_EHCI */