Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x.
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
@ 2012-10-08 13:11 ` Florian Fainelli
       [not found]   ` <CAJhJPsV5mFmOgU38ZpnYqUTNuOPmvRXjsf31XdFUqNOzsd_Edg@mail.gmail.com>
  2012-10-08 13:11 ` [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Kelvin Cheung,
	linux-mips, linux-kernel

The Loongson 1B EHCI driver does nothing more than what the EHCI platform
driver already does, so use the generic implementation.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next

No changes since v1

 arch/mips/configs/ls1b_defconfig      |    1 +
 arch/mips/loongson1/common/platform.c |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/mips/configs/ls1b_defconfig b/arch/mips/configs/ls1b_defconfig
index 80cff8b..7eb7554 100644
--- a/arch/mips/configs/ls1b_defconfig
+++ b/arch/mips/configs/ls1b_defconfig
@@ -76,6 +76,7 @@ CONFIG_HID_GENERIC=m
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
 # CONFIG_USB_EHCI_TT_NEWSCHED is not set
 CONFIG_USB_STORAGE=m
 CONFIG_USB_SERIAL=m
diff --git a/arch/mips/loongson1/common/platform.c b/arch/mips/loongson1/common/platform.c
index e92d59c..2874bf2 100644
--- a/arch/mips/loongson1/common/platform.c
+++ b/arch/mips/loongson1/common/platform.c
@@ -13,6 +13,7 @@
 #include <linux/phy.h>
 #include <linux/serial_8250.h>
 #include <linux/stmmac.h>
+#include <linux/usb/ehci_pdriver.h>
 #include <asm-generic/sizes.h>
 
 #include <loongson1.h>
@@ -107,13 +108,18 @@ static struct resource ls1x_ehci_resources[] = {
 	},
 };
 
+static struct usb_ehci_pdata ls1x_ehci_pdata = {
+	.port_power_off	= 1,
+};
+
 struct platform_device ls1x_ehci_device = {
-	.name		= "ls1x-ehci",
+	.name		= "ehci-platform",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(ls1x_ehci_resources),
 	.resource	= ls1x_ehci_resources,
 	.dev		= {
 		.dma_mask = &ls1x_ehci_dmamask,
+		.platform_data = &ls1x_ehci_pdata,
 	},
 };
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
  2012-10-08 13:11 ` [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  2012-10-08 14:06   ` Jayachandran C.
  2012-10-08 13:11 ` [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Jayachandran C,
	linux-mips, linux-kernel

The EHCI platform driver is suitable for use by the Netlogic XLR platform
since there is nothing specific that the EHCI XLR platform driver does.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next
No changes in v3

Changes in v2:
- really change driver name to "ehci-platform"
- slightly reworded commit message

 arch/mips/netlogic/xlr/platform.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
index 71b44d8..144c5c6 100644
--- a/arch/mips/netlogic/xlr/platform.c
+++ b/arch/mips/netlogic/xlr/platform.c
@@ -15,6 +15,7 @@
 #include <linux/serial_8250.h>
 #include <linux/serial_reg.h>
 #include <linux/i2c.h>
+#include <linux/usb/ehci_pdriver.h>
 
 #include <asm/netlogic/haldefs.h>
 #include <asm/netlogic/xlr/iomap.h>
@@ -123,8 +124,12 @@ static u64 xls_usb_dmamask = ~(u32)0;
 		},							\
 	}
 
+static struct usb_ehci_pdata xls_usb_ehci_pdata = {
+	.caps_offset	= 0,
+};
+
 static struct platform_device xls_usb_ehci_device =
-			 USB_PLATFORM_DEV("ehci-xls", 0, PIC_USB_IRQ);
+			 USB_PLATFORM_DEV("ehci-platform", 0, PIC_USB_IRQ);
 static struct platform_device xls_usb_ohci_device_0 =
 			 USB_PLATFORM_DEV("ohci-xls-0", 1, PIC_USB_IRQ);
 static struct platform_device xls_usb_ohci_device_1 =
@@ -172,6 +177,7 @@ int xls_platform_usb_init(void)
 	memres = CPHYSADDR((unsigned long)usb_mmio);
 	xls_usb_ehci_device.resource[0].start = memres;
 	xls_usb_ehci_device.resource[0].end = memres + 0x400 - 1;
