Skip to contentSkip to conversation

USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile

PATCH Superseded [email protected] 3 participants 6 messages Feb 7, 2011 – Mar 28, 2011 USB

v9 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

PATCH v9 10/10 USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile

From: Tirumala Marri <[email protected]>

Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode.

---
 drivers/Makefile             |    2 +
 drivers/usb/Kconfig          |    3 +-
 drivers/usb/otg/dwc/Kconfig  |   96 ++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/otg/dwc/Makefile |   19 ++++++++
 4 files changed, 119 insertions(+), 1 deletions(-)
drivers/Makefile +2 -0
index 2cbb4b7..3bfc728 100644
@@ -65,6 +65,7 @@ obj-$(CONFIG_PARIDE) 		+= block/paride/
 obj-$(CONFIG_TC)		+= tc/
 obj-$(CONFIG_UWB)		+= uwb/
 obj-$(CONFIG_USB_OTG_UTILS)	+= usb/otg/
+obj-$(CONFIG_USB_DWC_OTG)	+= usb/otg/dwc/
 obj-$(CONFIG_USB)		+= usb/
 obj-$(CONFIG_USB_MUSB_HDRC)	+= usb/musb/
 obj-$(CONFIG_PCI)		+= usb/
@@ -105,6 +106,7 @@ obj-$(CONFIG_ARCH_SHMOBILE)	+= sh/
 ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
 obj-y				+= clocksource/
 endif
+obj-$(CONFIG_DMA_ENGINE)       += dma/
 obj-$(CONFIG_DCA)		+= dca/
 obj-$(CONFIG_HID)		+= hid/
 obj-$(CONFIG_PPC_PS3)		+= ps3/
drivers/usb/Kconfig +2 -1
index 41b6e51..887f702 100644
@@ -55,7 +55,6 @@ config USB_ARCH_HAS_OHCI
 config USB_ARCH_HAS_EHCI
 	boolean
 	default y if PPC_83xx
-	default y if PPC_MPC512x
 	default y if SOC_AU1200
 	default y if ARCH_IXP4XX
 	default y if ARCH_W90X900
@@ -115,6 +114,8 @@ source "drivers/usb/host/Kconfig"
 
 source "drivers/usb/musb/Kconfig"
 
+source "drivers/usb/otg/dwc/Kconfig"
+
 source "drivers/usb/class/Kconfig"
 
 source "drivers/usb/storage/Kconfig"
drivers/usb/otg/dwc/Kconfig new file +96 -0

96 lines not on this page · raw message

drivers/usb/otg/dwc/Makefile new file +19 -0
new file mode 100644
index 0000000..4102add
@@ -0,0 +1,19 @@
+#
+# OTG infrastructure and transceiver drivers
+#
+obj-$(CONFIG_USB_DWC_OTG)	+= dwc.o
+
+dwc-objs := cil.o cil_intr.o param.o
+
+ifeq ($(CONFIG_4xx_SOC),y)
+dwc-objs += apmppc.o
+endif
+
+ifneq ($(CONFIG_DWC_DEVICE_ONLY),y)
+dwc-objs += hcd.o hcd_intr.o \
+		hcd_queue.o
+endif
+
+ifneq ($(CONFIG_DWC_HOST_ONLY),y)
+dwc-objs += pcd.o pcd_intr.o
+endif
Signature · 1 line
1.6.1.rc3
#1 lore raw

Hello.

Quoted 10 lines · [email protected] wrote:

From: Tirumala Marri <[email protected]>

Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode.

[...]

drivers/Makefile obj-$(CONFIG_PARIDE) += block/paride/ · line 68

Quoted 9 lines
drivers/Makefile +1 -0
index 2cbb4b7..3bfc728 100644
@@ -65,6 +65,7 @@ obj-$(CONFIG_PARIDE) 		+= block/paride/
 obj-$(CONFIG_TC)		+= tc/
 obj-$(CONFIG_UWB)		+= uwb/
 obj-$(CONFIG_USB_OTG_UTILS)	+= usb/otg/
