* [PATCH 02/25] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x.
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
@ 2012-10-03 15:02 ` Florian Fainelli
2012-10-03 15:02 ` [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
` (8 subsequent siblings)
9 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:02 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>
---
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] 28+ messages in thread* [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
2012-10-03 15:02 ` [PATCH 02/25] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x Florian Fainelli
@ 2012-10-03 15:02 ` Florian Fainelli
2012-10-03 16:47 ` Alan Stern
2012-10-04 10:51 ` Jonas Gorski
2012-10-03 15:03 ` [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to " Florian Fainelli
` (7 subsequent siblings)
9 siblings, 2 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:02 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, Jayachandran C,
linux-mips, linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/netlogic/xlr/platform.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
index 71b44d8..1731dfd 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,6 +124,10 @@ 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);
static struct platform_device xls_usb_ohci_device_0 =
@@ -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] 28+ messages in thread* Re: [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver
2012-10-03 15:02 ` [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
@ 2012-10-03 16:47 ` Alan Stern
2012-10-03 16:47 ` Alan Stern
2012-10-04 14:51 ` Florian Fainelli
2012-10-04 10:51 ` Jonas Gorski
1 sibling, 2 replies; 28+ messages in thread
From: Alan Stern @ 2012-10-03 16:47 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-usb, Ralf Baechle, Jayachandran C, linux-mips, linux-kernel
On Wed, 3 Oct 2012, Florian Fainelli wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
IMO, patches should always have a non-empty changelog. Even if it is
relatively trivial. The same comment applies to several other patches
in this series.
> ---
> arch/mips/netlogic/xlr/platform.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Does this need to enable CONFIG_USB_EHCI_HCD_PLATFORM is some
defconfig file, like you did with the MIPS Loongson 1B?
And likewise for quite a few of the other patches in this series.
> diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
> index 71b44d8..1731dfd 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,6 +124,10 @@ 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);
> static struct platform_device xls_usb_ohci_device_0 =
> @@ -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;
Don't you need to change/set the pdev name also? Likewise for patch
20/25 and 24/25.
Alan Stern
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver
2012-10-03 16:47 ` Alan Stern
@ 2012-10-03 16:47 ` Alan Stern
2012-10-04 14:51 ` Florian Fainelli
1 sibling, 0 replies; 28+ messages in thread
From: Alan Stern @ 2012-10-03 16:47 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-usb, Ralf Baechle, Jayachandran C, linux-mips, linux-kernel
On Wed, 3 Oct 2012, Florian Fainelli wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
IMO, patches should always have a non-empty changelog. Even if it is
relatively trivial. The same comment applies to several other patches
in this series.
> ---
> arch/mips/netlogic/xlr/platform.c | 6 ++++++
> 1 file changed, 6 insertions(+)
Does this need to enable CONFIG_USB_EHCI_HCD_PLATFORM is some
defconfig file, like you did with the MIPS Loongson 1B?
And likewise for quite a few of the other patches in this series.
> diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
> index 71b44d8..1731dfd 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,6 +124,10 @@ 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);
> static struct platform_device xls_usb_ohci_device_0 =
> @@ -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;
Don't you need to change/set the pdev name also? Likewise for patch
20/25 and 24/25.
Alan Stern
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver
2012-10-03 16:47 ` Alan Stern
2012-10-03 16:47 ` Alan Stern
@ 2012-10-04 14:51 ` Florian Fainelli
1 sibling, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-04 14:51 UTC (permalink / raw)
To: Alan Stern
Cc: linux-usb, Ralf Baechle, Jayachandran C, linux-mips, linux-kernel
On Wednesday 03 October 2012 12:47:58 Alan Stern wrote:
> On Wed, 3 Oct 2012, Florian Fainelli wrote:
>
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
>
> IMO, patches should always have a non-empty changelog. Even if it is
> relatively trivial. The same comment applies to several other patches
> in this series.
>
> > ---
> > arch/mips/netlogic/xlr/platform.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
>
> Does this need to enable CONFIG_USB_EHCI_HCD_PLATFORM is some
> defconfig file, like you did with the MIPS Loongson 1B?
Netlogic platforms have USB disabled by default in their defconfig, so I'd say
no, but only for them.
>
> And likewise for quite a few of the other patches in this series.
>
> > diff --git a/arch/mips/netlogic/xlr/platform.c
b/arch/mips/netlogic/xlr/platform.c
> > index 71b44d8..1731dfd 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,6 +124,10 @@ 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);
> > static struct platform_device xls_usb_ohci_device_0 =
> > @@ -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;
>
> Don't you need to change/set the pdev name also? Likewise for patch
> 20/25 and 24/25.
>
> Alan Stern
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver
2012-10-03 15:02 ` [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
2012-10-03 16:47 ` Alan Stern
@ 2012-10-04 10:51 ` Jonas Gorski
1 sibling, 0 replies; 28+ messages in thread
From: Jonas Gorski @ 2012-10-04 10:51 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Jayachandran C, linux-mips,
linux-kernel
On 3 October 2012 17:02, Florian Fainelli <florian@openwrt.org> wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/netlogic/xlr/platform.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
> index 71b44d8..1731dfd 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,6 +124,10 @@ 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);
Don't you also need to change this to "ehci-platform"?
> static struct platform_device xls_usb_ohci_device_0 =
> @@ -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
Jonas
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to ehci-platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
2012-10-03 15:02 ` [PATCH 02/25] MIPS: Loongson 1B: use ehci-platform instead of ehci-ls1x Florian Fainelli
2012-10-03 15:02 ` [PATCH 04/25] MIPS: Netlogic: use ehci-platform driver Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 16:01 ` Alan Stern
2012-10-03 15:03 ` [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
` (6 subsequent siblings)
9 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, Greg Kroah-Hartman,
Gabor Juhos, Hauke Mehrtens, Kelvin Cheung, Jayachandran C,
Dan Carpenter, Geert Uytterhoeven, linux-mips, linux-kernel
And convert all the existing users of ehci-platform to specify a correct
need_io_watchdog value.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/ath79/dev-usb.c | 2 ++
arch/mips/loongson1/common/platform.c | 1 +
arch/mips/netlogic/xlr/platform.c | 1 +
drivers/usb/host/bcma-hcd.c | 1 +
drivers/usb/host/ehci-platform.c | 1 +
drivers/usb/host/ssb-hcd.c | 1 +
include/linux/usb/ehci_pdriver.h | 3 +++
7 files changed, 10 insertions(+)
diff --git a/arch/mips/ath79/dev-usb.c b/arch/mips/ath79/dev-usb.c
index b2a2311..42b259b 100644
--- a/arch/mips/ath79/dev-usb.c
+++ b/arch/mips/ath79/dev-usb.c
@@ -71,12 +71,14 @@ static u64 ath79_ehci_dmamask = DMA_BIT_MASK(32);
static struct usb_ehci_pdata ath79_ehci_pdata_v1 = {
.has_synopsys_hc_bug = 1,
.port_power_off = 1,
+ .need_io_watchdog = 1,
};
static struct usb_ehci_pdata ath79_ehci_pdata_v2 = {
.caps_offset = 0x100,
.has_tt = 1,
.port_power_off = 1,
+ .need_io_watchdog = 1,
};
static struct platform_device ath79_ehci_device = {
diff --git a/arch/mips/loongson1/common/platform.c b/arch/mips/loongson1/common/platform.c
index 2874bf2..fa6b5d6 100644
--- a/arch/mips/loongson1/common/platform.c
+++ b/arch/mips/loongson1/common/platform.c
@@ -110,6 +110,7 @@ static struct resource ls1x_ehci_resources[] = {
static struct usb_ehci_pdata ls1x_ehci_pdata = {
.port_power_off = 1,
+ .need_io_watchdog = 1,
};
struct platform_device ls1x_ehci_device = {
diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
index 1731dfd..320b7ef 100644
--- a/arch/mips/netlogic/xlr/platform.c
+++ b/arch/mips/netlogic/xlr/platform.c
@@ -126,6 +126,7 @@ static u64 xls_usb_dmamask = ~(u32)0;
static struct usb_ehci_pdata xls_usb_ehci_pdata = {
.caps_offset = 0,
+ .need_io_watchdog = 1,
};
static struct platform_device xls_usb_ehci_device =
diff --git a/drivers/usb/host/bcma-hcd.c b/drivers/usb/host/bcma-hcd.c
index 443da21..e404f5c 100644
--- a/drivers/usb/host/bcma-hcd.c
+++ b/drivers/usb/host/bcma-hcd.c
@@ -160,6 +160,7 @@ static void __devinit bcma_hcd_init_chip(struct bcma_device *dev)
}
static const struct usb_ehci_pdata ehci_pdata = {
+ .need_io_watchdog = 1,
};
static const struct usb_ohci_pdata ohci_pdata = {
diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
index 764e010..08d5dec 100644
--- a/drivers/usb/host/ehci-platform.c
+++ b/drivers/usb/host/ehci-platform.c
@@ -32,6 +32,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug;
ehci->big_endian_desc = pdata->big_endian_desc;
ehci->big_endian_mmio = pdata->big_endian_mmio;
+ ehci->need_io_watchdog = pdata->need_io_watchdog;
ehci->caps = hcd->regs + pdata->caps_offset;
retval = ehci_setup(hcd);
diff --git a/drivers/usb/host/ssb-hcd.c b/drivers/usb/host/ssb-hcd.c
index c2a29fa..77e2851 100644
--- a/drivers/usb/host/ssb-hcd.c
+++ b/drivers/usb/host/ssb-hcd.c
@@ -96,6 +96,7 @@ static u32 __devinit ssb_hcd_init_chip(struct ssb_device *dev)
}
static const struct usb_ehci_pdata ehci_pdata = {
+ .need_io_watchdog = 1,
};
static const struct usb_ohci_pdata ohci_pdata = {
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
index c9d09f8..988504d 100644
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
@@ -29,6 +29,8 @@
* initialization.
* @port_power_off: set to 1 if the controller needs to be powered down
* after initialization.
+ * @need_io_watchdog: set to 1 if the controller needs the I/O watchdog to
+ * run.
*
* These are general configuration options for the EHCI controller. All of
* these options are activating more or less workarounds for some hardware.
@@ -41,6 +43,7 @@ struct usb_ehci_pdata {
unsigned big_endian_mmio:1;
unsigned port_power_on:1;
unsigned port_power_off:1;
+ unsigned need_io_watchdog:1;
/* Turn on all power and clocks */
int (*power_on)(struct platform_device *pdev);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to ehci-platform driver
2012-10-03 15:03 ` [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to " Florian Fainelli
@ 2012-10-03 16:01 ` Alan Stern
2012-10-03 16:01 ` Alan Stern
2012-10-03 16:12 ` Florian Fainelli
0 siblings, 2 replies; 28+ messages in thread
From: Alan Stern @ 2012-10-03 16:01 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-usb, Ralf Baechle, Greg Kroah-Hartman, Gabor Juhos,
Hauke Mehrtens, Kelvin Cheung, Jayachandran C, Dan Carpenter,
Geert Uytterhoeven, linux-mips, linux-kernel
On Wed, 3 Oct 2012, Florian Fainelli wrote:
> And convert all the existing users of ehci-platform to specify a correct
> need_io_watchdog value.
IMO (and I realize that not everybody agrees), the patch description
should not be considered an extension of the patch title, as though the
title were the first sentence and the description the remainder of the
same paragraph. Descriptions should stand on their own and be
comprehensible even to somebody who hasn't read the title.
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/ath79/dev-usb.c | 2 ++
> arch/mips/loongson1/common/platform.c | 1 +
> arch/mips/netlogic/xlr/platform.c | 1 +
> drivers/usb/host/bcma-hcd.c | 1 +
> drivers/usb/host/ehci-platform.c | 1 +
> drivers/usb/host/ssb-hcd.c | 1 +
> include/linux/usb/ehci_pdriver.h | 3 +++
> 7 files changed, 10 insertions(+)
More importantly... Nearly every driver will have need_io_watchdog
set. Only a few of them explicitly turn it off. The approach you're
using puts an extra burden on most of the drivers.
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index 764e010..08d5dec 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -32,6 +32,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
> ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug;
> ehci->big_endian_desc = pdata->big_endian_desc;
> ehci->big_endian_mmio = pdata->big_endian_mmio;
> + ehci->need_io_watchdog = pdata->need_io_watchdog;
> --- a/include/linux/usb/ehci_pdriver.h
> +++ b/include/linux/usb/ehci_pdriver.h
> @@ -29,6 +29,8 @@
> * initialization.
> * @port_power_off: set to 1 if the controller needs to be powered down
> * after initialization.
> + * @need_io_watchdog: set to 1 if the controller needs the I/O watchdog to
> + * run.
Instead, how about adding a no_io_watchdog flag? Then after
ehci-platform.c calls ehci_setup(), it can see whether to turn off
ehci->need_io_watchdog.
This way, most of this patch would become unnecessary.
Alan Stern
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to ehci-platform driver
2012-10-03 16:01 ` Alan Stern
@ 2012-10-03 16:01 ` Alan Stern
2012-10-03 16:12 ` Florian Fainelli
1 sibling, 0 replies; 28+ messages in thread
From: Alan Stern @ 2012-10-03 16:01 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-usb, Ralf Baechle, Greg Kroah-Hartman, Gabor Juhos,
Hauke Mehrtens, Kelvin Cheung, Jayachandran C, Dan Carpenter,
Geert Uytterhoeven, linux-mips, linux-kernel
On Wed, 3 Oct 2012, Florian Fainelli wrote:
> And convert all the existing users of ehci-platform to specify a correct
> need_io_watchdog value.
IMO (and I realize that not everybody agrees), the patch description
should not be considered an extension of the patch title, as though the
title were the first sentence and the description the remainder of the
same paragraph. Descriptions should stand on their own and be
comprehensible even to somebody who hasn't read the title.
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/ath79/dev-usb.c | 2 ++
> arch/mips/loongson1/common/platform.c | 1 +
> arch/mips/netlogic/xlr/platform.c | 1 +
> drivers/usb/host/bcma-hcd.c | 1 +
> drivers/usb/host/ehci-platform.c | 1 +
> drivers/usb/host/ssb-hcd.c | 1 +
> include/linux/usb/ehci_pdriver.h | 3 +++
> 7 files changed, 10 insertions(+)
More importantly... Nearly every driver will have need_io_watchdog
set. Only a few of them explicitly turn it off. The approach you're
using puts an extra burden on most of the drivers.
> diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c
> index 764e010..08d5dec 100644
> --- a/drivers/usb/host/ehci-platform.c
> +++ b/drivers/usb/host/ehci-platform.c
> @@ -32,6 +32,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
> ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug;
> ehci->big_endian_desc = pdata->big_endian_desc;
> ehci->big_endian_mmio = pdata->big_endian_mmio;
> + ehci->need_io_watchdog = pdata->need_io_watchdog;
> --- a/include/linux/usb/ehci_pdriver.h
> +++ b/include/linux/usb/ehci_pdriver.h
> @@ -29,6 +29,8 @@
> * initialization.
> * @port_power_off: set to 1 if the controller needs to be powered down
> * after initialization.
> + * @need_io_watchdog: set to 1 if the controller needs the I/O watchdog to
> + * run.
Instead, how about adding a no_io_watchdog flag? Then after
ehci-platform.c calls ehci_setup(), it can see whether to turn off
ehci->need_io_watchdog.
This way, most of this patch would become unnecessary.
Alan Stern
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to ehci-platform driver
2012-10-03 16:01 ` Alan Stern
2012-10-03 16:01 ` Alan Stern
@ 2012-10-03 16:12 ` Florian Fainelli
1 sibling, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 16:12 UTC (permalink / raw)
To: Alan Stern
Cc: linux-usb, Ralf Baechle, Greg Kroah-Hartman, Gabor Juhos,
Hauke Mehrtens, Kelvin Cheung, Jayachandran C, Dan Carpenter,
Geert Uytterhoeven, linux-mips, linux-kernel
On Wednesday 03 October 2012 12:01:22 Alan Stern wrote:
> On Wed, 3 Oct 2012, Florian Fainelli wrote:
>
> > And convert all the existing users of ehci-platform to specify a correct
> > need_io_watchdog value.
>
> IMO (and I realize that not everybody agrees), the patch description
> should not be considered an extension of the patch title, as though the
> title were the first sentence and the description the remainder of the
> same paragraph. Descriptions should stand on their own and be
> comprehensible even to somebody who hasn't read the title.
>
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > arch/mips/ath79/dev-usb.c | 2 ++
> > arch/mips/loongson1/common/platform.c | 1 +
> > arch/mips/netlogic/xlr/platform.c | 1 +
> > drivers/usb/host/bcma-hcd.c | 1 +
> > drivers/usb/host/ehci-platform.c | 1 +
> > drivers/usb/host/ssb-hcd.c | 1 +
> > include/linux/usb/ehci_pdriver.h | 3 +++
> > 7 files changed, 10 insertions(+)
>
> More importantly... Nearly every driver will have need_io_watchdog
> set. Only a few of them explicitly turn it off. The approach you're
> using puts an extra burden on most of the drivers.
>
> > diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-
platform.c
> > index 764e010..08d5dec 100644
> > --- a/drivers/usb/host/ehci-platform.c
> > +++ b/drivers/usb/host/ehci-platform.c
> > @@ -32,6 +32,7 @@ static int ehci_platform_reset(struct usb_hcd *hcd)
> > ehci->has_synopsys_hc_bug = pdata->has_synopsys_hc_bug;
> > ehci->big_endian_desc = pdata->big_endian_desc;
> > ehci->big_endian_mmio = pdata->big_endian_mmio;
> > + ehci->need_io_watchdog = pdata->need_io_watchdog;
>
> > --- a/include/linux/usb/ehci_pdriver.h
> > +++ b/include/linux/usb/ehci_pdriver.h
> > @@ -29,6 +29,8 @@
> > * initialization.
> > * @port_power_off: set to 1 if the controller needs to be powered down
> > * after initialization.
> > + * @need_io_watchdog: set to 1 if the controller needs the I/O
watchdog to
> > + * run.
>
> Instead, how about adding a no_io_watchdog flag? Then after
> ehci-platform.c calls ehci_setup(), it can see whether to turn off
> ehci->need_io_watchdog.
Sounds good, you are right, this also greatly reduces the chances to miss one
user of this "feature".
>
> This way, most of this patch would become unnecessary.
>
> Alan Stern
>
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (2 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 06/25] USB: ehci: allow need_io_watchdog to be passed to " Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 15:14 ` Manuel Lauss
2012-10-03 15:03 ` [PATCH 09/25] MIPS: Octeon: use ehci-platform driver Florian Fainelli
` (5 subsequent siblings)
9 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, Manuel Lauss,
Thomas Meyer, David S. Miller, 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.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/alchemy/common/platform.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index c0f3ce6..57335a2 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 = {
+ .need_io_watchdog = 0,
+ .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");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver
2012-10-03 15:03 ` [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
@ 2012-10-03 15:14 ` Manuel Lauss
2012-10-03 15:20 ` Florian Fainelli
0 siblings, 1 reply; 28+ messages in thread
From: Manuel Lauss @ 2012-10-03 15:14 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> 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.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/alchemy/common/platform.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
> index c0f3ce6..57335a2 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 = {
> + .need_io_watchdog = 0,
This member doesn't exist.
Manuel
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver
2012-10-03 15:14 ` Manuel Lauss
@ 2012-10-03 15:20 ` Florian Fainelli
0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:20 UTC (permalink / raw)
To: Manuel Lauss
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wednesday 03 October 2012 17:14:21 Manuel Lauss wrote:
> On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> 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.
> >
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > arch/mips/alchemy/common/platform.c | 23 ++++++++++++++++++++++-
> > 1 file changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/mips/alchemy/common/platform.c
b/arch/mips/alchemy/common/platform.c
> > index c0f3ce6..57335a2 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 = {
> > + .need_io_watchdog = 0,
>
> This member doesn't exist.
Thanks to get_maintainers.pl you did not get the patch that adds it, and it
seems like the mailing-list archives did not get it everywhere too, I can
ensure you that's is there, it's actually PATCH 6/25 of this serie.
--
Florian
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 09/25] MIPS: Octeon: use ehci-platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (3 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 07/25] MIPS: Alchemy: use the ehci platform driver Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 16:45 ` David Daney
2012-10-03 15:03 ` [PATCH 14/25] MIPS: PNX8550: use OHCI platform driver Florian Fainelli
` (4 subsequent siblings)
9 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, David Daney,
David S. Miller, Wolfram Sang, linux-mips, linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/cavium-octeon/octeon-platform.c | 43 ++++++++++++++++++++++++++++-
1 file changed, 42 insertions(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 0938df1..539e1bc 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -18,9 +18,11 @@
#include <linux/of_platform.h>
#include <linux/of_fdt.h>
#include <linux/libfdt.h>
+#include <linux/usb/ehci_pdriver.h>
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-rnm-defs.h>
+#include <asm/octeon/cvmx-uctlx-defs.h>
#include <asm/octeon/cvmx-helper.h>
#include <asm/octeon/cvmx-helper-board.h>
@@ -169,6 +171,41 @@ out:
device_initcall(octeon_rng_device_init);
#ifdef CONFIG_USB
+void octeon2_usb_clocks_start(void);
+void octeon2_usb_clocks_stop(void);
+
+static int octeon_ehci_power_on(struct platform_device *pdev)
+{
+ union cvmx_uctlx_ehci_ctl ehci_ctl;
+
+ octeon2_usb_clocks_start();
+
+ ehci_ctl.u64 = cvmx_read_csr(CVMX_UCTLX_EHCI_CTL(0));
+ /* Use 64-bit addressing. */
+ ehci_ctl.s.ehci_64b_addr_en = 1;
+ ehci_ctl.s.l2c_addr_msb = 0;
+ ehci_ctl.s.l2c_buff_emod = 1; /* Byte swapped. */
+ ehci_ctl.s.l2c_desc_emod = 1; /* Byte swapped. */
+ cvmx_write_csr(CVMX_UCTLX_EHCI_CTL(0), ehci_ctl.u64);
+
+ return 0;
+}
+
+static void octeon_ehci_power_off(struct platform_device *pdev)
+{
+ octeon2_usb_clocks_stop();
+}
+
+static struct usb_ehci_pdata octeon_ehci_pdata = {
+#ifdef __BIG_ENDIAN
+ .big_endian_mmio = 1,
+#endif
+ .port_power_on = 1,
+ .power_on = octeon_ehci_power_on,
+ .power_off = octeon_ehci_power_off,
+};
+
+static u64 octeon_ehci_dma_mask = DMA_BIT_MASK(64);
static int __init octeon_ehci_device_init(void)
{
@@ -190,7 +227,7 @@ static int __init octeon_ehci_device_init(void)
if (octeon_is_simulation() || usb_disabled())
return 0; /* No USB in the simulator. */
- pd = platform_device_alloc("octeon-ehci", 0);
+ pd = platform_device_alloc("ehci-platform", 0);
if (!pd) {
ret = -ENOMEM;
goto out;
@@ -207,6 +244,10 @@ static int __init octeon_ehci_device_init(void)
if (ret)
goto fail;
+ pd.dev.platform_data = &octeon_ehci_pdata;
+ pd.dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ pd.dev.dma_mask = &octeon_ehci_dma_mask;
+
ret = platform_device_add(pd);
if (ret)
goto fail;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 09/25] MIPS: Octeon: use ehci-platform driver
2012-10-03 15:03 ` [PATCH 09/25] MIPS: Octeon: use ehci-platform driver Florian Fainelli
@ 2012-10-03 16:45 ` David Daney
2012-10-03 18:30 ` Florian Fainelli
0 siblings, 1 reply; 28+ messages in thread
From: David Daney @ 2012-10-03 16:45 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, David Daney, David S. Miller,
Wolfram Sang, linux-mips, linux-kernel
On 10/03/2012 08:03 AM, Florian Fainelli wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/cavium-octeon/octeon-platform.c | 43 ++++++++++++++++++++++++++++-
> 1 file changed, 42 insertions(+), 1 deletion(-)
NACK.
OCTEON uses device tree now (or as soon as I send in the corresponding
patches), so this would just be churning the code.
David Daney
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 09/25] MIPS: Octeon: use ehci-platform driver
2012-10-03 16:45 ` David Daney
@ 2012-10-03 18:30 ` Florian Fainelli
0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 18:30 UTC (permalink / raw)
To: David Daney
Cc: stern, linux-usb, Ralf Baechle, David Daney, David S. Miller,
Wolfram Sang, linux-mips, linux-kernel
On Wednesday 03 October 2012 09:45:48 David Daney wrote:
> On 10/03/2012 08:03 AM, Florian Fainelli wrote:
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > arch/mips/cavium-octeon/octeon-platform.c | 43
++++++++++++++++++++++++++++-
> > 1 file changed, 42 insertions(+), 1 deletion(-)
>
>
> NACK.
>
> OCTEON uses device tree now (or as soon as I send in the corresponding
> patches), so this would just be churning the code.
Please send the changes to enable Device Tree for EHCI and OHCI, and when both
platform drivers get Device Tree capability we can easily change them.
--
Florian
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 14/25] MIPS: PNX8550: use OHCI platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (4 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 09/25] MIPS: Octeon: use ehci-platform driver Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 15:03 ` [PATCH 14/25] MIPS: PNX8550: useOHCI " Florian Fainelli
` (3 subsequent siblings)
9 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern; +Cc: linux-usb, Florian Fainelli, Ralf Baechle, linux-mips,
linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
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] 28+ messages in thread* [PATCH 14/25] MIPS: PNX8550: useOHCI platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (5 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 14/25] MIPS: PNX8550: use OHCI platform driver Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 15:03 ` [PATCH 18/25] MIPS: Octeon: use OHCI " Florian Fainelli
` (2 subsequent siblings)
9 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern; +Cc: linux-usb, Florian Fainelli, Ralf Baechle, linux-mips,
linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
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] 28+ messages in thread* [PATCH 18/25] MIPS: Octeon: use OHCI platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (6 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 14/25] MIPS: PNX8550: useOHCI " Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 16:47 ` David Daney
2012-10-03 15:03 ` [PATCH 20/25] MIPS: Netlogic: convert to " Florian Fainelli
2012-10-03 15:03 ` [PATCH 24/25] MIPS: Alchemy: use the " Florian Fainelli
9 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, David Daney,
David S. Miller, Wolfram Sang, linux-mips, linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/cavium-octeon/octeon-platform.c | 37 ++++++++++++++++++++++++++++-
1 file changed, 36 insertions(+), 1 deletion(-)
diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
index 539e1bc..07b0a3b 100644
--- a/arch/mips/cavium-octeon/octeon-platform.c
+++ b/arch/mips/cavium-octeon/octeon-platform.c
@@ -19,6 +19,7 @@
#include <linux/of_fdt.h>
#include <linux/libfdt.h>
#include <linux/usb/ehci_pdriver.h>
+#include <linux/usb/ohci_pdriver.h>
#include <asm/octeon/octeon.h>
#include <asm/octeon/cvmx-rnm-defs.h>
@@ -260,6 +261,36 @@ out:
}
device_initcall(octeon_ehci_device_init);
+static int octeon_ohci_power_on(struct platform_device *pdev)
+{
+ union cvmx_uctlx_ohci_ctl ohci_ctl;
+
+ octeon2_usb_clocks_start();
+
+ ohci_ctl.u64 = cvmx_read_csr(CVMX_UCTLX_OHCI_CTL(0));
+ ohci_ctl.s.l2c_addr_msb = 0;
+ ohci_ctl.s.l2c_buff_emod = 1; /* Byte swapped. */
+ ohci_ctl.s.l2c_desc_emod = 1; /* Byte swapped. */
+ cvmx_write_csr(CVMX_UCTLX_OHCI_CTL(0), ohci_ctl.u64);
+
+ return 0;
+}
+
+static octeon_ohci_power_off(struct platform_device *pdev)
+{
+ octeon2_usb_clocks_stop();
+}
+
+static struct usb_ohci_pdata octeon_ohci_pdata = {
+#ifdef __BIG_ENDIAN
+ .big_endian_mmio = 1,
+#endif
+ .power_on = octeon_ohci_power_on,
+ .power_off = octeon_ohci_power_off,
+};
+
+static u32 octeon_ohci_dma_mask = DMA_BIT_MASK(32);
+
static int __init octeon_ohci_device_init(void)
{
struct platform_device *pd;
@@ -280,7 +311,7 @@ static int __init octeon_ohci_device_init(void)
if (octeon_is_simulation() || usb_disabled())
return 0; /* No USB in the simulator. */
- pd = platform_device_alloc("octeon-ohci", 0);
+ pd = platform_device_alloc("ohci-platform", 0);
if (!pd) {
ret = -ENOMEM;
goto out;
@@ -297,6 +328,10 @@ static int __init octeon_ohci_device_init(void)
if (ret)
goto fail;
+ pd.dev.platform_data = &octeon_ohci_pdata;
+ pd.dev.coherent_dma_mask = DMA_BIT_MASK(32);
+ pd.dev.dma_mask = &octeon_ohci_dma_mask;
+
ret = platform_device_add(pd);
if (ret)
goto fail;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 18/25] MIPS: Octeon: use OHCI platform driver
2012-10-03 15:03 ` [PATCH 18/25] MIPS: Octeon: use OHCI " Florian Fainelli
@ 2012-10-03 16:47 ` David Daney
0 siblings, 0 replies; 28+ messages in thread
From: David Daney @ 2012-10-03 16:47 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, David Daney, David S. Miller,
Wolfram Sang, linux-mips, linux-kernel
On 10/03/2012 08:03 AM, Florian Fainelli wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/cavium-octeon/octeon-platform.c | 37 ++++++++++++++++++++++++++++-
> 1 file changed, 36 insertions(+), 1 deletion(-)
>
NACK.
Same reason as for the EHCI one (09/25):
OCTEON uses device tree now (or as soon as I send in the corresponding
patches), so this would just be churning the code.
David Daney
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 20/25] MIPS: Netlogic: convert to use OHCI platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (7 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 18/25] MIPS: Octeon: use OHCI " Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-04 10:53 ` Jonas Gorski
2012-10-03 15:03 ` [PATCH 24/25] MIPS: Alchemy: use the " Florian Fainelli
9 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, Jayachandran C,
linux-mips, linux-kernel
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/netlogic/xlr/platform.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
index 320b7ef..755ddcc 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>
@@ -129,6 +130,8 @@ static struct usb_ehci_pdata xls_usb_ehci_pdata = {
.need_io_watchdog = 1,
};
+static struct usb_ohci_pdata xls_usb_ohci_pdata;
+
static struct platform_device xls_usb_ehci_device =
USB_PLATFORM_DEV("ehci-xls", 0, PIC_USB_IRQ);
static struct platform_device xls_usb_ohci_device_0 =
@@ -183,10 +186,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] 28+ messages in thread* Re: [PATCH 20/25] MIPS: Netlogic: convert to use OHCI platform driver
2012-10-03 15:03 ` [PATCH 20/25] MIPS: Netlogic: convert to " Florian Fainelli
@ 2012-10-04 10:53 ` Jonas Gorski
0 siblings, 0 replies; 28+ messages in thread
From: Jonas Gorski @ 2012-10-04 10:53 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Jayachandran C, linux-mips,
linux-kernel
On 3 October 2012 17:03, Florian Fainelli <florian@openwrt.org> wrote:
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/netlogic/xlr/platform.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
> index 320b7ef..755ddcc 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>
> @@ -129,6 +130,8 @@ static struct usb_ehci_pdata xls_usb_ehci_pdata = {
> .need_io_watchdog = 1,
> };
>
> +static struct usb_ohci_pdata xls_usb_ohci_pdata;
> +
> static struct platform_device xls_usb_ehci_device =
> USB_PLATFORM_DEV("ehci-xls", 0, PIC_USB_IRQ);
> static struct platform_device xls_usb_ohci_device_0 =
And change after the device names of the ohci devices to "ohci-platform"?
> @@ -183,10 +186,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
Jonas
^ permalink raw reply [flat|nested] 28+ messages in thread
* [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
[not found] <1349276601-8371-1-git-send-email-florian@openwrt.org>
` (8 preceding siblings ...)
2012-10-03 15:03 ` [PATCH 20/25] MIPS: Netlogic: convert to " Florian Fainelli
@ 2012-10-03 15:03 ` Florian Fainelli
2012-10-03 15:21 ` Manuel Lauss
2012-10-03 16:07 ` Manuel Lauss
9 siblings, 2 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:03 UTC (permalink / raw)
To: stern
Cc: linux-usb, Florian Fainelli, Ralf Baechle, Manuel Lauss,
Thomas Meyer, David S. Miller, linux-mips, linux-kernel
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.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
arch/mips/alchemy/common/platform.c | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index 57335a2..cd12458 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 },
@@ -192,6 +221,7 @@ static void __init alchemy_setup_usb(int ctype)
pdev->name = "au1xxx-ohci";
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");
@@ -231,6 +261,7 @@ static void __init alchemy_setup_usb(int ctype)
pdev->name = "au1xxx-ohci";
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");
--
1.7.9.5
^ permalink raw reply related [flat|nested] 28+ messages in thread* Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
2012-10-03 15:03 ` [PATCH 24/25] MIPS: Alchemy: use the " Florian Fainelli
@ 2012-10-03 15:21 ` Manuel Lauss
2012-10-03 15:24 ` Florian Fainelli
2012-10-03 16:07 ` Manuel Lauss
1 sibling, 1 reply; 28+ messages in thread
From: Manuel Lauss @ 2012-10-03 15:21 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
> 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.
That was by design -- the base address is far more reliable in identifying the
correct controller instance than the platform device id. There are systems
in the field which don't use the alchemy/common/platform.c file at all.
Manuel
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
2012-10-03 15:21 ` Manuel Lauss
@ 2012-10-03 15:24 ` Florian Fainelli
2012-10-03 15:26 ` Manuel Lauss
0 siblings, 1 reply; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 15:24 UTC (permalink / raw)
To: Manuel Lauss
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wednesday 03 October 2012 17:21:37 Manuel Lauss wrote:
> On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
> > 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.
>
> That was by design -- the base address is far more reliable in identifying
the
> correct controller instance than the platform device id. There are systems
> in the field which don't use the alchemy/common/platform.c file at all.
Fair enough, but the way it was done previously was very error-prone if the
base address changed for any reason in the platform code, and you did not
notice it had to be changed in the OHCI driver too, then it simply did not
work. By systems in the field you mean out of tree users? If so, I'd say that
it's up to you to get them maintained or merged.
--
Florian
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
2012-10-03 15:24 ` Florian Fainelli
@ 2012-10-03 15:26 ` Manuel Lauss
0 siblings, 0 replies; 28+ messages in thread
From: Manuel Lauss @ 2012-10-03 15:26 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wed, Oct 3, 2012 at 5:24 PM, Florian Fainelli <florian@openwrt.org> wrote:
> On Wednesday 03 October 2012 17:21:37 Manuel Lauss wrote:
>> On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
>> > 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.
>>
>> That was by design -- the base address is far more reliable in identifying
> the
>> correct controller instance than the platform device id. There are systems
>> in the field which don't use the alchemy/common/platform.c file at all.
>
> Fair enough, but the way it was done previously was very error-prone if the
> base address changed for any reason in the platform code, and you did not
> notice it had to be changed in the OHCI driver too, then it simply did not
Since the Alchemy line is dead this point is moot.
> work. By systems in the field you mean out of tree users? If so, I'd say that
> it's up to you to get them maintained or merged.
I'm not against the patch at all, quite the contrary.
Manuel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
2012-10-03 15:03 ` [PATCH 24/25] MIPS: Alchemy: use the " Florian Fainelli
2012-10-03 15:21 ` Manuel Lauss
@ 2012-10-03 16:07 ` Manuel Lauss
2012-10-03 16:13 ` Florian Fainelli
1 sibling, 1 reply; 28+ messages in thread
From: Manuel Lauss @ 2012-10-03 16:07 UTC (permalink / raw)
To: Florian Fainelli
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
> 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.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> arch/mips/alchemy/common/platform.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
> index 57335a2..cd12458 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 },
> @@ -192,6 +221,7 @@ static void __init alchemy_setup_usb(int ctype)
> pdev->name = "au1xxx-ohci";
Should be "ohci-platform" (2x). With this change USB works on all my
Alchemy boards.
I'd also suggest to move drivers/usb/host/alchemy-common.c to
arch/mips/alchemy/common/usb.c.
(same for octeon2-common.c)
Manuel
^ permalink raw reply [flat|nested] 28+ messages in thread* Re: [PATCH 24/25] MIPS: Alchemy: use the OHCI platform driver
2012-10-03 16:07 ` Manuel Lauss
@ 2012-10-03 16:13 ` Florian Fainelli
0 siblings, 0 replies; 28+ messages in thread
From: Florian Fainelli @ 2012-10-03 16:13 UTC (permalink / raw)
To: Manuel Lauss
Cc: stern, linux-usb, Ralf Baechle, Manuel Lauss, Thomas Meyer,
David S. Miller, linux-mips, linux-kernel
On Wednesday 03 October 2012 18:07:28 Manuel Lauss wrote:
> On Wed, Oct 3, 2012 at 5:03 PM, Florian Fainelli <florian@openwrt.org> wrote:
> > 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.
> >
> > Signed-off-by: Florian Fainelli <florian@openwrt.org>
> > ---
> > arch/mips/alchemy/common/platform.c | 31
+++++++++++++++++++++++++++++++
> > 1 file changed, 31 insertions(+)
> >
> > diff --git a/arch/mips/alchemy/common/platform.c
b/arch/mips/alchemy/common/platform.c
> > index 57335a2..cd12458 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 },
> > @@ -192,6 +221,7 @@ static void __init alchemy_setup_usb(int ctype)
> > pdev->name = "au1xxx-ohci";
>
> Should be "ohci-platform" (2x). With this change USB works on all my
> Alchemy boards.
Yes, Hauke Merthens just pointed this issue at me.
> I'd also suggest to move drivers/usb/host/alchemy-common.c to
> arch/mips/alchemy/common/usb.c.
> (same for octeon2-common.c)
Ok, sounds good.
--
Florian
^ permalink raw reply [flat|nested] 28+ messages in thread