+	xls_usb_ehci_device.dev.platform_data = &xls_usb_ehci_pdata;
 
 	memres += 0x400;
 	xls_usb_ohci_device_0.resource[0].start = memres;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
  2012-10-08 13:11 ` [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x Florian Fainelli
  2012-10-08 13:11 ` [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  2012-10-22 18:19   ` Greg KH
  2012-10-08 13:11 ` [PATCH 16/32 v4] MIPS: PNX8550: use OHCI " Florian Fainelli
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Manuel Lauss,
	Thomas Meyer, David S. Miller, Raghavendra K T, Ingo Molnar,
	linux-mips, linux-kernel

Use the ehci platform driver power_{on,suspend,off} callbacks to perform the
USB block gate enabling/disabling as what the ehci-au1xxx.c driver does.
Update the db1200 and db1300 defconfigs to now select the EHCI platform
driver.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next

No changes in v3

Changes in v2:
- update impacted alchemy defconfigs accordingly

 arch/mips/alchemy/common/platform.c |   23 ++++++++++++++++++++++-
 arch/mips/configs/db1200_defconfig  |    1 +
 arch/mips/configs/db1300_defconfig  |    1 +
 3 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index c0f3ce6..b9a5f6d 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -17,6 +17,7 @@
 #include <linux/platform_device.h>
 #include <linux/serial_8250.h>
 #include <linux/slab.h>
+#include <linux/usb/ehci_pdriver.h>
 
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
@@ -122,6 +123,25 @@ static void __init alchemy_setup_uarts(int ctype)
 static u64 alchemy_ohci_dmamask = DMA_BIT_MASK(32);
 static u64 __maybe_unused alchemy_ehci_dmamask = DMA_BIT_MASK(32);
 
+/* Power on callback for the ehci platform driver */
+static int alchemy_ehci_power_on(struct platform_device *pdev)
+{
+	return alchemy_usb_control(ALCHEMY_USB_EHCI0, 1);
+}
+
+/* Power off/suspend callback for the ehci platform driver */
+static void alchemy_ehci_power_off(struct platform_device *pdev)
+{
+	alchemy_usb_control(ALCHEMY_USB_EHCI0, 0);
+}
+
+static struct usb_ehci_pdata alchemy_ehci_pdata = {
+	.no_io_watchdog	= 1,
+	.power_on	= alchemy_ehci_power_on,
+	.power_off	= alchemy_ehci_power_off,
+	.power_suspend	= alchemy_ehci_power_off,
+};
+
 static unsigned long alchemy_ohci_data[][2] __initdata = {
 	[ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT },
 	[ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT },
@@ -188,9 +208,10 @@ static void __init alchemy_setup_usb(int ctype)
 		res[1].start = alchemy_ehci_data[ctype][1];
 		res[1].end = res[1].start;
 		res[1].flags = IORESOURCE_IRQ;
-		pdev->name = "au1xxx-ehci";
+		pdev->name = "ehci-platform";
 		pdev->id = 0;
 		pdev->dev.dma_mask = &alchemy_ehci_dmamask;
+		pdev->dev.platform_data = &alchemy_ehci_pdata;
 
 		if (platform_device_register(pdev))
 			printk(KERN_INFO "Alchemy USB: cannot add EHCI0\n");
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index 1f69249..d31ac85 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -117,6 +117,7 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 # CONFIG_USB_DEVICE_CLASS is not set
 CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_MMC=y
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig
index 3590ab5..717e7b2 100644
--- a/arch/mips/configs/db1300_defconfig
+++ b/arch/mips/configs/db1300_defconfig
@@ -288,6 +288,7 @@ CONFIG_USB_ARCH_HAS_EHCI=y
 CONFIG_USB=y
 CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
 CONFIG_USB_OHCI_HCD=y
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 16/32 v4] MIPS: PNX8550: use OHCI platform driver
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
                   ` (2 preceding siblings ...)
  2012-10-08 13:11 ` [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  2012-10-08 13:11 ` [PATCH 20/32 v4] MIPS: Netlogic: convert to " Florian Fainelli
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern; +Cc: linux-usb, Florian Fainelli, Ralf Baechle, linux-mips,
	linux-kernel

Change the PNX8550 platform code to register an ohci-platform driver instead
of ohci-pnx8550 since the ohci-platform is suitable for use.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next

No changes in v2 and v3

 arch/mips/pnx8550/common/platform.c |   31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/arch/mips/pnx8550/common/platform.c b/arch/mips/pnx8550/common/platform.c
index 5264cc0..0a8faea 100644
--- a/arch/mips/pnx8550/common/platform.c
+++ b/arch/mips/pnx8550/common/platform.c
@@ -20,6 +20,7 @@
 #include <linux/serial.h>
 #include <linux/serial_pnx8xxx.h>
 #include <linux/platform_device.h>
+#include <linux/usb/ohci_pdriver.h>
 
 #include <int.h>
 #include <usb.h>
@@ -96,12 +97,40 @@ static u64 ohci_dmamask = DMA_BIT_MASK(32);
 
 static u64 uart_dmamask = DMA_BIT_MASK(32);
 
+static int pnx8550_usb_ohci_power_on(struct platform_device *pdev)
+{
+	/*
+	 * Set register CLK48CTL to enable and 48MHz
+	 */
+	outl(0x00000003, PCI_BASE | 0x0004770c);
+
+	/*
+	 * Set register CLK12CTL to enable and 48MHz
+	 */
+	outl(0x00000003, PCI_BASE | 0x00047710);
+
+	udelay(100);
+
+	return 0;
+}
+
+static void pnx8550_usb_ohci_power_off(struct platform_device *pdev)
+{
+	udelay(10);
+}
+
+static struct usb_ohci_pdata pnx8550_usb_ohci_pdata = {
+	.power_on	= pnx8550_usb_ohci_power_on,
+	.power_off	= pnx8550_usb_ohci_power_off,
+};
+
 static struct platform_device pnx8550_usb_ohci_device = {
-	.name		= "pnx8550-ohci",
+	.name		= "ohci-platform",
 	.id		= -1,
 	.dev = {
 		.dma_mask		= &ohci_dmamask,
 		.coherent_dma_mask	= DMA_BIT_MASK(32),
+		.platform_data		= &pnx8550_usb_ohci_pdata,
 	},
 	.num_resources	= ARRAY_SIZE(pnx8550_usb_ohci_resources),
 	.resource	= pnx8550_usb_ohci_resources,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 20/32 v4] MIPS: Netlogic: convert to use OHCI platform driver
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
                   ` (3 preceding siblings ...)
  2012-10-08 13:11 ` [PATCH 16/32 v4] MIPS: PNX8550: use OHCI " Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  2012-10-08 13:11 ` [PATCH 24/32 v4] MIPS: Alchemy: use the " Florian Fainelli
  2012-10-08 13:11 ` [PATCH 26/32 v2] USB: move common alchemy USB routines to arch/mips/alchemy/common.c Florian Fainelli
  6 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Jayachandran C,
	linux-mips, linux-kernel

The OHCI platform driver is suitable for use by the Netlogic XLR platform
so use this driver instead of the OHCI XLS platform driver.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next

No changes in v3

Changes in v2:
- really make the code register the "ohci-platform" driver instead of "ohci-xls"

 arch/mips/netlogic/xlr/platform.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
index 144c5c6..507230e 100644
--- a/arch/mips/netlogic/xlr/platform.c
+++ b/arch/mips/netlogic/xlr/platform.c
@@ -16,6 +16,7 @@
 #include <linux/serial_reg.h>
 #include <linux/i2c.h>
 #include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
 
 #include <asm/netlogic/haldefs.h>
 #include <asm/netlogic/xlr/iomap.h>
@@ -128,12 +129,14 @@ static struct usb_ehci_pdata xls_usb_ehci_pdata = {
 	.caps_offset	= 0,
 };
 
+static struct usb_ohci_pdata xls_usb_ohci_pdata;
+
 static struct platform_device xls_usb_ehci_device =
 			 USB_PLATFORM_DEV("ehci-platform", 0, PIC_USB_IRQ);
 static struct platform_device xls_usb_ohci_device_0 =
-			 USB_PLATFORM_DEV("ohci-xls-0", 1, PIC_USB_IRQ);
+			 USB_PLATFORM_DEV("ohci-platform", 1, PIC_USB_IRQ);
 static struct platform_device xls_usb_ohci_device_1 =
-			 USB_PLATFORM_DEV("ohci-xls-1", 2, PIC_USB_IRQ);
+			 USB_PLATFORM_DEV("ohci-platform", 2, PIC_USB_IRQ);
 
 static struct platform_device *xls_platform_devices[] = {
 	&xls_usb_ehci_device,
@@ -182,10 +185,12 @@ int xls_platform_usb_init(void)
 	memres += 0x400;
 	xls_usb_ohci_device_0.resource[0].start = memres;
 	xls_usb_ohci_device_0.resource[0].end = memres + 0x400 - 1;
+	xls_usb_ohci_device_0.dev.platform_data = &xls_usb_ohci_pdata;
 
 	memres += 0x400;
 	xls_usb_ohci_device_1.resource[0].start = memres;
 	xls_usb_ohci_device_1.resource[0].end = memres + 0x400 - 1;
+	xls_usb_ohci_device_1.dev.platform_data = &xls_usb_ohci_pdata;
 
 	return platform_add_devices(xls_platform_devices,
 				ARRAY_SIZE(xls_platform_devices));
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 24/32 v4] MIPS: Alchemy: use the OHCI platform driver
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
                   ` (4 preceding siblings ...)
  2012-10-08 13:11 ` [PATCH 20/32 v4] MIPS: Netlogic: convert to " Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  2012-10-22 18:27   ` Greg KH
  2012-10-08 13:11 ` [PATCH 26/32 v2] USB: move common alchemy USB routines to arch/mips/alchemy/common.c Florian Fainelli
  6 siblings, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Manuel Lauss,
	Thomas Meyer, David S. Miller, Raghavendra K T, Ingo Molnar,
	Paul Gortmaker, linux-mips, linux-kernel

Convert the Alchemy platform to register the ohci-platform driver, now that
the ohci-platform driver properly handles the specific ohci-au1xxx resume
from suspend case.

This also greatly simplifies the power_{on,off} callbacks and make them
work on platform device id instead of checking the OHCI controller base
address like what was done in ohci-au1xxx.c.

Impacted defconfigs are also updated accordingly to select the OHCI platform
driver.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v4:
- rebased against greg's latest usb-next

No changes in v3

Changes in v2:
- updated defconfigs accordingly
- really instantiate "ohci-platform" instead of "ohci-au1xxx"
- rebased on top of the latest OHCI HCD changes

 arch/mips/alchemy/common/platform.c |   35 +++++++++++++++++++++++++++++++++--
 arch/mips/configs/db1000_defconfig  |    1 +
 arch/mips/configs/db1200_defconfig  |    1 +
 arch/mips/configs/db1300_defconfig  |    1 +
 arch/mips/configs/db1550_defconfig  |    1 +
 arch/mips/configs/gpr_defconfig     |    1 +
 arch/mips/configs/mtx1_defconfig    |    1 +
 arch/mips/configs/pb1100_defconfig  |    1 +
 arch/mips/configs/pb1500_defconfig  |    1 +
 arch/mips/configs/pb1550_defconfig  |    1 +
 10 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index b9a5f6d..7af941d 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -18,6 +18,7 @@
 #include <linux/serial_8250.h>
 #include <linux/slab.h>
 #include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
 
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/mach-au1x00/au1xxx_dbdma.h>
@@ -142,6 +143,34 @@ static struct usb_ehci_pdata alchemy_ehci_pdata = {
 	.power_suspend	= alchemy_ehci_power_off,
 };
 
+/* Power on callback for the ohci platform driver */
+static int alchemy_ohci_power_on(struct platform_device *pdev)
+{
+	int unit;
+
+	unit = (pdev->id == 1) ?
+		ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0;
+
+	return alchemy_usb_control(unit, 1);
+}
+
+/* Power off/suspend callback for the ohci platform driver */
+static void alchemy_ohci_power_off(struct platform_device *pdev)
+{
+	int unit;
+
+	unit = (pdev->id == 1) ?
+		ALCHEMY_USB_OHCI1 : ALCHEMY_USB_OHCI0;
+
+	alchemy_usb_control(unit, 0);
+}
+
+static struct usb_ohci_pdata alchemy_ohci_pdata = {
+	.power_on		= alchemy_ohci_power_on,
+	.power_off		= alchemy_ohci_power_off,
+	.power_suspend		= alchemy_ohci_power_off,
+};
+
 static unsigned long alchemy_ohci_data[][2] __initdata = {
 	[ALCHEMY_CPU_AU1000] = { AU1000_USB_OHCI_PHYS_ADDR, AU1000_USB_HOST_INT },
 	[ALCHEMY_CPU_AU1500] = { AU1000_USB_OHCI_PHYS_ADDR, AU1500_USB_HOST_INT },
@@ -189,9 +218,10 @@ static void __init alchemy_setup_usb(int ctype)
 	res[1].start = alchemy_ohci_data[ctype][1];
 	res[1].end = res[1].start;
 	res[1].flags = IORESOURCE_IRQ;
-	pdev->name = "au1xxx-ohci";
+	pdev->name = "ohci-platform";
 	pdev->id = 0;
 	pdev->dev.dma_mask = &alchemy_ohci_dmamask;
+	pdev->dev.platform_data = &alchemy_ohci_pdata;
 
 	if (platform_device_register(pdev))
 		printk(KERN_INFO "Alchemy USB: cannot add OHCI0\n");
@@ -228,9 +258,10 @@ static void __init alchemy_setup_usb(int ctype)
 		res[1].start = AU1300_USB_INT;
 		res[1].end = res[1].start;
 		res[1].flags = IORESOURCE_IRQ;
-		pdev->name = "au1xxx-ohci";
+		pdev->name = "ohci-platform";
 		pdev->id = 1;
 		pdev->dev.dma_mask = &alchemy_ohci_dmamask;
+		pdev->dev.platform_data = &alchemy_ohci_pdata;
 
 		if (platform_device_register(pdev))
 			printk(KERN_INFO "Alchemy USB: cannot add OHCI1\n");
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig
index 17a36c1..face9d2 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -233,6 +233,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_UHCI_HCD=y
 CONFIG_USB_STORAGE=y
 CONFIG_NEW_LEDS=y
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig
index d31ac85..e36f44a 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -120,6 +120,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_MMC=y
 # CONFIG_MMC_BLOCK_BOUNCE is not set
 CONFIG_MMC_AU1X=y
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig
index 717e7b2..6873443 100644
--- a/arch/mips/configs/db1300_defconfig
+++ b/arch/mips/configs/db1300_defconfig
@@ -292,6 +292,7 @@ CONFIG_USB_EHCI_HCD_PLATFORM=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 CONFIG_RTC_LIB=y
 CONFIG_RTC_CLASS=y
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig
index 36cda27..315fe24 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -187,6 +187,7 @@ CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_EHCI_TT_NEWSCHED=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_OHCI_LITTLE_ENDIAN=y
 CONFIG_USB_UHCI_HCD=y
 CONFIG_USB_STORAGE=y
diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig
index 48a40ae..fb64589 100644
--- a/arch/mips/configs/gpr_defconfig
+++ b/arch/mips/configs/gpr_defconfig
@@ -291,6 +291,7 @@ CONFIG_USB_MON=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_STORAGE=m
 CONFIG_USB_LIBUSUAL=y
 CONFIG_USB_SERIAL=y
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index 46c61edc..459018a 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -581,6 +581,7 @@ CONFIG_USB_MON=m
 CONFIG_USB_EHCI_HCD=m
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=m
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_USB_UHCI_HCD=m
 CONFIG_USB_U132_HCD=m
 CONFIG_USB_SL811_HCD=m
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig
index 75eb1b1..b47b1a3 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -97,6 +97,7 @@ CONFIG_USB=y
 CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_SUSPEND=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AU1XXX=y
 CONFIG_EXT2_FS=y
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig
index fa00487..adbc281 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -104,6 +104,7 @@ CONFIG_USB=y
 CONFIG_USB_DYNAMIC_MINORS=y
 CONFIG_USB_OTG_WHITELIST=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AU1XXX=y
 CONFIG_EXT2_FS=y
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig
index e83d649..ef13bba 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -108,6 +108,7 @@ CONFIG_USB_SUSPEND=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_ROOT_HUB_TT=y
 CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AU1XXX=y
 CONFIG_EXT2_FS=y
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 26/32 v2] USB: move common alchemy USB routines to arch/mips/alchemy/common.c
       [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
                   ` (5 preceding siblings ...)
  2012-10-08 13:11 ` [PATCH 24/32 v4] MIPS: Alchemy: use the " Florian Fainelli
@ 2012-10-08 13:11 ` Florian Fainelli
  6 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2012-10-08 13:11 UTC (permalink / raw)
  To: stern
  Cc: linux-usb, Florian Fainelli, Ralf Baechle, Greg Kroah-Hartman,
	Manuel Lauss, Hauke Mehrtens, Sarah Sharp, Felipe Balbi,
	linux-mips, linux-kernel

A previous patch converted the Alchemy platform to use the OHCI and EHCI
platform drivers. As a result, all the common logic to handle USB present in
drivers/usb/host/alchemy-common.c has no reason to remain here, so we move it
to arch/mips/alchemy/common/usb.c which is a more appropriate place. This
change was suggested by Manuel Lauss.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
Changes in v2:
- rebased against greg's latest usb-next

 arch/mips/alchemy/common/Makefile                  |    2 +-
 .../mips/alchemy/common/usb.c                      |    0
 drivers/usb/host/Makefile                          |    1 -
 3 files changed, 1 insertion(+), 2 deletions(-)
 rename drivers/usb/host/alchemy-common.c => arch/mips/alchemy/common/usb.c (100%)

diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile
index 407ebc0..cb83d8d 100644
--- a/arch/mips/alchemy/common/Makefile
+++ b/arch/mips/alchemy/common/Makefile
@@ -6,7 +6,7 @@
 #
 
 obj-y += prom.o time.o clocks.o platform.o power.o setup.o \
-	sleeper.o dma.o dbdma.o vss.o irq.o
+	sleeper.o dma.o dbdma.o vss.o irq.o usb.o
 
 # optional gpiolib support
 ifeq ($(CONFIG_ALCHEMY_GPIO_INDIRECT),)
diff --git a/drivers/usb/host/alchemy-common.c b/arch/mips/alchemy/common/usb.c
similarity index 100%
rename from drivers/usb/host/alchemy-common.c
rename to arch/mips/alchemy/common/usb.c
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 9e0a89c..332ed89 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -40,6 +40,5 @@ obj-$(CONFIG_USB_HWA_HCD)	+= hwa-hc.o
 obj-$(CONFIG_USB_IMX21_HCD)	+= imx21-hcd.o
 obj-$(CONFIG_USB_FSL_MPH_DR_OF)	+= fsl-mph-dr-of.o
 obj-$(CONFIG_USB_OCTEON2_COMMON) += octeon2-common.o
-obj-$(CONFIG_MIPS_ALCHEMY)	+= alchemy-common.o
 obj-$(CONFIG_USB_HCD_BCMA)	+= bcma-hcd.o
 obj-$(CONFIG_USB_HCD_SSB)	+= ssb-hcd.o
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver
  2012-10-08 13:11 ` [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
@ 2012-10-08 14:06   ` Jayachandran C.
  0 siblings, 0 replies; 12+ messages in thread
From: Jayachandran C. @ 2012-10-08 14:06 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: stern, linux-usb, Ralf Baechle, Jayachandran C, linux-mips,
	linux-kernel

On Mon, Oct 08, 2012 at 03:11:19PM +0200, Florian Fainelli wrote:
> The EHCI platform driver is suitable for use by the Netlogic XLR platform
> since there is nothing specific that the EHCI XLR platform driver does.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> Changes in v4:
> - rebased against greg's latest usb-next
> No changes in v3
> 
> Changes in v2:
> - really change driver name to "ehci-platform"
> - slightly reworded commit message
> 
>  arch/mips/netlogic/xlr/platform.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
> index 71b44d8..144c5c6 100644
> --- a/arch/mips/netlogic/xlr/platform.c
> +++ b/arch/mips/netlogic/xlr/platform.c
> @@ -15,6 +15,7 @@
>  #include <linux/serial_8250.h>
>  #include <linux/serial_reg.h>
>  #include <linux/i2c.h>
> +#include <linux/usb/ehci_pdriver.h>
>  
>  #include <asm/netlogic/haldefs.h>
>  #include <asm/netlogic/xlr/iomap.h>
> @@ -123,8 +124,12 @@ static u64 xls_usb_dmamask = ~(u32)0;
>  		},							\
>  	}
>  
> +static struct usb_ehci_pdata xls_usb_ehci_pdata = {
> +	.caps_offset	= 0,
> +};
> +

