* [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code
@ 2013-06-01 21:28 Sergei Shtylyov
2013-06-01 21:30 ` [PATCH v8 1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code Sergei Shtylyov
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-01 21:28 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
'renesas-next-20130528' tag. It was created to fix the shortcomings in the
R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
to touch both subtrees). The patches were conceived with the complete
bisectability goal in mind.
[1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
[2/9] ehci-platform: add pre_setup() method to platform data
[3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
[4/9] phy-rcar-usb: remove EHCI internal buffer setup
[5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
[6/9] phy-rcar-usb: correct base address
[7/9] phy-rcar-usb: add platform data
[8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
[9/9] phy-rcar-usb: handle platform data
The patchset is completely ready to be merged now.
WBR, Sergei
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
@ 2013-06-01 21:30 ` Sergei Shtylyov
2013-06-01 21:37 ` [PATCH v8 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer Sergei Shtylyov
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-01 21:30 UTC (permalink / raw)
To: linux-arm-kernel
USB EHCI, OHCI, and common PHY are the SoC devices but are wrongly defined and
registered in the Marzen board file. Move the data and code to their proper
place in setup-r8a7779.c; while at it, we have to rename r8a7779_late_devices[]
to r8a7779_standard_devices[] -- this seems legitimate since they are registered
from r8a7779_add_standard_devices() anyway.
Note that I'm deliberately changing the USB PHY platform device's 'id' field
from (previously just omitted) 0 to -1 as the device is a single of its kind.
Note also that the board and SoC code have to be in one patch to keep the code
bisectable...
The patch has been tested on the Marzen board.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
Changes since version 7:
- resolved reject, changed PHY checks to IS_ERR(phy) and returning PTR_ERR(phy)
where applicable.
Changes since version 5:
- fixed typos in the changelog.
Changes since version 4:
- resolved reject in the 'board-marzen.c' file, refreshed the patch.
Changes since version 3:
- refreshed the 'board-marzen.c' file.
Changes since version 2:
- added a note about testing to the changelog;
- added ACKs from Simon Horman and Kuninori Morimoto.
Changes since the original posting:
- added a note about bisectability to the changelog.
arch/arm/mach-shmobile/board-marzen.c | 178 -------------------------
arch/arm/mach-shmobile/include/mach/r8a7779.h | 1
arch/arm/mach-shmobile/setup-r8a7779.c | 185 +++++++++++++++++++++++++-
3 files changed, 184 insertions(+), 180 deletions(-)
Index: renesas/arch/arm/mach-shmobile/board-marzen.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/board-marzen.c
+++ renesas/arch/arm/mach-shmobile/board-marzen.c
@@ -37,10 +37,6 @@
#include <linux/mmc/host.h>
#include <linux/mmc/sh_mobile_sdhi.h>
#include <linux/mfd/tmio.h>
-#include <linux/usb/otg.h>
-#include <linux/usb/ehci_pdriver.h>
-#include <linux/usb/ohci_pdriver.h>
-#include <linux/pm_runtime.h>
#include <mach/hardware.h>
#include <mach/r8a7779.h>
#include <mach/common.h>
@@ -150,26 +146,6 @@ static struct platform_device hspi_devic
.num_resources = ARRAY_SIZE(hspi_resources),
};
-/* USB PHY */
-static struct resource usb_phy_resources[] = {
- [0] = {
- .start = 0xffe70000,
- .end = 0xffe70900 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = 0xfff70000,
- .end = 0xfff70900 - 1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device usb_phy_device = {
- .name = "rcar_usb_phy",
- .resource = usb_phy_resources,
- .num_resources = ARRAY_SIZE(usb_phy_resources),
-};
-
/* LEDS */
static struct gpio_led marzen_leds[] = {
{
@@ -205,161 +181,9 @@ static struct platform_device *marzen_de
&sdhi0_device,
&thermal_device,
&hspi_device,
- &usb_phy_device,
&leds_device,
};
-/* USB */
-static struct usb_phy *phy;
-static int usb_power_on(struct platform_device *pdev)
-{
- if (IS_ERR(phy))
- return PTR_ERR(phy);
-
- pm_runtime_enable(&pdev->dev);
- pm_runtime_get_sync(&pdev->dev);
-
- usb_phy_init(phy);
-
- return 0;
-}
-
-static void usb_power_off(struct platform_device *pdev)
-{
- if (IS_ERR(phy))
- return;
-
- usb_phy_shutdown(phy);
-
- pm_runtime_put_sync(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
-}
-
-static struct usb_ehci_pdata ehcix_pdata = {
- .power_on = usb_power_on,
- .power_off = usb_power_off,
- .power_suspend = usb_power_off,
-};
-
-static struct resource ehci0_resources[] = {
- [0] = {
- .start = 0xffe70000,
- .end = 0xffe70400 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = gic_iid(0x4c),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ehci0_device = {
- .name = "ehci-platform",
- .id = 0,
- .dev = {
- .dma_mask = &ehci0_device.dev.coherent_dma_mask,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &ehcix_pdata,
- },
- .num_resources = ARRAY_SIZE(ehci0_resources),
- .resource = ehci0_resources,
-};
-
-static struct resource ehci1_resources[] = {
- [0] = {
- .start = 0xfff70000,
- .end = 0xfff70400 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = gic_iid(0x4d),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ehci1_device = {
- .name = "ehci-platform",
- .id = 1,
- .dev = {
- .dma_mask = &ehci1_device.dev.coherent_dma_mask,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &ehcix_pdata,
- },
- .num_resources = ARRAY_SIZE(ehci1_resources),
- .resource = ehci1_resources,
-};
-
-static struct usb_ohci_pdata ohcix_pdata = {
- .power_on = usb_power_on,
- .power_off = usb_power_off,
- .power_suspend = usb_power_off,
-};
-
-static struct resource ohci0_resources[] = {
- [0] = {
- .start = 0xffe70400,
- .end = 0xffe70800 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = gic_iid(0x4c),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ohci0_device = {
- .name = "ohci-platform",
- .id = 0,
- .dev = {
- .dma_mask = &ohci0_device.dev.coherent_dma_mask,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &ohcix_pdata,
- },
- .num_resources = ARRAY_SIZE(ohci0_resources),
- .resource = ohci0_resources,
-};
-
-static struct resource ohci1_resources[] = {
- [0] = {
- .start = 0xfff70400,
- .end = 0xfff70800 - 1,
- .flags = IORESOURCE_MEM,
- },
- [1] = {
- .start = gic_iid(0x4d),
- .flags = IORESOURCE_IRQ,
- },
-};
-
-static struct platform_device ohci1_device = {
- .name = "ohci-platform",
- .id = 1,
- .dev = {
- .dma_mask = &ohci1_device.dev.coherent_dma_mask,
- .coherent_dma_mask = 0xffffffff,
- .platform_data = &ohcix_pdata,
- },
- .num_resources = ARRAY_SIZE(ohci1_resources),
- .resource = ohci1_resources,
-};
-
-static struct platform_device *marzen_late_devices[] __initdata = {
- &ehci0_device,
- &ehci1_device,
- &ohci0_device,
- &ohci1_device,
-};
-
-static void __init marzen_init_late(void)
-{
- /* get usb phy */
- phy = usb_get_phy(USB_PHY_TYPE_USB2);
-
- shmobile_init_late();
- platform_add_devices(marzen_late_devices,
- ARRAY_SIZE(marzen_late_devices));
-}
-
static const struct pinctrl_map marzen_pinctrl_map[] = {
/* HSPI0 */
PIN_MAP_MUX_GROUP_DEFAULT("sh-hspi.0", "pfc-r8a7779",
@@ -418,6 +242,6 @@ MACHINE_START(MARZEN, "marzen")
.nr_irqs = NR_IRQS_LEGACY,
.init_irq = r8a7779_init_irq,
.init_machine = marzen_init,
- .init_late = marzen_init_late,
+ .init_late = r8a7779_init_late,
.init_time = r8a7779_earlytimer_init,
MACHINE_END
Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -33,6 +33,7 @@ extern void r8a7779_add_early_devices(vo
extern void r8a7779_add_standard_devices(void);
extern void r8a7779_add_standard_devices_dt(void);
extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
+extern void r8a7779_init_late(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
extern void r8a7779_pm_init(void);
Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -32,6 +32,10 @@
#include <linux/sh_intc.h>
#include <linux/sh_timer.h>
#include <linux/dma-mapping.h>
+#include <linux/usb/otg.h>
+#include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
+#include <linux/pm_runtime.h>
#include <mach/hardware.h>
#include <mach/irqs.h>
#include <mach/r8a7779.h>
@@ -383,6 +387,162 @@ static struct platform_device sata_devic
},
};
+/* USB PHY */
+static struct resource usb_phy_resources[] = {
+ [0] = {
+ .start = 0xffe70000,
+ .end = 0xffe70900 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = 0xfff70000,
+ .end = 0xfff70900 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+};
+
+static struct platform_device usb_phy_device = {
+ .name = "rcar_usb_phy",
+ .id = -1,
+ .resource = usb_phy_resources,
+ .num_resources = ARRAY_SIZE(usb_phy_resources),
+};
+
+/* USB */
+static struct usb_phy *phy;
+
+static int usb_power_on(struct platform_device *pdev)
+{
+ if (IS_ERR(phy))
+ return PTR_ERR(phy);
+
+ pm_runtime_enable(&pdev->dev);
+ pm_runtime_get_sync(&pdev->dev);
+
+ usb_phy_init(phy);
+
+ return 0;
+}
+
+static void usb_power_off(struct platform_device *pdev)
+{
+ if (IS_ERR(phy))
+ return;
+
+ usb_phy_shutdown(phy);
+
+ pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+}
+
+static struct usb_ehci_pdata ehcix_pdata = {
+ .power_on = usb_power_on,
+ .power_off = usb_power_off,
+ .power_suspend = usb_power_off,
+};
+
+static struct resource ehci0_resources[] = {
+ [0] = {
+ .start = 0xffe70000,
+ .end = 0xffe70400 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = gic_iid(0x4c),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ehci0_device = {
+ .name = "ehci-platform",
+ .id = 0,
+ .dev = {
+ .dma_mask = &ehci0_device.dev.coherent_dma_mask,
+ .coherent_dma_mask = 0xffffffff,
+ .platform_data = &ehcix_pdata,
+ },
+ .num_resources = ARRAY_SIZE(ehci0_resources),
+ .resource = ehci0_resources,
+};
+
+static struct resource ehci1_resources[] = {
+ [0] = {
+ .start = 0xfff70000,
+ .end = 0xfff70400 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = gic_iid(0x4d),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ehci1_device = {
+ .name = "ehci-platform",
+ .id = 1,
+ .dev = {
+ .dma_mask = &ehci1_device.dev.coherent_dma_mask,
+ .coherent_dma_mask = 0xffffffff,
+ .platform_data = &ehcix_pdata,
+ },
+ .num_resources = ARRAY_SIZE(ehci1_resources),
+ .resource = ehci1_resources,
+};
+
+static struct usb_ohci_pdata ohcix_pdata = {
+ .power_on = usb_power_on,
+ .power_off = usb_power_off,
+ .power_suspend = usb_power_off,
+};
+
+static struct resource ohci0_resources[] = {
+ [0] = {
+ .start = 0xffe70400,
+ .end = 0xffe70800 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = gic_iid(0x4c),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ohci0_device = {
+ .name = "ohci-platform",
+ .id = 0,
+ .dev = {
+ .dma_mask = &ohci0_device.dev.coherent_dma_mask,
+ .coherent_dma_mask = 0xffffffff,
+ .platform_data = &ohcix_pdata,
+ },
+ .num_resources = ARRAY_SIZE(ohci0_resources),
+ .resource = ohci0_resources,
+};
+
+static struct resource ohci1_resources[] = {
+ [0] = {
+ .start = 0xfff70400,
+ .end = 0xfff70800 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ [1] = {
+ .start = gic_iid(0x4d),
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct platform_device ohci1_device = {
+ .name = "ohci-platform",
+ .id = 1,
+ .dev = {
+ .dma_mask = &ohci1_device.dev.coherent_dma_mask,
+ .coherent_dma_mask = 0xffffffff,
+ .platform_data = &ohcix_pdata,
+ },
+ .num_resources = ARRAY_SIZE(ohci1_resources),
+ .resource = ohci1_resources,
+};
+
/* Ether */
static struct resource ether_resources[] = {
{
@@ -404,9 +564,10 @@ static struct platform_device *r8a7779_d
&scif5_device,
&tmu00_device,
&tmu01_device,
+ &usb_phy_device,
};
-static struct platform_device *r8a7779_late_devices[] __initdata = {
+static struct platform_device *r8a7779_standard_devices[] __initdata = {
&i2c0_device,
&i2c1_device,
&i2c2_device,
@@ -426,8 +587,8 @@ void __init r8a7779_add_standard_devices
platform_add_devices(r8a7779_devices_dt,
ARRAY_SIZE(r8a7779_devices_dt));
- platform_add_devices(r8a7779_late_devices,
- ARRAY_SIZE(r8a7779_late_devices));
+ platform_add_devices(r8a7779_standard_devices,
+ ARRAY_SIZE(r8a7779_standard_devices));
}
void __init r8a7779_add_ether_device(struct sh_eth_plat_data *pdata)
@@ -470,6 +631,23 @@ void __init r8a7779_add_early_devices(vo
*/
}
+static struct platform_device *r8a7779_late_devices[] __initdata = {
+ &ehci0_device,
+ &ehci1_device,
+ &ohci0_device,
+ &ohci1_device,
+};
+
+void __init r8a7779_init_late(void)
+{
+ /* get USB PHY */
+ phy = usb_get_phy(USB_PHY_TYPE_USB2);
+
+ shmobile_init_late();
+ platform_add_devices(r8a7779_late_devices,
+ ARRAY_SIZE(r8a7779_late_devices));
+}
+
#ifdef CONFIG_USE_OF
void __init r8a7779_init_delay(void)
{
@@ -503,6 +681,7 @@ DT_MACHINE_START(R8A7779_DT, "Generic R8
.init_irq = r8a7779_init_irq_dt,
.init_machine = r8a7779_add_standard_devices_dt,
.init_time = shmobile_timer_init,
+ .init_late = r8a7779_init_late,
.dt_compat = r8a7779_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
2013-06-01 21:30 ` [PATCH v8 1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code Sergei Shtylyov
@ 2013-06-01 21:37 ` Sergei Shtylyov
2013-06-01 21:48 ` [PATCH v8 5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource Sergei Shtylyov
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-01 21:37 UTC (permalink / raw)
To: linux-arm-kernel
Setup the EHCI internal buffer (before EHCI driver has a chance to touch the
registers) using the pre_setup() method in 'struct usb_ehci_pdata'.
The patch has been tested on the Marzen board.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
Changes since version 4:
- refreshed the patch.
Changes since version 3:
- lowercased the SoC name in the subject.
Changes since version 2:
- added #include <linux/usb/hcd.h>;
- added a note about testing to the changelog;
- added ACKs from Simon Horman and Kuninori Morimoto.
Changes since the original posting:
- changed from init() platform device method to pre_setup() as per the previous
patch.
arch/arm/mach-shmobile/setup-r8a7779.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -33,6 +33,7 @@
#include <linux/sh_timer.h>
#include <linux/dma-mapping.h>
#include <linux/usb/otg.h>
+#include <linux/usb/hcd.h>
#include <linux/usb/ehci_pdriver.h>
#include <linux/usb/ohci_pdriver.h>
#include <linux/pm_runtime.h>
@@ -435,10 +436,25 @@ static void usb_power_off(struct platfor
pm_runtime_disable(&pdev->dev);
}
+static int ehci_init_internal_buffer(struct usb_hcd *hcd)
+{
+ /*
+ * Below are recommended values from the datasheet;
+ * see [USB :: Setting of EHCI Internal Buffer].
+ */
+ /* EHCI IP internal buffer setting */
+ iowrite32(0x00ff0040, hcd->regs + 0x0094);
+ /* EHCI IP internal buffer enable */
+ iowrite32(0x00000001, hcd->regs + 0x009C);
+
+ return 0;
+}
+
static struct usb_ehci_pdata ehcix_pdata = {
.power_on = usb_power_on,
.power_off = usb_power_off,
.power_suspend = usb_power_off,
+ .pre_setup = ehci_init_internal_buffer,
};
static struct resource ehci0_resources[] = {
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
2013-06-01 21:30 ` [PATCH v8 1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code Sergei Shtylyov
2013-06-01 21:37 ` [PATCH v8 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer Sergei Shtylyov
@ 2013-06-01 21:48 ` Sergei Shtylyov
2013-06-01 21:55 ` [PATCH v8 8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device Sergei Shtylyov
2013-06-07 8:06 ` [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Simon Horman
4 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-01 21:48 UTC (permalink / raw)
To: linux-arm-kernel
Now that 'drivers/usb/phy/phy-rcar-usb.c' doesn't require the second memory
resource anymore, we can remove it from the R8A7779's USB PHY platform device.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
Changes since version 7:
- updated the driver file name in the changelog.
Changes since version 4:
- refreshed the patch.
Changes since version 3:
- lowercased the SoC name in the subject.
Changes since version 2:
- refreshed atop of the prior patches;
- added a note about testing to the changelog;
- added ACKs from Simon Horman and Kuninori Morimoto.
Changes since the original posting:
- new patch in this version, split from the previous one.
arch/arm/mach-shmobile/setup-r8a7779.c | 5 -----
1 file changed, 5 deletions(-)
Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -395,11 +395,6 @@ static struct resource usb_phy_resources
.end = 0xffe70900 - 1,
.flags = IORESOURCE_MEM,
},
- [1] = {
- .start = 0xfff70000,
- .end = 0xfff70900 - 1,
- .flags = IORESOURCE_MEM,
- },
};
static struct platform_device usb_phy_device = {
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
` (2 preceding siblings ...)
2013-06-01 21:48 ` [PATCH v8 5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource Sergei Shtylyov
@ 2013-06-01 21:55 ` Sergei Shtylyov
2013-06-07 8:06 ` [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Simon Horman
4 siblings, 0 replies; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-01 21:55 UTC (permalink / raw)
To: linux-arm-kernel
Since we're now going to setup the USBPCTRL0 register using the USB PHY device's
platform data, we now need a way to pass those platform data from the board file
to the device which is situated in setup-r8a7779.c -- and what I'm suggesting is
r8a7779_add_usb_phy_device() that will register USB PHY platform device with the
passed platform data using platform_device_register_resndata() call; creating
this function involves deletion of 'usb_phy_device' from r8a7779_devices_dt[],
so that it will no longer be registered for the generic R8A7779 machine (where
we can't provide the platform data anyway), hence EHCI/OHCI drivers will fail
to load as well.
For the Marzen board, this new function will be called from marzen_init() to
register the USB PHY device early enough.
Note that the board and the SoC code have to be in one patch to keep the code
bisectable...
The patch has been tested on the Marzen board.
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
---
Changes since version 6:
- renamed the R-Car PHY driver header file in #include.
Changes since version 5:
- annotated USB PHY resources and platform data as '__initdata' since they're
kmemdup()'ed while registering the platform device anyway;
- fixed typo in the changelog.
Changes since version 4:
- refreshed the patch.
Changes since version 3:
- removed the initializer for 'usb_phy_platform_data';
- refreshed the 'board-marzen.c' file.
Changes since version 2:
- refreshed atop of the prior patches;
- added a note about testing to the changelog;
- added ACKs from Simon Horman and Kuninori Morimoto.
Changes since the original posting:
- added a note about bisectability to the changelog.
arch/arm/mach-shmobile/board-marzen.c | 3 +++
arch/arm/mach-shmobile/include/mach/r8a7779.h | 2 ++
arch/arm/mach-shmobile/setup-r8a7779.c | 18 +++++++++---------
3 files changed, 14 insertions(+), 9 deletions(-)
Index: renesas/arch/arm/mach-shmobile/board-marzen.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/board-marzen.c
+++ renesas/arch/arm/mach-shmobile/board-marzen.c
@@ -57,6 +57,8 @@ static struct regulator_consumer_supply
REGULATOR_SUPPLY("vdd33a", "smsc911x"),
};
+static struct rcar_phy_platform_data usb_phy_platform_data __initdata;
+
/* SMSC LAN89218 */
static struct resource smsc911x_resources[] = {
[0] = {
@@ -232,6 +234,7 @@ static void __init marzen_init(void)
r8a7779_init_irq_extpin(1); /* IRQ1 as individual interrupt */
r8a7779_add_standard_devices();
+ r8a7779_add_usb_phy_device(&usb_phy_platform_data);
platform_add_devices(marzen_devices, ARRAY_SIZE(marzen_devices));
}
Index: renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/include/mach/r8a7779.h
+++ renesas/arch/arm/mach-shmobile/include/mach/r8a7779.h
@@ -4,6 +4,7 @@
#include <linux/sh_clk.h>
#include <linux/pm_domain.h>
#include <linux/sh_eth.h>
+#include <linux/platform_data/usb-rcar-phy.h>
struct platform_device;
@@ -33,6 +34,7 @@ extern void r8a7779_add_early_devices(vo
extern void r8a7779_add_standard_devices(void);
extern void r8a7779_add_standard_devices_dt(void);
extern void r8a7779_add_ether_device(struct sh_eth_plat_data *pdata);
+extern void r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata);
extern void r8a7779_init_late(void);
extern void r8a7779_clock_init(void);
extern void r8a7779_pinmux_init(void);
Index: renesas/arch/arm/mach-shmobile/setup-r8a7779.c
===================================================================
--- renesas.orig/arch/arm/mach-shmobile/setup-r8a7779.c
+++ renesas/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -389,7 +389,7 @@ static struct platform_device sata_devic
};
/* USB PHY */
-static struct resource usb_phy_resources[] = {
+static struct resource usb_phy_resources[] __initdata = {
[0] = {
.start = 0xffe70800,
.end = 0xffe70900 - 1,
@@ -397,13 +397,6 @@ static struct resource usb_phy_resources
},
};
-static struct platform_device usb_phy_device = {
- .name = "rcar_usb_phy",
- .id = -1,
- .resource = usb_phy_resources,
- .num_resources = ARRAY_SIZE(usb_phy_resources),
-};
-
/* USB */
static struct usb_phy *phy;
@@ -575,7 +568,6 @@ static struct platform_device *r8a7779_d
&scif5_device,
&tmu00_device,
&tmu01_device,
- &usb_phy_device,
};
static struct platform_device *r8a7779_standard_devices[] __initdata = {
@@ -610,6 +602,14 @@ void __init r8a7779_add_ether_device(str
pdata, sizeof(*pdata));
}
+void __init r8a7779_add_usb_phy_device(struct rcar_phy_platform_data *pdata)
+{
+ platform_device_register_resndata(&platform_bus, "rcar_usb_phy", -1,
+ usb_phy_resources,
+ ARRAY_SIZE(usb_phy_resources),
+ pdata, sizeof(*pdata));
+}
+
/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */
void __init __weak r8a7779_register_twd(void) { }
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
` (3 preceding siblings ...)
2013-06-01 21:55 ` [PATCH v8 8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device Sergei Shtylyov
@ 2013-06-07 8:06 ` Simon Horman
2013-06-07 10:45 ` Sergei Shtylyov
4 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2013-06-07 8:06 UTC (permalink / raw)
To: linux-arm-kernel
On Sun, Jun 02, 2013 at 01:28:05AM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
> 'renesas-next-20130528' tag. It was created to fix the shortcomings in the
> R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
> spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
> to touch both subtrees). The patches were conceived with the complete
> bisectability goal in mind.
>
> [1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
> [2/9] ehci-platform: add pre_setup() method to platform data
> [3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
> [4/9] phy-rcar-usb: remove EHCI internal buffer setup
> [5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
> [6/9] phy-rcar-usb: correct base address
> [7/9] phy-rcar-usb: add platform data
> [8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
> [9/9] phy-rcar-usb: handle platform data
>
> The patchset is completely ready to be merged now.
Can I confirm that the plan is for me to merge this code?
If so, I should be able to do so next week.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code
2013-06-07 8:06 ` [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Simon Horman
@ 2013-06-07 10:45 ` Sergei Shtylyov
2013-06-11 7:49 ` Simon Horman
0 siblings, 1 reply; 9+ messages in thread
From: Sergei Shtylyov @ 2013-06-07 10:45 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 07-06-2013 12:06, Simon Horman wrote:
>> Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
>> 'renesas-next-20130528' tag. It was created to fix the shortcomings in the
>> R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
>> spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
>> to touch both subtrees). The patches were conceived with the complete
>> bisectability goal in mind.
>> [1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
>> [2/9] ehci-platform: add pre_setup() method to platform data
>> [3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
>> [4/9] phy-rcar-usb: remove EHCI internal buffer setup
>> [5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
>> [6/9] phy-rcar-usb: correct base address
>> [7/9] phy-rcar-usb: add platform data
>> [8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
>> [9/9] phy-rcar-usb: handle platform data
>> The patchset is completely ready to be merged now.
> Can I confirm that the plan is for me to merge this code?
Yes, that was the plan.
> If so, I should be able to do so next week.
WBR, Sergei
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code
2013-06-07 10:45 ` Sergei Shtylyov
@ 2013-06-11 7:49 ` Simon Horman
2013-06-11 7:56 ` Simon Horman
0 siblings, 1 reply; 9+ messages in thread
From: Simon Horman @ 2013-06-11 7:49 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Jun 07, 2013 at 02:45:45PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 07-06-2013 12:06, Simon Horman wrote:
>
> >> Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
> >>'renesas-next-20130528' tag. It was created to fix the shortcomings in the
> >>R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
> >>spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
> >>to touch both subtrees). The patches were conceived with the complete
> >>bisectability goal in mind.
>
> >>[1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
> >>[2/9] ehci-platform: add pre_setup() method to platform data
> >>[3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
> >>[4/9] phy-rcar-usb: remove EHCI internal buffer setup
> >>[5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
> >>[6/9] phy-rcar-usb: correct base address
> >>[7/9] phy-rcar-usb: add platform data
> >>[8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
> >>[9/9] phy-rcar-usb: handle platform data
>
> >> The patchset is completely ready to be merged now.
>
> >Can I confirm that the plan is for me to merge this code?
>
> Yes, that was the plan.
>
> >If so, I should be able to do so next week.
Thanks, I have queued this up in the soc2 phy-rcar-usb.
My current plan is to let that branch sit in next for a few
days and then send a pull-request for it to be included in v3.11.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code
2013-06-11 7:49 ` Simon Horman
@ 2013-06-11 7:56 ` Simon Horman
0 siblings, 0 replies; 9+ messages in thread
From: Simon Horman @ 2013-06-11 7:56 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Jun 11, 2013 at 04:49:43PM +0900, Simon Horman wrote:
> On Fri, Jun 07, 2013 at 02:45:45PM +0400, Sergei Shtylyov wrote:
> > Hello.
> >
> > On 07-06-2013 12:06, Simon Horman wrote:
> >
> > >> Here's the set of 9 patches against the Simon Horman's 'renesas.git' repo,
> > >>'renesas-next-20130528' tag. It was created to fix the shortcomings in the
> > >>R8A7779/Marzen USB platform code and R8A7779 USB common PHY driver, and so
> > >>spans both arch/arm/mach-shmobile/ and drivers/usb/ subtrees (some patches have
> > >>to touch both subtrees). The patches were conceived with the complete
> > >>bisectability goal in mind.
> >
> > >>[1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code
> > >>[2/9] ehci-platform: add pre_setup() method to platform data
> > >>[3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer
> > >>[4/9] phy-rcar-usb: remove EHCI internal buffer setup
> > >>[5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource
> > >>[6/9] phy-rcar-usb: correct base address
> > >>[7/9] phy-rcar-usb: add platform data
> > >>[8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device
> > >>[9/9] phy-rcar-usb: handle platform data
> >
> > >> The patchset is completely ready to be merged now.
> >
> > >Can I confirm that the plan is for me to merge this code?
> >
> > Yes, that was the plan.
> >
> > >If so, I should be able to do so next week.
>
> Thanks, I have queued this up in the soc2 phy-rcar-usb.
s/soc2 phy-rcar-usb/phy-rcar-usb branch/
> My current plan is to let that branch sit in next for a few
> days and then send a pull-request for it to be included in v3.11.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sh" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2013-06-11 7:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-01 21:28 [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Sergei Shtylyov
2013-06-01 21:30 ` [PATCH v8 1/9] ARM: shmobile: Marzen: move USB EHCI, OHCI, and PHY devices to R8A7779 code Sergei Shtylyov
2013-06-01 21:37 ` [PATCH v8 3/9] ARM: shmobile: r8a7779: setup EHCI internal buffer Sergei Shtylyov
2013-06-01 21:48 ` [PATCH v8 5/9] ARM: shmobile: r8a7779: remove USB PHY 2nd memory resource Sergei Shtylyov
2013-06-01 21:55 ` [PATCH v8 8/9] ARM: shmobile: Marzen: pass platform data to USB PHY device Sergei Shtylyov
2013-06-07 8:06 ` [PATCH v8 0/9] Reorganize R8A7779/Marzen USB code Simon Horman
2013-06-07 10:45 ` Sergei Shtylyov
2013-06-11 7:49 ` Simon Horman
2013-06-11 7:56 ` Simon Horman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).