diff options
| author | Olof Johansson <olof@lixom.net> | 2013-06-14 20:36:30 -0400 |
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2013-06-14 20:36:30 -0400 |
| commit | a1149269646ae95c3985f5cf1c8a15b97bb30d8a (patch) | |
| tree | f56db201ab0328feec913d90b7b60fef7054065a | |
| parent | 5ae13ef4e1045d6ec5d445947b42c839b9731bec (diff) | |
| parent | 1a87b01d3b18709ae240ec90ae612354dd44d9a9 (diff) | |
Merge tag 'renesas-phy-rcar-usb-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
From Simon Horman:
Renesas USB updates for v3.11
These updates are by Sergei Shtylyov to clean-up USB support
present for R8A7779/Marzen and then extend USB support coverage to
R8A7778/BOCK-W.
* tag 'renesas-phy-rcar-usb-for-v3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: BOCK-W: add USB support
ARM: shmobile: r8a7778: add USB support
phy-rcar-usb: add R8A7778 support
phy-rcar-usb: handle platform data
ARM: shmobile: Marzen: pass platform data to USB PHY device
phy-rcar-usb: add platform data
phy-rcar-usb: correct base address
ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
phy-rcar-usb: remove EHCI internal buffer setup
ARM: shmobile: r8a7779: setup EHCI internal buffer
ehci-platform: add pre_setup() method to platform data
ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
Conflicts:
arch/arm/mach-shmobile/board-marzen.c
arch/arm/mach-shmobile/setup-r8a7778.c
Signed-off-by: Olof Johansson <olof@lixom.net>
| -rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 2 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/board-bockw.c | 8 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/board-marzen.c | 181 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7778.c | 4 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7778.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/include/mach/r8a7779.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7778.c | 108 | ||||
| -rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7779.c | 196 | ||||
| -rw-r--r-- | drivers/usb/host/ehci-platform.c | 6 | ||||
| -rw-r--r-- | drivers/usb/phy/Kconfig | 10 | ||||
| -rw-r--r-- | drivers/usb/phy/phy-rcar-usb.c | 128 | ||||
| -rw-r--r-- | include/linux/platform_data/usb-rcar-phy.h | 28 | ||||
| -rw-r--r-- | include/linux/usb/ehci_pdriver.h | 4 |
13 files changed, 450 insertions, 231 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 5414402938a5..757c4e97375f 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
| @@ -41,6 +41,8 @@ config ARCH_R8A7778 | |||
| 41 | select CPU_V7 | 41 | select CPU_V7 |
| 42 | select SH_CLK_CPG | 42 | select SH_CLK_CPG |
| 43 | select ARM_GIC | 43 | select ARM_GIC |
| 44 | select USB_ARCH_HAS_EHCI | ||
| 45 | select USB_ARCH_HAS_OHCI | ||
| 44 | 46 | ||
| 45 | config ARCH_R8A7779 | 47 | config ARCH_R8A7779 |
| 46 | bool "R-Car H1 (R8A77790)" | 48 | bool "R-Car H1 (R8A77790)" |
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c index dac4365c5158..7ed2401b899c 100644 --- a/arch/arm/mach-shmobile/board-bockw.c +++ b/arch/arm/mach-shmobile/board-bockw.c | |||
| @@ -38,12 +38,18 @@ static struct resource smsc911x_resources[] = { | |||
| 38 | DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ | 38 | DEFINE_RES_IRQ(irq_pin(0)), /* IRQ 0 */ |
| 39 | }; | 39 | }; |
| 40 | 40 | ||
| 41 | static struct rcar_phy_platform_data usb_phy_platform_data __initdata; | ||
| 42 | |||
| 41 | static const struct pinctrl_map bockw_pinctrl_map[] = { | 43 | static const struct pinctrl_map bockw_pinctrl_map[] = { |
| 42 | /* SCIF0 */ | 44 | /* SCIF0 */ |
| 43 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", | 45 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", |
| 44 | "scif0_data_a", "scif0"), | 46 | "scif0_data_a", "scif0"), |
| 45 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", | 47 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a7778", |
| 46 | "scif0_ctrl", "scif0"), | 48 | "scif0_ctrl", "scif0"), |
| 49 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778", | ||
| 50 | "usb0", "usb0"), | ||
| 51 | PIN_MAP_MUX_GROUP_DEFAULT("ehci-platform", "pfc-r8a7778", | ||
| 52 | "usb1", "usb1"), | ||
| 47 | }; | 53 | }; |
| 48 | 54 | ||
| 49 | #define IRQ0MR 0x30 | 55 | #define IRQ0MR 0x30 |
| @@ -54,6 +60,7 @@ static void __init bockw_init(void) | |||
| 54 | r8a7778_clock_init(); | 60 | r8a7778_clock_init(); |
| 55 | r8a7778_init_irq_extpin(1); | 61 | r8a7778_init_irq_extpin(1); |
| 56 | r8a7778_add_standard_devices(); | 62 | r8a7778_add_standard_devices(); |
| 63 | r8a7778_add_usb_phy_device(&usb_phy_platform_data); | ||
| 57 | 64 | ||
| 58 | pinctrl_register_mappings(bockw_pinctrl_map, | 65 | pinctrl_register_mappings(bockw_pinctrl_map, |
| 59 | ARRAY_SIZE(bockw_pinctrl_map)); | 66 | ARRAY_SIZE(bockw_pinctrl_map)); |
| @@ -91,4 +98,5 @@ DT_MACHINE_START(BOCKW_DT, "bockw") | |||
| 91 | .init_machine = bockw_init, | 98 | .init_machine = bockw_init, |
| 92 | .init_time = shmobile_timer_init, | 99 | .init_time = shmobile_timer_init, |
| 93 | .dt_compat = bockw_boards_compat_dt, | 100 | .dt_compat = bockw_boards_compat_dt, |
| 101 | .init_late = r8a7778_init_late, | ||
| 94 | MACHINE_END | 102 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index 9112faef923b..b1b41b199f99 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c | |||
| @@ -37,10 +37,6 @@ | |||
| 37 | #include <linux/mmc/host.h> | 37 | #include <linux/mmc/host.h> |
| 38 | #include <linux/mmc/sh_mobile_sdhi.h> | 38 | #include <linux/mmc/sh_mobile_sdhi.h> |
| 39 | #include <linux/mfd/tmio.h> | 39 | #include <linux/mfd/tmio.h> |
| 40 | #include <linux/usb/otg.h> | ||
| 41 | #include <linux/usb/ehci_pdriver.h> | ||
| 42 | #include <linux/usb/ohci_pdriver.h> | ||
| 43 | #include <linux/pm_runtime.h> | ||
| 44 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
| 45 | #include <mach/r8a7779.h> | 41 | #include <mach/r8a7779.h> |
| 46 | #include <mach/common.h> | 42 | #include <mach/common.h> |
| @@ -61,6 +57,8 @@ static struct regulator_consumer_supply dummy_supplies[] = { | |||
| 61 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | 57 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), |
| 62 | }; | 58 | }; |
| 63 | 59 | ||
| 60 | static struct rcar_phy_platform_data usb_phy_platform_data __initdata; | ||
| 61 | |||
| 64 | /* SMSC LAN89218 */ | 62 | /* SMSC LAN89218 */ |
| 65 | static struct resource smsc911x_resources[] = { | 63 | static struct resource smsc911x_resources[] = { |
| 66 | [0] = { | 64 | [0] = { |
| @@ -150,26 +148,6 @@ static struct platform_device hspi_device = { | |||
| 150 | .num_resources = ARRAY_SIZE(hspi_resources), | 148 | .num_resources = ARRAY_SIZE(hspi_resources), |
| 151 | }; | 149 | }; |
| 152 | 150 | ||
| 153 | /* USB PHY */ | ||
| 154 | static struct resource usb_phy_resources[] = { | ||
| 155 | [0] = { | ||
| 156 | .start = 0xffe70000, | ||
| 157 | .end = 0xffe70900 - 1, | ||
| 158 | .flags = IORESOURCE_MEM, | ||
| 159 | }, | ||
| 160 | [1] = { | ||
| 161 | .start = 0xfff70000, | ||
| 162 | .end = 0xfff70900 - 1, | ||
| 163 | .flags = IORESOURCE_MEM, | ||
| 164 | }, | ||
| 165 | }; | ||
| 166 | |||
| 167 | static struct platform_device usb_phy_device = { | ||
| 168 | .name = "rcar_usb_phy", | ||
| 169 | .resource = usb_phy_resources, | ||
| 170 | .num_resources = ARRAY_SIZE(usb_phy_resources), | ||
| 171 | }; | ||
| 172 | |||
| 173 | /* LEDS */ | 151 | /* LEDS */ |
| 174 | static struct gpio_led marzen_leds[] = { | 152 | static struct gpio_led marzen_leds[] = { |
| 175 | { | 153 | { |
| @@ -205,161 +183,9 @@ static struct platform_device *marzen_devices[] __initdata = { | |||
| 205 | &sdhi0_device, | 183 | &sdhi0_device, |
| 206 | &thermal_device, | 184 | &thermal_device, |
| 207 | &hspi_device, | 185 | &hspi_device, |
| 208 | &usb_phy_device, | ||
| 209 | &leds_device, | 186 | &leds_device, |
| 210 | }; | 187 | }; |
| 211 | 188 | ||
| 212 | /* USB */ | ||
| 213 | static struct usb_phy *phy; | ||
| 214 | static int usb_power_on(struct platform_device *pdev) | ||
| 215 | { | ||
| 216 | if (IS_ERR(phy)) | ||
| 217 | return PTR_ERR(phy); | ||
| 218 | |||
| 219 | pm_runtime_enable(&pdev->dev); | ||
| 220 | pm_runtime_get_sync(&pdev->dev); | ||
| 221 | |||
| 222 | usb_phy_init(phy); | ||
| 223 | |||
| 224 | return 0; | ||
| 225 | } | ||
| 226 | |||
| 227 | static void usb_power_off(struct platform_device *pdev) | ||
| 228 | { | ||
| 229 | if (IS_ERR(phy)) | ||
| 230 | return; | ||
| 231 | |||
| 232 | usb_phy_shutdown(phy); | ||
| 233 | |||
| 234 | pm_runtime_put_sync(&pdev->dev); | ||
| 235 | pm_runtime_disable(&pdev->dev); | ||
| 236 | } | ||
| 237 | |||
| 238 | static struct usb_ehci_pdata ehcix_pdata = { | ||
| 239 | .power_on = usb_power_on, | ||
| 240 | .power_off = usb_power_off, | ||
| 241 | .power_suspend = usb_power_off, | ||
| 242 | }; | ||
| 243 | |||
| 244 | static struct resource ehci0_resources[] = { | ||
| 245 | [0] = { | ||
| 246 | .start = 0xffe70000, | ||
| 247 | .end = 0xffe70400 - 1, | ||
| 248 | .flags = IORESOURCE_MEM, | ||
| 249 | }, | ||
| 250 | [1] = { | ||
| 251 | .start = gic_iid(0x4c), | ||
| 252 | .flags = IORESOURCE_IRQ, | ||
| 253 | }, | ||