Do we need to initilaize static data to 0?

JC.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver
  2012-10-08 13:11 ` [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
@ 2012-10-22 18:19   ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2012-10-22 18:19 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
	David S. Miller, Raghavendra K T, Ingo Molnar, linux-mips,
	linux-kernel

On Mon, Oct 08, 2012 at 03:11:22PM +0200, Florian Fainelli wrote:
> Use the ehci platform driver power_{on,suspend,off} callbacks to perform the
> USB block gate enabling/disabling as what the ehci-au1xxx.c driver does.
> Update the db1200 and db1300 defconfigs to now select the EHCI platform
> driver.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> Changes in v4:
> - rebased against greg's latest usb-next
> 
> No changes in v3
> 
> Changes in v2:
> - update impacted alchemy defconfigs accordingly
> 
>  arch/mips/alchemy/common/platform.c |   23 ++++++++++++++++++++++-
>  arch/mips/configs/db1200_defconfig  |    1 +
>  arch/mips/configs/db1300_defconfig  |    1 +

These two defconfig files are no longer in Linus's tree, so I'll just
remove them from this patch.  If that's not ok, can you send a follow-on
patch that adds the config option to the correct defconfig file?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 24/32 v4] MIPS: Alchemy: use the OHCI platform driver
  2012-10-08 13:11 ` [PATCH 24/32 v4] MIPS: Alchemy: use the " Florian Fainelli
