From 24d01a89348ca52dd123c1ccb04cede1450fdb22 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Thu, 18 Aug 2011 10:34:21 -0500 Subject: [PATCH] add patch to have usb on tegra boards initialise correctly build in usb-storage on tegra systems --- TEGRA-2.6.40.2-enable-USB-ports.patch | 111 ++++++++++++++++++++++++++ config-arm-tegra | 1 + kernel.spec | 7 ++ 3 files changed, 119 insertions(+) create mode 100644 TEGRA-2.6.40.2-enable-USB-ports.patch diff --git a/TEGRA-2.6.40.2-enable-USB-ports.patch b/TEGRA-2.6.40.2-enable-USB-ports.patch new file mode 100644 index 000000000..1fef5fec2 --- /dev/null +++ b/TEGRA-2.6.40.2-enable-USB-ports.patch @@ -0,0 +1,111 @@ +--- linux-2.6.39.armv7l/arch/arm/mach-tegra/board-trimslice-pinmux.c.TEGRA 2011-05-19 00:06:34.000000000 -0400 ++++ linux-2.6.39.armv7l/arch/arm/mach-tegra/board-trimslice-pinmux.c 2011-08-16 01:16:35.194157025 -0400 +@@ -126,7 +126,7 @@ + {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, + {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, + {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, +- {TEGRA_PINGROUP_UAC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, ++ {TEGRA_PINGROUP_UAC, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, + {TEGRA_PINGROUP_UAD, TEGRA_MUX_IRDA, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, + {TEGRA_PINGROUP_UCA, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, + {TEGRA_PINGROUP_UCB, TEGRA_MUX_UARTC, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, +--- linux-2.6.39.armv7l/arch/arm/mach-tegra/board-trimslice.c.TEGRA 2011-05-19 00:06:34.000000000 -0400 ++++ linux-2.6.39.armv7l/arch/arm/mach-tegra/board-trimslice.c 2011-08-16 01:25:44.679159239 -0400 +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -30,6 +31,8 @@ + + #include + #include ++#include ++#include + + #include "board.h" + #include "clock.h" +@@ -102,6 +105,68 @@ + } + subsys_initcall(tegra_trimslice_pci_init); + ++static struct tegra_utmip_config utmi_phy_config[] = { ++ [0] = { ++ .hssync_start_delay = 0, ++ .idle_wait_delay = 17, ++ .elastic_limit = 16, ++ .term_range_adj = 6, ++ .xcvr_setup = 15, ++ .xcvr_lsfslew = 2, ++ .xcvr_lsrslew = 2, ++ }, ++ [1] = { ++ .hssync_start_delay = 0, ++ .idle_wait_delay = 17, ++ .elastic_limit = 16, ++ .term_range_adj = 6, ++ .xcvr_setup = 8, ++ .xcvr_lsfslew = 2, ++ .xcvr_lsrslew = 2, ++ }, ++}; ++ ++static struct tegra_ehci_platform_data ehci1_data = { ++ .phy_config = &utmi_phy_config[0], ++ .operating_mode = TEGRA_USB_HOST, ++ .power_down_on_bus_suspend = 0, ++}; ++ ++struct tegra_ulpi_config ehci2_phy_config = { ++ .reset_gpio = TEGRA_GPIO_PV0, ++ .clk = "pll_m", ++}; ++ ++static struct tegra_ehci_platform_data ehci2_data = { ++ .operating_mode = TEGRA_USB_HOST, ++ .phy_config = &ehci2_phy_config, ++ .power_down_on_bus_suspend = 0, ++}; ++ ++static struct tegra_ehci_platform_data ehci3_data = { ++ .phy_config = &utmi_phy_config[1], ++ .operating_mode = TEGRA_USB_HOST, ++ .power_down_on_bus_suspend = 0, ++}; ++ ++static void trimslice_usb_init(void) ++{ ++ tegra_ehci3_device.dev.platform_data = &ehci3_data; ++ platform_device_register(&tegra_ehci3_device); ++ ++ tegra_gpio_enable(TEGRA_GPIO_PV0); ++ tegra_ehci2_device.dev.platform_data = &ehci2_data; ++ platform_device_register(&tegra_ehci2_device); ++ ++ tegra_gpio_enable(TEGRA_GPIO_PV2); ++ gpio_request(TEGRA_GPIO_PV2, "usb1 mode"); ++ gpio_direction_output(TEGRA_GPIO_PV2, 1); ++ ++ tegra_ehci1_device.dev.platform_data = &ehci1_data; ++ platform_device_register(&tegra_ehci1_device); ++} ++ ++ + static void __init tegra_trimslice_init(void) + { + tegra_clk_init_from_table(trimslice_clk_init_table); +@@ -112,8 +177,11 @@ + tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4; + + platform_add_devices(trimslice_devices, ARRAY_SIZE(trimslice_devices)); ++ ++ trimslice_usb_init(); + } + ++ + MACHINE_START(TRIMSLICE, "trimslice") + .boot_params = 0x00000100, + .fixup = tegra_trimslice_fixup, diff --git a/config-arm-tegra b/config-arm-tegra index c79efcf5b..67f1e3839 100644 --- a/config-arm-tegra +++ b/config-arm-tegra @@ -49,6 +49,7 @@ CONFIG_HW_PERF_EVENTS=y CONFIG_KEYBOARD_TEGRA=y # CONFIG_MPCORE_WATCHDOG is not set CONFIG_USB_EHCI_TEGRA=y +CONFIG_USB_STORAGE=y CONFIG_RTC_DRV_TEGRA=m CONFIG_SND_SOC_TEGRA=m diff --git a/kernel.spec b/kernel.spec index 81e2aa523..a6a04d8d7 100644 --- a/kernel.spec +++ b/kernel.spec @@ -694,6 +694,8 @@ Patch21001: arm-smsc-support-reading-mac-address-from-device-tree.patch # patch from http://www.delorie.com/tmp/arm-readl.patch Patch21002: arm-readl.patch +Patch21003: TEGRA-2.6.40.2-enable-USB-ports.patch + %endif BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root @@ -1135,6 +1137,7 @@ ApplyPatch linux-2.6.29-sparc-IOC_TYPECHECK.patch ApplyPatch arm-omap-dt-compat.patch ApplyPatch arm-smsc-support-reading-mac-address-from-device-tree.patch ApplyPatch arm-readl.patch +ApplyPatch TEGRA-2.6.40.2-enable-USB-ports.patch # # Exec shield @@ -1890,6 +1893,10 @@ fi # and build. %changelog +* Wed Aug 17 2011 Dennis Gilmore +- add patch to correctly initialise usb on trimslice systems +- build in usb-storage on tegra, internal ssd on trimslice is connected to usb + * Tue Aug 16 2011 Dennis Gilmore - add patch to work around gcc bug on arm