summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-12-04 22:45:11 +0100
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2012-12-04 22:45:11 +0100
commite9d340ad29738e19a604c03c36c6df661b6a4239 (patch)
treeb098f75dd6c3ba889c8c0ffc5b894a08c92e79ab /arch
parent615a177885702bd98c00c27d28fa2e661a58af5b (diff)
colibri_t30: USB: integrate Ethernet initialisation
Integrate proper Ethernet initialisation analogous to how it is done for the Colibri T20.
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-colibri_t30.c34
1 files changed, 34 insertions, 0 deletions
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