@ 2012-10-22 18:27   ` Greg KH
  0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2012-10-22 18:27 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
	David S. Miller, Raghavendra K T, Ingo Molnar, Paul Gortmaker,
	linux-mips, linux-kernel

On Mon, Oct 08, 2012 at 03:11:38PM +0200, Florian Fainelli wrote:
> Convert the Alchemy platform to register the ohci-platform driver, now that
> the ohci-platform driver properly handles the specific ohci-au1xxx resume
> from suspend case.
> 
> This also greatly simplifies the power_{on,off} callbacks and make them
> work on platform device id instead of checking the OHCI controller base
> address like what was done in ohci-au1xxx.c.
> 
> Impacted defconfigs are also updated accordingly to select the OHCI platform
> driver.
> 
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> Acked-by: Alan Stern <stern@rowland.harvard.edu>
> ---
> Changes in v4:
> - rebased against greg's latest usb-next
> 
> No changes in v3
> 
> Changes in v2:
> - updated defconfigs accordingly
> - really instantiate "ohci-platform" instead of "ohci-au1xxx"
> - rebased on top of the latest OHCI HCD changes
> 
>  arch/mips/alchemy/common/platform.c |   35 +++++++++++++++++++++++++++++++++--
>  arch/mips/configs/db1000_defconfig  |    1 +
>  arch/mips/configs/db1200_defconfig  |    1 +
>  arch/mips/configs/db1300_defconfig  |    1 +
>  arch/mips/configs/db1550_defconfig  |    1 +
>  arch/mips/configs/gpr_defconfig     |    1 +
>  arch/mips/configs/mtx1_defconfig    |    1 +
>  arch/mips/configs/pb1100_defconfig  |    1 +
>  arch/mips/configs/pb1500_defconfig  |    1 +
>  arch/mips/configs/pb1550_defconfig  |    1 +

Same issue with the defconfigs in this patch, they aren't around
anymore, so I've removed them from this patch.  If they just moved,
please send a follow-up patch to fix them up.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x.
       [not found]   ` <CAJhJPsV5mFmOgU38ZpnYqUTNuOPmvRXjsf31XdFUqNOzsd_Edg@mail.gmail.com>