+obj-$(CONFIG_USB_DWC_OTG)	+= usb/otg/dwc/

Hardly a good place for this...

drivers/Makefile obj-$(CONFIG_ARCH_SHMOBILE) += sh/ · line 109

Quoted 8 lines
drivers/Makefile +1 -0
 obj-$(CONFIG_USB)		+= usb/
 obj-$(CONFIG_USB_MUSB_HDRC)	+= usb/musb/
 obj-$(CONFIG_PCI)		+= usb/
@@ -105,6 +106,7 @@ obj-$(CONFIG_ARCH_SHMOBILE)	+= sh/
 ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
 obj-y				+= clocksource/
 endif
+obj-$(CONFIG_DMA_ENGINE)       += dma/

How is this change related? Moreover, it's already present several lines ago
in this file...

drivers/usb/Kconfig config USB_ARCH_HAS_OHCI · line 58

Quoted 9 lines
drivers/usb/Kconfig +0 -1
index 41b6e51..887f702 100644
@@ -55,7 +55,6 @@ config USB_ARCH_HAS_OHCI
 config USB_ARCH_HAS_EHCI
 	boolean
 	default y if PPC_83xx
-	default y if PPC_MPC512x

How is this change related?

Quoted 6 lines
drivers/usb/otg/dwc/Kconfig new file +0 -0
new file mode 100644
index 0000000..4d33d72

drivers/usb/otg/dwc/Kconfig line 10

Quoted 10 lines
drivers/usb/otg/dwc/Kconfig new file +10 -0
@@ -0,0 +1,96 @@
+#
+# USB Dual Role (OTG-ready) Controller Drivers
+# for silicon based on Synopsys DesignWare IP
+#
+
+comment "Enable Host or Gadget support for DesignWare OTG controller"
+	depends on !USB && USB_GADGET=n
+
+config USB_DWC_OTG
+	depends on (USB || USB_GADGET)

Parens not necessary.

drivers/usb/otg/dwc/Kconfig line 13

Quoted 3 lines
drivers/usb/otg/dwc/Kconfig new file +3 -0
+	select NOP_USB_XCEIV
+	select USB_OTG_UTILS
+	tristate "Synopsys DWC OTG Controller"

"tristate" should come before "depends" I think -- at least that's how
everybody does...

Quoted 4 lines
drivers/usb/otg/dwc/Kconfig new file +4 -0
+	default USB_GADGET
+	help
+	  This driver provides USB Device Controller support for the
+	  Synopsys DesignWare USB OTG Core used on the AppliedMicro PowerPC SoC.

[...]

Quoted 9 lines
drivers/usb/otg/dwc/Kconfig new file +9 -0
+choice
+	prompt "DWC Mode Selection"
+	depends on USB_DWC_OTG
+	default DWC_HOST_ONLY
+	help
+	  Select the DWC Core in OTG, Host only, or Device only mode.
+
+config DWC_HOST_ONLY
+	bool "DWC Host Only Mode"

drivers/usb/otg/dwc/Kconfig line 44

Quoted 10 lines
drivers/usb/otg/dwc/Kconfig new file +10 -0
+
+config DWC_OTG_MODE
+	bool "DWC OTG Mode"
+	select USB_GADGET_SELECTED
+
+config DWC_DEVICE_ONLY
+	bool "DWC Device Only Mode"
+	select USB_GADGET_SELECTED
+
+endchoice

So this is tri-modal driver after all... how come we place it in
drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/?

drivers/usb/otg/dwc/Kconfig line 75

Quoted 7 lines
drivers/usb/otg/dwc/Kconfig new file +7 -0
+config USB_OTG_WHITELIST
+	bool "Rely on OTG Targeted Peripherals List"
+	depends on !USB_SUSPEND && USB_DWC_OTG
+	default n
+	help
+	  This is the same flag as in ../core/Kconfig.
+	  It is here for easy deselect.

What?! Option duplication isn't allowed, I think.

drivers/usb/otg/dwc/Kconfig line 79

Quoted 3 lines
drivers/usb/otg/dwc/Kconfig new file +3 -0
+config DWC_OTG_REG_LE
+	depends on USB_DWC_OTG
+	bool "DWC Little Endian Register"

"bool" should come before "depends", I think.

drivers/usb/otg/dwc/Kconfig line 86

Quoted 7 lines
drivers/usb/otg/dwc/Kconfig new file +7 -0
+	default y
+	help
+	  OTG core register access is Little-Endian.
+
+config DWC_OTG_FIFO_LE
+	depends on USB_DWC_OTG
+	bool "DWC FIFO Little Endian"

Same here.

drivers/usb/otg/dwc/Kconfig line 93

Quoted 7 lines
drivers/usb/otg/dwc/Kconfig new file +7 -0
+	default n
+	help
+	  OTG core FIFO access is Little-Endian.
+
+config DWC_LIMITED_XFER_SIZE
+	depends on USB_GADGET_DWC_HDRC
+	bool "DWC Endpoint Limited Xfer Size"

... and here.

drivers/usb/otg/dwc/Kconfig line 96

Quoted 3 lines
drivers/usb/otg/dwc/Kconfig new file +3 -0
+	default n
+	help
+	  Bit fields in the Device EP Transfer Size Register is 11 bits.

s/is/are/
Also, such things should better be passed via the platform data, I think.

WBR, Sergei

#2 lore raw

drivers/usb/otg/dwc/Kconfig line 44

Quoted 5 lines
drivers/usb/otg/dwc/Kconfig new file +5 -0
+config DWC_DEVICE_ONLY
+	bool "DWC Device Only Mode"
+	select USB_GADGET_SELECTED
+
+endchoice

So this is tri-modal driver after all... how come we place it in
drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/?

[Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG.

#3 lore raw

Hello.

Quoted 9 lines · Tirumala Marri
Quoted 9 lines

drivers/usb/otg/dwc/Kconfig line 44

Quoted 5 lines
drivers/usb/otg/dwc/Kconfig new file +5 -0
+config DWC_DEVICE_ONLY
+	bool "DWC Device Only Mode"
+	select USB_GADGET_SELECTED
+
+endchoice

So this is tri-modal driver after all... how come we place it in
drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/?

You still have quoting broken in your mailer -- I've fixed it up by hand...

Quoted 2 lines

[Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG.

Well, I know that. So this was a question to Greg...

WBR, Sergei

#4 lore raw
Quoted 14 lines · Sergei Shtylyov

Hello.

Quoted 9 lines · Tirumala Marri
Quoted 9 lines

drivers/usb/otg/dwc/Kconfig line 44

Quoted 5 lines
drivers/usb/otg/dwc/Kconfig new file +5 -0
+config DWC_DEVICE_ONLY
+	bool "DWC Device Only Mode"
+	select USB_GADGET_SELECTED
+
+endchoice

So this is tri-modal driver after all... how come we place it in
drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/?

Quoted 6 lines

You still have quoting broken in your mailer -- I've fixed it up by hand...

Quoted 2 lines

[Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG.

Well, I know that. So this was a question to Greg...

Well, if that's not the right place to put it, Sergei, where do you suggest that it go? drivers/usb/dwc/ ?

thanks,

greg k-h

#5 lore raw

Hello.

Quoted 12 lines · Greg KH
Quoted 11 lines
Quoted 9 lines
Quoted 9 lines

drivers/usb/otg/dwc/Kconfig line 44

Quoted 5 lines
drivers/usb/otg/dwc/Kconfig new file +5 -0
+config DWC_DEVICE_ONLY
+	bool "DWC Device Only Mode"
+	select USB_GADGET_SELECTED
+
+endchoice

So this is tri-modal driver after all... how come we place it in
drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/?

You still have quoting broken in your mailer -- I've fixed it up by hand...

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

[Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG.

Well, I know that. So this was a question to Greg...

Well, if that's not the right place to put it, Sergei, where do you suggest that it go? drivers/usb/dwc/ ?

Exactly.

Quoted 3 lines

thanks,

greg k-h

WBR, Sergei