Skip to contentSkip to conversation

usb: add support of generic OHCI devices

PATCH New Alexey Brodkin 2 participants 6 messages Dec 14, 2015 – Dec 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

This driver is meant to be used with any OHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc.

Cc Simon Glass <[email protected]>
Cc Marek Vasut <[email protected]>
---
 drivers/usb/host/Kconfig        |  8 ++++++++
 drivers/usb/host/Makefile       |  1 +
 drivers/usb/host/ohci-generic.c | 45 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 54 insertions(+)
 create mode 100644 drivers/usb/host/ohci-generic.c
drivers/usb/host/Kconfig +8 -0
index 0096a2f..39f7185 100644
@@ -26,6 +26,14 @@ config USB_XHCI_UNIPHIER
 
 endif
 
+config USB_OHCI_GENERIC
+	bool "Support for generic OHCI USB controller"
+	depends on OF_CONTROL
+	depends on DM_USB
+	default n
+	---help---
+	  Enables support for generic OHCI controller.
+
 config USB_EHCI_HCD
 	bool "EHCI HCD (USB 2.0) support"
 	---help---
drivers/usb/host/Makefile +1 -0
index 0b4b458..6183b80 100644
@@ -21,6 +21,7 @@ obj-$(CONFIG_USB_OHCI_S3C24XX) += ohci-s3c24xx.o
 obj-$(CONFIG_USB_OHCI_EP93XX) += ohci-ep93xx.o
 obj-$(CONFIG_USB_OHCI_SUNXI) += ohci-sunxi.o
 obj-$(CONFIG_USB_OHCI_LPC32XX) += ohci-lpc32xx.o
+obj-$(CONFIG_USB_OHCI_GENERIC) += ohci-generic.o
 
 # echi
 obj-$(CONFIG_USB_EHCI) += ehci-hcd.o
drivers/usb/host/ohci-generic.c new file +45 -0

45 lines not on this page · raw message

Signature · 1 line
2.4.3
Applied
#1 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

Quoted 8 lines · Alexey Brodkin

This driver is meant to be used with any OHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc.

Cc Simon Glass <[email protected]>
Cc Marek Vasut <[email protected]>
Quoted 7 lines
---
 drivers/usb/host/Kconfig        |  8 ++++++++
 drivers/usb/host/Makefile       |  1 +
 drivers/usb/host/ohci-generic.c | 45
+++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54
insertions(+)
 create mode 100644 drivers/usb/host/ohci-generic.c

Applied, thanks.

btw. I am a bit worried about the compatible string, are those strings used somewhere besides this driver ?

Best regards,
Marek Vasut

#2 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

Hi Marek,

Quoted 17 lines · Marek Vasut
Quoted 8 lines · Alexey Brodkin

This driver is meant to be used with any OHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc.

Cc Simon Glass <[email protected]>
Cc Marek Vasut <[email protected]>
Quoted 7 lines
---
 drivers/usb/host/Kconfig        |  8 ++++++++
 drivers/usb/host/Makefile       |  1 +
 drivers/usb/host/ohci-generic.c | 45
+++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54
insertions(+)
 create mode 100644 drivers/usb/host/ohci-generic.c
Quoted 4 lines

Applied, thanks.

btw. I am a bit worried about the compatible string, are those strings used somewhere besides this driver ?

Well U-Boot we already may see that:
------------------->8--------------------

$ git grep generic-ohci
arch/arm/dts/sun4i-a10.dtsi:650:                        compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/dts/sun4i-a10.dtsi:692:                        compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/dts/sun5i.dtsi:456:                    compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:564:                        compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:586:                        compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:597:                        compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun7i-a20.dtsi:738:                        compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/dts/sun7i-a20.dtsi:780:                        compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/dts/sun8i-a23-a33.dtsi:347:                    compatible = "allwinner,sun8i-a23-ohci", "generic-ohci";
arch/arm/dts/sun8i-h3.dtsi:406:                 compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
arch/arm/dts/sun8i-h3.dtsi:429:                 compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
arch/arm/dts/sun8i-h3.dtsi:452:                 compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
arch/arm/dts/sun9i-a80.dtsi:365:                        compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm/dts/sun9i-a80.dtsi:423:                        compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
------------------->8--------------------

Even though Sunxi might not work without additional things done in ohci-sunxi.c.

And in Linux kernel we see more usages:
------------------->8--------------------