@ 2012-10-23  8:46     ` Florian Fainelli
  2012-10-23  8:53       ` Florian Fainelli
  0 siblings, 1 reply; 12+ messages in thread
From: Florian Fainelli @ 2012-10-23  8:46 UTC (permalink / raw)
  To: Kelvin Cheung; +Cc: stern, linux-usb, Ralf Baechle, linux-mips, linux-kernel

Hi Kelvin,

On Tuesday 23 October 2012 16:13:01 Kelvin Cheung wrote:
> Thank Florian.
> It looks great.
> However, you forget to remove corresponding section in
> drivers/usb/host/ehci-hcd.c
> ...
> #ifdef CONFIG_MACH_LOONGSON1
> #include "ehci-ls1x.c"
> #define PLATFORM_DRIVER         ehci_ls1x_driver
> #endif

Indeed, my bad I will follow up with some fixes for this patchset anyway.
Thank you!

> ...
> 
> 2012/10/8 Florian Fainelli <florian@openwrt.org>
> 
> > The Loongson 1B EHCI driver does nothing more than what the EHCI platform
> > driver already does, so use the generic implementation.
> >
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > Changes in v4:
> > - rebased against greg's latest usb-next
> >
> > No changes since v1
> >
> >  arch/mips/configs/ls1b_defconfig      |    1 +
> >  arch/mips/loongson1/common/platform.c |    8 +++++++-
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/configs/ls1b_defconfig
> > b/arch/mips/configs/ls1b_defconfig
> > index 80cff8b..7eb7554 100644
> > --- a/arch/mips/configs/ls1b_defconfig
> > +++ b/arch/mips/configs/ls1b_defconfig
> > @@ -76,6 +76,7 @@ CONFIG_HID_GENERIC=m
> >  CONFIG_USB=y
> >  CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
> >  CONFIG_USB_EHCI_HCD=y
> > +CONFIG_USB_EHCI_HCD_PLATFORM=y
> >  # CONFIG_USB_EHCI_TT_NEWSCHED is not set
> >  CONFIG_USB_STORAGE=m
> >  CONFIG_USB_SERIAL=m
> > diff --git a/arch/mips/loongson1/common/platform.c
> > b/arch/mips/loongson1/common/platform.c
> > index e92d59c..2874bf2 100644
> > --- a/arch/mips/loongson1/common/platform.c
> > +++ b/arch/mips/loongson1/common/platform.c
> > @@ -13,6 +13,7 @@
> >  #include <linux/phy.h>
> >  #include <linux/serial_8250.h>
> >  #include <linux/stmmac.h>
> > +#include <linux/usb/ehci_pdriver.h>
> >  #include <asm-generic/sizes.h>
> >
> >  #include <loongson1.h>
> > @@ -107,13 +108,18 @@ static struct resource ls1x_ehci_resources[] = {
> >         },
> >  };
> >
> > +static struct usb_ehci_pdata ls1x_ehci_pdata = {
> > +       .port_power_off = 1,
> > +};
> > +
> >  struct platform_device ls1x_ehci_device = {
> > -       .name           = "ls1x-ehci",
> > +       .name           = "ehci-platform",
> >         .id             = -1,
> >         .num_resources  = ARRAY_SIZE(ls1x_ehci_resources),
> >         .resource       = ls1x_ehci_resources,
> >         .dev            = {
> >                 .dma_mask = &ls1x_ehci_dmamask,
> > +               .platform_data = &ls1x_ehci_pdata,
> >         },
> >  };
> >
> > --
> > 1.7.9.5
> >
> >
> 
> 
> -- 
> Best Regards!
> Kelvin Cheung

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x.
  2012-10-23  8:46     ` Florian Fainelli
@ 2012-10-23  8:53       ` Florian Fainelli
  0 siblings, 0 replies; 12+ messages in thread
