From e9d340ad29738e19a604c03c36c6df661b6a4239 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Tue, 4 Dec 2012 22:45:11 +0100 Subject: colibri_t30: USB: integrate Ethernet initialisation Integrate proper Ethernet initialisation analogous to how it is done for the Colibri T20. --- arch/arm/mach-tegra/board-colibri_t30.c | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'arch') diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c index 633068aa1bbc..2741f2153c00 100644 --- a/arch/arm/mach-tegra/board-colibri_t30.c +++ b/arch/arm/mach-tegra/board-colibri_t30.c @@ -587,9 +587,35 @@ static struct tegra_usb_platform_data tegra_ehci1_utmi_pdata = { }, }; +static void ehci2_utmi_platform_post_phy_on(void) +{ + /* enable VBUS */ + gpio_set_value(ETHERNET_VBUS_GPIO, 1); + + /* reset */ + gpio_set_value(ETHERNET_RESET_GPIO, 0); + + udelay(5); + + /* unreset */ + gpio_set_value(ETHERNET_RESET_GPIO, 1); +} + +static void ehci2_utmi_platform_pre_phy_off(void) +{ + /* disable VBUS */ + gpio_set_value(ETHERNET_VBUS_GPIO, 0); +} + +static struct tegra_usb_phy_platform_ops ehci2_utmi_plat_ops = { + .post_phy_on = ehci2_utmi_platform_post_phy_on, + .pre_phy_off = ehci2_utmi_platform_pre_phy_off, +}; + static struct tegra_usb_platform_data tegra_ehci2_utmi_pdata = { .has_hostpc = true, .op_mode = TEGRA_USB_OPMODE_HOST, + .ops = &ehci2_utmi_plat_ops, .phy_intf = TEGRA_USB_PHY_INTF_UTMI, .port_otg = false, .u_cfg.utmi = { @@ -712,6 +738,14 @@ struct platform_device colibri_otg_device = { static void colibri_t30_usb_init(void) { + gpio_request(ETHERNET_VBUS_GPIO, "LAN_V_BUS"); + gpio_direction_output(ETHERNET_VBUS_GPIO, 0); + gpio_export(ETHERNET_VBUS_GPIO, false); + + gpio_request(ETHERNET_RESET_GPIO, "LAN_RESET"); + gpio_direction_output(ETHERNET_RESET_GPIO, 0); + gpio_export(ETHERNET_RESET_GPIO, false); + /* OTG should be the first to be registered EHCI instance 0: USB1_DP/N -> USBOTG_P/N */ #ifndef CONFIG_USB_TEGRA_OTG -- cgit v1.2.3