$ git grep generic-ohci arch
arch/arc/boot/dts/axs10x_mb.dtsi:59:                    compatible = "generic-ohci";
arch/arm/boot/dts/hisi-x5hd2.dtsi:462:                  compatible = "generic-ohci";
arch/arm/boot/dts/sun4i-a10.dtsi:703:                   compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/boot/dts/sun4i-a10.dtsi:753:                   compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/boot/dts/sun5i.dtsi:474:                       compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:596:                   compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:618:                   compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:629:                   compatible = "allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun7i-a20.dtsi:787:                   compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/boot/dts/sun7i-a20.dtsi:837:                   compatible = "allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/boot/dts/sun8i-a23-a33.dtsi:337:                       compatible = "allwinner,sun8i-a23-ohci", "generic-ohci";
arch/arm/boot/dts/sun9i-a80.dtsi:377:                   compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm/boot/dts/sun9i-a80.dtsi:435:                   compatible = "allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm64/boot/dts/arm/juno-base.dtsi:156:             compatible = "generic-ohci";
arch/mips/boot/dts/brcm/bcm3384_viper.dtsi:99:                  compatible = "brcm,bcm3384-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm3384_zephyr.dtsi:117:                        compatible = "brcm,bcm3384-ohci", "generic
-ohci";
arch/mips/boot/dts/brcm/bcm6368.dtsi:84:                        compatible = "brcm,bcm6368-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7125.dtsi:131:                       compatible = "brcm,bcm7125-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:252:                       compatible = "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:271:                       compatible = "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:290:                       compatible = "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:309:                       compatible = "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7358.dtsi:236:                       compatible = "brcm,bcm7358-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7360.dtsi:236:                       compatible = "brcm,bcm7360-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7362.dtsi:232:                       compatible = "brcm,bcm7362-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7420.dtsi:157:                       compatible = "brcm,bcm7420-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7420.dtsi:175:                       compatible = "brcm,bcm7420-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:159:                       compatible = "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:178:                       compatible = "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:197:                       compatible = "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:216:                       compatible = "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:173:                       compatible = "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:192:                       compatible = "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:211:                       compatible = "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:230:                       compatible = "brcm,bcm7435-ohci", "generic-ohci";
arch/powerpc/boot/dts/akebono.dts:144:                  compatible = "ibm,476gtr-ohci", "generic-ohci";
arch/powerpc/boot/dts/akebono.dts:151:                  compatible = "ibm,476gtr-ohci", "generic-ohci";
------------------->8--------------------

Note here some boards use pure "generic-ohci" compatibility string.

And essentially I created that patch intentionally,
I'm about to send a patch for Synopsys AXS103 board which will use this driver.

-Alexey

#3 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

Quoted 137 lines · Alexey Brodkin

Hi Marek,

Quoted 18 lines · Marek Vasut
Quoted 17 lines · Alexey Brodkin

This driver is meant to be used with any OHCI-compatible host controller in case if there's no need for platform-specific glue such as setup of controller or PHY's power mode via GPIOs etc.

Cc Simon Glass <[email protected]>
Cc Marek Vasut <[email protected]>

---

 drivers/usb/host/Kconfig        |  8 ++++++++
 drivers/usb/host/Makefile       |  1 +
 drivers/usb/host/ohci-generic.c | 45

+++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+)

Quoted 6 lines
Quoted 1 line
 create mode 100644 drivers/usb/host/ohci-generic.c

Applied, thanks.

btw. I am a bit worried about the compatible string, are those strings used somewhere besides this driver ?

Well U-Boot we already may see that:
------------------->8--------------------

$ git grep generic-ohci
arch/arm/dts/sun4i-a10.dtsi:650:                        compatible =
"allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/dts/sun4i-a10.dtsi:692:                        compatible =
"allwinner,sun4i-a10-ohci", "generic-ohci"; arch/arm/dts/sun5i.dtsi:456:  
                 compatible = "allwinner,sun5i-a13-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:564:                        compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:586:                        compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun6i-a31.dtsi:597:                        compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/dts/sun7i-a20.dtsi:738:                        compatible =
"allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/dts/sun7i-a20.dtsi:780:                        compatible =
"allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/dts/sun8i-a23-a33.dtsi:347:                    compatible =
"allwinner,sun8i-a23-ohci", "generic-ohci";
arch/arm/dts/sun8i-h3.dtsi:406:                 compatible =
"allwinner,sun8i-h3-ohci", "generic-ohci"; arch/arm/dts/sun8i-h3.dtsi:429:
                compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
arch/arm/dts/sun8i-h3.dtsi:452:                 compatible =
"allwinner,sun8i-h3-ohci", "generic-ohci";
arch/arm/dts/sun9i-a80.dtsi:365:                        compatible =
"allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm/dts/sun9i-a80.dtsi:423:                        compatible =
"allwinner,sun9i-a80-ohci", "generic-ohci";
------------------->8--------------------

Even though Sunxi might not work without additional things done in ohci-sunxi.c.

And in Linux kernel we see more usages:
------------------->8--------------------

$ git grep generic-ohci arch
arch/arc/boot/dts/axs10x_mb.dtsi:59:                    compatible =
"generic-ohci"; arch/arm/boot/dts/hisi-x5hd2.dtsi:462:                 
compatible = "generic-ohci"; arch/arm/boot/dts/sun4i-a10.dtsi:703:        
          compatible = "allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/boot/dts/sun4i-a10.dtsi:753:                   compatible =
"allwinner,sun4i-a10-ohci", "generic-ohci";
arch/arm/boot/dts/sun5i.dtsi:474:                       compatible =
"allwinner,sun5i-a13-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:596:                   compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:618:                   compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun6i-a31.dtsi:629:                   compatible =
"allwinner,sun6i-a31-ohci", "generic-ohci";
arch/arm/boot/dts/sun7i-a20.dtsi:787:                   compatible =
"allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/boot/dts/sun7i-a20.dtsi:837:                   compatible =
"allwinner,sun7i-a20-ohci", "generic-ohci";
arch/arm/boot/dts/sun8i-a23-a33.dtsi:337:                       compatible
= "allwinner,sun8i-a23-ohci", "generic-ohci";
arch/arm/boot/dts/sun9i-a80.dtsi:377:                   compatible =
"allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm/boot/dts/sun9i-a80.dtsi:435:                   compatible =
"allwinner,sun9i-a80-ohci", "generic-ohci";
arch/arm64/boot/dts/arm/juno-base.dtsi:156:             compatible =
"generic-ohci"; arch/mips/boot/dts/brcm/bcm3384_viper.dtsi:99:            
     compatible = "brcm,bcm3384-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm3384_zephyr.dtsi:117:                       
compatible = "brcm,bcm3384-ohci", "generic -ohci";
arch/mips/boot/dts/brcm/bcm6368.dtsi:84:                        compatible
= "brcm,bcm6368-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7125.dtsi:131:                       compatible
= "brcm,bcm7125-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:252:                       compatible
= "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:271:                       compatible
= "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:290:                       compatible
= "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7346.dtsi:309:                       compatible
= "brcm,bcm7346-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7358.dtsi:236:                       compatible
= "brcm,bcm7358-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7360.dtsi:236:                       compatible
= "brcm,bcm7360-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7362.dtsi:232:                       compatible
= "brcm,bcm7362-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7420.dtsi:157:                       compatible
= "brcm,bcm7420-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7420.dtsi:175:                       compatible
= "brcm,bcm7420-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:159:                       compatible
= "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:178:                       compatible
= "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:197:                       compatible
= "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7425.dtsi:216:                       compatible
= "brcm,bcm7425-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:173:                       compatible
= "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:192:                       compatible
= "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:211:                       compatible
= "brcm,bcm7435-ohci", "generic-ohci";
arch/mips/boot/dts/brcm/bcm7435.dtsi:230:                       compatible
= "brcm,bcm7435-ohci", "generic-ohci";
arch/powerpc/boot/dts/akebono.dts:144:                  compatible =
"ibm,476gtr-ohci", "generic-ohci"; arch/powerpc/boot/dts/akebono.dts:151: 
                compatible = "ibm,476gtr-ohci", "generic-ohci";
------------------->8--------------------
Quoted 5 lines

Note here some boards use pure "generic-ohci" compatibility string.

And essentially I created that patch intentionally,
I'm about to send a patch for Synopsys AXS103 board which will use this driver.

I was more interested if something outside of U-Boot uses that compat string.

#4 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

Hi Marek,

Quoted 11 lines · Marek Vasut
Quoted 8 lines · Alexey Brodkin

Hi Marek,

Quoted 1 line · Marek Vasut

On Monday, December 14, 2015 at 03:18:50 PM, Alexey Brodkin wrote:

And essentially I created that patch intentionally,
I'm about to send a patch for Synopsys AXS103 board which will use this driver.

I was more interested if something outside of U-Boot uses that compat string.

So then did I answer your question?

-Alexey

#5 lore raw

PATCH 1/1 usb: add support of generic OHCI devices

Quoted 8 lines · Alexey Brodkin

Hi Marek,

Quoted 5 lines · Marek Vasut
Quoted 4 lines · Alexey Brodkin

Hi Marek,

Quoted 1 line · Marek Vasut

On Monday, December 14, 2015 at 03:18:50 PM, Alexey Brodkin wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

And essentially I created that patch intentionally,
I'm about to send a patch for Synopsys AXS103 board which will use this driver.

I was more interested if something outside of U-Boot uses that compat string.

So then did I answer your question?

Ah, yes you did, sorry. I missed the linux kernel dt grep.

Best regards,
Marek Vasut