From: Florian Fainelli @ 2012-10-23  8:53 UTC (permalink / raw)
  To: Kelvin Cheung; +Cc: stern, linux-usb, Ralf Baechle, linux-mips, linux-kernel

On Tuesday 23 October 2012 10:46:50 Florian Fainelli wrote:
> Hi Kelvin,
> 
> On Tuesday 23 October 2012 16:13:01 Kelvin Cheung wrote:
> > Thank Florian.
> > It looks great.
> > However, you forget to remove corresponding section in
> > drivers/usb/host/ehci-hcd.c
> > ...
> > #ifdef CONFIG_MACH_LOONGSON1
> > #include "ehci-ls1x.c"
> > #define PLATFORM_DRIVER         ehci_ls1x_driver
> > #endif
> 
> Indeed, my bad I will follow up with some fixes for this patchset anyway.
> Thank you!

Looks like I hit reply too quickly, the patch entitled
"USB: EHCI: remove Loongson 1B EHCI driver" actually removes this bit from
ehci-hcd.c.
--
Florian

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-10-23  8:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1349701906-16481-1-git-send-email-florian@openwrt.org>
2012-10-08 13:11 ` [PATCH 03/32 v4] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x Florian Fainelli
     [not found]   ` <CAJhJPsV5mFmOgU38ZpnYqUTNuOPmvRXjsf31XdFUqNOzsd_Edg@mail.gmail.com>
2012-10-23  8:46     ` Florian Fainelli
2012-10-23  8:53       ` Florian Fainelli
2012-10-08 13:11 ` [PATCH 05/32 v4] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
2012-10-08 14:06   ` Jayachandran C.
2012-10-08 13:11 ` [PATCH 08/32 v4] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
2012-10-22 18:19   ` Greg KH
2012-10-08 13:11 ` [PATCH 16/32 v4] MIPS: PNX8550: use OHCI " Florian Fainelli
2012-10-08 13:11 ` [PATCH 20/32 v4] MIPS: Netlogic: convert to " Florian Fainelli
2012-10-08 13:11 ` [PATCH 24/32 v4] MIPS: Alchemy: use the " Florian Fainelli
2012-10-22 18:27   ` Greg KH
2012-10-08 13:11 ` [PATCH 26/32 v2] USB: move common alchemy USB routines to arch/mips/alchemy/common.c Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox