From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:50
This patch series adds dt support to dwc3 core and fixes few minor
stuff in dwc3-omap glue to get dwc3 working.
While at that it also uses *of_platform* to create the child device
(dwc3-core) and fixes to use runtime API's to enable clock and write
to SYSCONFIG register.
This patch series is developed on:
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git dwc3
These patches were actually tested in
http://gitorious.org/linux-usb/linux-usb/commits/dwc3 dwc3
since all the dependent modules is not yet upstreamed.
Kishon Vijay Abraham I (6):
usb: dwc3-omap: use of_platform API to create dwc3 core pdev
usb: dwc3-omap: use runtime API's to enable clocks
usb: dwc3-omap: Remove explicit writes to SYSCONFIG register
usb: dwc3-omap: Add an API to write to dwc mailbox
usb: dwc3-omap: Minor fixes to get dt working
usb: dwc3: core: add dt support for dwc3 core
Documentation/devicetree/bindings/usb/dwc3.txt | 24 ++++
drivers/usb/dwc3/core.c | 14 +-
drivers/usb/dwc3/dwc3-omap.c | 164 ++++++++++++++----------
include/linux/usb/dwc3-omap.h | 30 +++++
4 files changed, 160 insertions(+), 72 deletions(-)
create mode 100644 Documentation/devicetree/bindings/usb/dwc3.txt
create mode 100644 include/linux/usb/dwc3-omap.h
--
1.7.10.4
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:49
Includes few minor fixes in dwc3-omap like populating the compatible
string in a correct way, extracting the utmi-mode property properly and
changing the index of get_irq since irq of core is removed from hwmod
entry.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:51
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled be of_*, removed the call to dwc3_get_device_id.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 63 +++++++++++++++---------------------------
1 file changed, 22 insertions(+), 41 deletions(-)
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:53
The runtime API's takes care of setting the SYSCONFIG register with
appropriate values. Hence explicit writes to SYSCONFIG register is
removed.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 26 --------------------------
1 file changed, 26 deletions(-)
@@ -318,15 +301,6 @@ static int __devinit dwc3_omap_probe(struct platform_device *pdev)reg=dwc3_omap_readl(omap->base,USBOTGSS_SYSCONFIG);omap->dma_status=!!(reg&USBOTGSS_SYSCONFIG_DMADISABLE);-/* Set No-Idle and No-Standby */-reg&=~(USBOTGSS_STANDBYMODE_MASK-|USBOTGSS_IDLEMODE_MASK);--reg|=(USBOTGSS_SYSCONFIG_STANDBYMODE(USBOTGSS_STANDBYMODE_NO_STANDBY)-|USBOTGSS_SYSCONFIG_IDLEMODE(USBOTGSS_IDLEMODE_NO_IDLE));--dwc3_omap_writel(omap->base,USBOTGSS_SYSCONFIG,reg);-ret=devm_request_irq(dev,omap->irq,dwc3_omap_interrupt,0,"dwc3-omap",omap);if(ret){
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:54
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Kishon Vijay Abraham I <hidden> Date: 2012-09-28 12:53:58
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
to the mailbox regiter.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
2 files changed, 89 insertions(+)
create mode 100644 include/linux/usb/dwc3-omap.h
@@ -0,0 +1,24 @@+SYNOPSIS DWC3 CORE++DWC3- USB3 CONTROLLER++Required properties:+ - compatible: Should be "synopsis,dwc3"+ - reg : Address and length of the register set for the device+ - interrupts: Interrupts used by the dwc3 controller.+ - interrupt-parent: the phandle for the interrupt controller that+ services interrupts for this device.++Optional properties:+ - tx-fifo-resize: determines if the fifo spaces can be reallocated according+ to use-cases.++This is usually a subnode to DWC3 glue to which it is connected.++dwc3 at 4a030000 {+ compatible = "synopsis,dwc3";+ reg = <0x4a030000 0xcfff>;+ interrupts = <0 92 4>+ interrupt-parent = <&gic>+ tx-fifo-resize;+};
From: Felipe Balbi <hidden> Date: 2012-09-28 13:03:02
Hi,
On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled be of_*, removed the call to dwc3_get_device_id.
Signed-off-by: Kishon Vijay Abraham I <redacted>
I think it's best if you split the use of device_for_each_child() from
this patch. So first do the device_for_each_child() part, then later use
of_platform_populate().
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120928/1d7513b6/attachment.sig>
From: Felipe Balbi <hidden> Date: 2012-09-28 13:03:45
Hi,
On Fri, Sep 28, 2012 at 06:23:11PM +0530, Kishon Vijay Abraham I wrote:
quoted hunk
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
1 file changed, 10 insertions(+)
From: Felipe Balbi <hidden> Date: 2012-09-28 13:04:52
Hi,
On Fri, Sep 28, 2012 at 06:23:13PM +0530, Kishon Vijay Abraham I wrote:
quoted hunk
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
to the mailbox regiter.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
2 files changed, 89 insertions(+)
create mode 100644 include/linux/usb/dwc3-omap.h
@@ -0,0 +1,24 @@+SYNOPSIS DWC3 CORE++DWC3- USB3 CONTROLLER++Required properties:+ - compatible: Should be "synopsis,dwc3"
"synopsys" and I think:
- compatible: Must be "synopsys,dwc3" reads a bit better.
+ - reg : Address and length of the register set for the device
+ - interrupts: Interrupts used by the dwc3 controller.
+ - interrupt-parent: the phandle for the interrupt controller that
+ services interrupts for this device.
+
+Optional properties:
+ - tx-fifo-resize: determines if the fifo spaces can be reallocated according
+ to use-cases.
actually, this should read: "determines if the FIFO *has* to be
reallocated.
On OMAP5 ES1 the default value is not good enough and we _must_
reallocate FIFO sizes.
+This is usually a subnode to DWC3 glue to which it is connected.
+
+dwc3 at 4a030000 {
+ compatible = "synopsis,dwc3";
Hi,
On Fri, Sep 28, 2012 at 6:27 PM, Felipe Balbi [off-list ref] wrote:
Hi,
On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
quoted
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled be of_*, removed the call to dwc3_get_device_id.
Signed-off-by: Kishon Vijay Abraham I <redacted>
I think it's best if you split the use of device_for_each_child() from
this patch. So first do the device_for_each_child() part, then later use
of_platform_populate().
I think it's better to have it both together as of_platform_populate
will create the device and the device_for_each_child() part will
delete it on error conditions and during driver removal.
In this patch the first device_for_each_child() comes in error
condition and it is not needed if we have not created the device using
of_platform_populate.
Thanks
Kishon
Hi,
On Fri, Sep 28, 2012 at 6:28 PM, Felipe Balbi [off-list ref] wrote:
Hi,
On Fri, Sep 28, 2012 at 06:23:11PM +0530, Kishon Vijay Abraham I wrote:
quoted
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Hi,
On Fri, Sep 28, 2012 at 6:29 PM, Felipe Balbi [off-list ref] wrote:
Hi,
On Fri, Sep 28, 2012 at 06:23:13PM +0530, Kishon Vijay Abraham I wrote:
quoted
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
to the mailbox regiter.
Signed-off-by: Kishon Vijay Abraham I <redacted>
---
drivers/usb/dwc3/dwc3-omap.c | 59 +++++++++++++++++++++++++++++++++++++++++
include/linux/usb/dwc3-omap.h | 30 +++++++++++++++++++++
2 files changed, 89 insertions(+)
create mode 100644 include/linux/usb/dwc3-omap.h
From: Felipe Balbi <hidden> Date: 2012-10-01 08:56:01
Hi,
On Fri, Sep 28, 2012 at 07:01:04PM +0530, ABRAHAM, KISHON VIJAY wrote:
Hi,
On Fri, Sep 28, 2012 at 6:27 PM, Felipe Balbi [off-list ref] wrote:
quoted
Hi,
On Fri, Sep 28, 2012 at 06:23:10PM +0530, Kishon Vijay Abraham I wrote:
quoted
Used of_platform_populate() to populate dwc3 core platform_device
from device tree data. Since now the allocation of unique device id is
handled be of_*, removed the call to dwc3_get_device_id.
Signed-off-by: Kishon Vijay Abraham I <redacted>
I think it's best if you split the use of device_for_each_child() from
this patch. So first do the device_for_each_child() part, then later use
of_platform_populate().
I think it's better to have it both together as of_platform_populate
will create the device and the device_for_each_child() part will
delete it on error conditions and during driver removal.
In this patch the first device_for_each_child() comes in error
condition and it is not needed if we have not created the device using
of_platform_populate.
We are already parent of a device and we already handle child removal
manually. You can change the current implementation to use
device_for_each_child() and on a later patch introduce
of_platform_populate().
--
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121001/947d0b43/attachment.sig>