[PATCH 1/2] usb: doc: dwc3-xilinx: Add devicetree bindings

2015-11-18 Thread Subbaraya Sundeep Bhatta
This patch adds binding doc for Xilinx DWC3 glue driver.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 .../devicetree/bindings/usb/dwc3-xilinx.txt| 33 ++
 1 file changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt 
b/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt
new file mode 100644
index 000..30361b3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt
@@ -0,0 +1,33 @@
+Xilinx SuperSpeed DWC3 USB SoC controller
+
+Required properties:
+- compatible:  Should contain "xlnx,zynqmp-dwc3"
+- clocks:  A list of phandles for the clocks listed in clock-names
+- clock-names: Should contain the following:
+  "bus_clk" Master/Core clock, have to be >= 125 MHz for SS
+operation and >= 60MHz for HS operation
+
+  "ref_clk" Clock source to core during PHY power down
+
+Required child node:
+A child node must exist to represent the core DWC3 IP block. The name of
+the node is not important. The content of the node is defined in dwc3.txt.
+
+Example device node:
+
+   usb@0 {
+   #address-cells = <0x2>;
+   #size-cells = <0x1>;
+   status = "okay";
+   compatible = "xlnx,zynqmp-dwc3";
+   clock-names = "bus_clk" "ref_clk";
+   clocks = <>, <>;
+   ranges;
+
+   dwc3@fe20 {
+   compatible = "snps,dwc3";
+   reg = <0x0 0xfe20 0x4>;
+   interrupts = <0x0 0x41 0x4>;
+   dr_mode = "host";
+   };
+   };
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] usb: dwc3: Add Xilinx ZynqMP platform specific glue layer

2015-11-18 Thread Subbaraya Sundeep Bhatta
This patch adds glue driver for DWC3 core in Xilinx ZynqMP SOC.
DWC3 glue layer is hardware layer around Synopsys DesignWare
USB3 core. Its purpose is to supply Synopsys IP with required clocks
and interface it with the rest of the SoC.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/usb/dwc3/Kconfig   |   8 +++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-xilinx.c | 131 +
 3 files changed, 140 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-xilinx.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 5a42c45..a447879 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -104,4 +104,12 @@ config USB_DWC3_QCOM
  Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside,
  say 'Y' or 'M' if you have one such device.
 
+config USB_DWC3_XILINX
+   tristate "Xilinx ZynqMP Platform"
+   depends on ARCH_ZYNQMP || COMPILE_TEST
+   default USB_DWC3
+   help
+ Xilinx ZynqMP SOC ship with two DesignWare Core USB3 IPs inside,
+ say 'Y' or 'M' if you have one such device.
+
 endif
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index acc951d..50cb626 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -39,3 +39,4 @@ obj-$(CONFIG_USB_DWC3_PCI)+= dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
 obj-$(CONFIG_USB_DWC3_QCOM)+= dwc3-qcom.o
 obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
+obj-$(CONFIG_USB_DWC3_XILINX)  += dwc3-xilinx.o
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
new file mode 100644
index 000..a0dce3e
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -0,0 +1,131 @@
+/**
+ * dwc3-xilinx.c - Xilinx ZynqMP specific Glue layer
+ *
+ * Copyright (C) 2015 Xilinx Inc.
+ *
+ * Author: Subbaraya Sundeep 
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * struct xilinx_dwc3 - dwc3 xilinx glue structure
+ * @dev: device pointer
+ * @ref_clk: clock input to core during PHY power down
+ * @bus_clk: bus clock input to core
+ */
+struct xilinx_dwc3 {
+   struct device   *dev;
+   struct clk  *ref_clk;
+   struct clk  *bus_clk;
+};
+
+/**
+ * xilinx_dwc3_probe - The device probe function for driver initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 for success and error value on failure
+ */
+static int xilinx_dwc3_probe(struct platform_device *pdev)
+{
+   struct device_node *node = pdev->dev.of_node;
+   struct xilinx_dwc3 *xdwc3;
+   int ret;
+
+   xdwc3 = devm_kzalloc(>dev, sizeof(*xdwc3), GFP_KERNEL);
+   if (!xdwc3)
+   return -ENOMEM;
+
+   xdwc3->dev = >dev;
+
+   xdwc3->bus_clk = devm_clk_get(xdwc3->dev, "bus_clk");
+   if (IS_ERR(xdwc3->bus_clk)) {
+   dev_err(xdwc3->dev, "unable to get usb bus clock");
+   return PTR_ERR(xdwc3->bus_clk);
+   }
+
+   xdwc3->ref_clk = devm_clk_get(xdwc3->dev, "ref_clk");
+   if (IS_ERR(xdwc3->ref_clk)) {
+   dev_err(xdwc3->dev, "unable to get usb ref clock");
+   return PTR_ERR(xdwc3->ref_clk);
+   }
+
+   ret = clk_prepare_enable(xdwc3->bus_clk);
+   if (ret)
+   goto err_bus_clk;
+   ret = clk_prepare_enable(xdwc3->ref_clk);
+   if (ret)
+   goto err_ref_clk;
+
+   platform_set_drvdata(pdev, xdwc3);
+
+   ret = of_platform_populate(node, NULL, NULL, xdwc3->dev);
+   if (ret) {
+   dev_err(xdwc3->dev, "failed to create dwc3 core\n");
+   goto err_dwc3_core;
+   }
+
+   return 0;
+
+err_dwc3_core:
+   clk_disable_unprepare(xdwc3->ref_clk);
+err_ref_clk:
+   clk_disable_unprepare(xdwc3->bus_clk);
+err_bus_clk:
+   return ret;
+}
+
+/**
+ * xilinx_dwc3_remove - Releases the resources allocated during initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 always
+ */
+static int xilinx_dwc3_remove(struct platform_device *pdev)
+{
+   struct xilinx_dwc3 *xdwc3 = platform_get_drvdata(pdev);
+
+   of_platform_depopulate(xdwc3->dev);
+
+   clk_disable_unprepare(xdwc3->bus_clk);
+   clk_disable_unprepare(xdwc3->ref_clk);
+   platform_set_drvdata(pdev, 

[PATCH 2/2] usb: dwc3: Add Xilinx ZynqMP platform specific glue layer

2015-11-18 Thread Subbaraya Sundeep Bhatta
This patch adds glue driver for DWC3 core in Xilinx ZynqMP SOC.
DWC3 glue layer is hardware layer around Synopsys DesignWare
USB3 core. Its purpose is to supply Synopsys IP with required clocks
and interface it with the rest of the SoC.

Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
---
 drivers/usb/dwc3/Kconfig   |   8 +++
 drivers/usb/dwc3/Makefile  |   1 +
 drivers/usb/dwc3/dwc3-xilinx.c | 131 +
 3 files changed, 140 insertions(+)
 create mode 100644 drivers/usb/dwc3/dwc3-xilinx.c

diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
index 5a42c45..a447879 100644
--- a/drivers/usb/dwc3/Kconfig
+++ b/drivers/usb/dwc3/Kconfig
@@ -104,4 +104,12 @@ config USB_DWC3_QCOM
  Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside,
  say 'Y' or 'M' if you have one such device.
 
+config USB_DWC3_XILINX
+   tristate "Xilinx ZynqMP Platform"
+   depends on ARCH_ZYNQMP || COMPILE_TEST
+   default USB_DWC3
+   help
+ Xilinx ZynqMP SOC ship with two DesignWare Core USB3 IPs inside,
+ say 'Y' or 'M' if you have one such device.
+
 endif
diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
index acc951d..50cb626 100644
--- a/drivers/usb/dwc3/Makefile
+++ b/drivers/usb/dwc3/Makefile
@@ -39,3 +39,4 @@ obj-$(CONFIG_USB_DWC3_PCI)+= dwc3-pci.o
 obj-$(CONFIG_USB_DWC3_KEYSTONE)+= dwc3-keystone.o
 obj-$(CONFIG_USB_DWC3_QCOM)+= dwc3-qcom.o
 obj-$(CONFIG_USB_DWC3_ST)  += dwc3-st.o
+obj-$(CONFIG_USB_DWC3_XILINX)  += dwc3-xilinx.o
diff --git a/drivers/usb/dwc3/dwc3-xilinx.c b/drivers/usb/dwc3/dwc3-xilinx.c
new file mode 100644
index 000..a0dce3e
--- /dev/null
+++ b/drivers/usb/dwc3/dwc3-xilinx.c
@@ -0,0 +1,131 @@
+/**
+ * dwc3-xilinx.c - Xilinx ZynqMP specific Glue layer
+ *
+ * Copyright (C) 2015 Xilinx Inc.
+ *
+ * Author: Subbaraya Sundeep <sbha...@xilinx.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2  of
+ * the License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * struct xilinx_dwc3 - dwc3 xilinx glue structure
+ * @dev: device pointer
+ * @ref_clk: clock input to core during PHY power down
+ * @bus_clk: bus clock input to core
+ */
+struct xilinx_dwc3 {
+   struct device   *dev;
+   struct clk  *ref_clk;
+   struct clk  *bus_clk;
+};
+
+/**
+ * xilinx_dwc3_probe - The device probe function for driver initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 for success and error value on failure
+ */
+static int xilinx_dwc3_probe(struct platform_device *pdev)
+{
+   struct device_node *node = pdev->dev.of_node;
+   struct xilinx_dwc3 *xdwc3;
+   int ret;
+
+   xdwc3 = devm_kzalloc(>dev, sizeof(*xdwc3), GFP_KERNEL);
+   if (!xdwc3)
+   return -ENOMEM;
+
+   xdwc3->dev = >dev;
+
+   xdwc3->bus_clk = devm_clk_get(xdwc3->dev, "bus_clk");
+   if (IS_ERR(xdwc3->bus_clk)) {
+   dev_err(xdwc3->dev, "unable to get usb bus clock");
+   return PTR_ERR(xdwc3->bus_clk);
+   }
+
+   xdwc3->ref_clk = devm_clk_get(xdwc3->dev, "ref_clk");
+   if (IS_ERR(xdwc3->ref_clk)) {
+   dev_err(xdwc3->dev, "unable to get usb ref clock");
+   return PTR_ERR(xdwc3->ref_clk);
+   }
+
+   ret = clk_prepare_enable(xdwc3->bus_clk);
+   if (ret)
+   goto err_bus_clk;
+   ret = clk_prepare_enable(xdwc3->ref_clk);
+   if (ret)
+   goto err_ref_clk;
+
+   platform_set_drvdata(pdev, xdwc3);
+
+   ret = of_platform_populate(node, NULL, NULL, xdwc3->dev);
+   if (ret) {
+   dev_err(xdwc3->dev, "failed to create dwc3 core\n");
+   goto err_dwc3_core;
+   }
+
+   return 0;
+
+err_dwc3_core:
+   clk_disable_unprepare(xdwc3->ref_clk);
+err_ref_clk:
+   clk_disable_unprepare(xdwc3->bus_clk);
+err_bus_clk:
+   return ret;
+}
+
+/**
+ * xilinx_dwc3_remove - Releases the resources allocated during initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 always
+ */
+static int xilinx_dwc3_remove(struct platform_device *pdev)
+{
+   struct xilinx_dwc3 *xdwc3 = platform_get_drvdata(pdev);
+
+   of_platform_depopulate(xdwc3->dev);
+
+   clk_disable_unprepare(xdwc3->bus_clk);
+   clk_disable_unprepare(xd

[PATCH 1/2] usb: doc: dwc3-xilinx: Add devicetree bindings

2015-11-18 Thread Subbaraya Sundeep Bhatta
This patch adds binding doc for Xilinx DWC3 glue driver.

Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
---
 .../devicetree/bindings/usb/dwc3-xilinx.txt| 33 ++
 1 file changed, 33 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/dwc3-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt 
b/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt
new file mode 100644
index 000..30361b3
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/dwc3-xilinx.txt
@@ -0,0 +1,33 @@
+Xilinx SuperSpeed DWC3 USB SoC controller
+
+Required properties:
+- compatible:  Should contain "xlnx,zynqmp-dwc3"
+- clocks:  A list of phandles for the clocks listed in clock-names
+- clock-names: Should contain the following:
+  "bus_clk" Master/Core clock, have to be >= 125 MHz for SS
+operation and >= 60MHz for HS operation
+
+  "ref_clk" Clock source to core during PHY power down
+
+Required child node:
+A child node must exist to represent the core DWC3 IP block. The name of
+the node is not important. The content of the node is defined in dwc3.txt.
+
+Example device node:
+
+   usb@0 {
+   #address-cells = <0x2>;
+   #size-cells = <0x1>;
+   status = "okay";
+   compatible = "xlnx,zynqmp-dwc3";
+   clock-names = "bus_clk" "ref_clk";
+   clocks = <>, <>;
+   ranges;
+
+   dwc3@fe20 {
+   compatible = "snps,dwc3";
+   reg = <0x0 0xfe20 0x4>;
+   interrupts = <0x0 0x41 0x4>;
+   dr_mode = "host";
+   };
+   };
-- 
2.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-10-28 Thread Subbaraya Sundeep Bhatta
Hi Kishon,

> -Original Message-
> From: Kishon Vijay Abraham I [mailto:kis...@ti.com]
> Sent: Sunday, October 11, 2015 8:11 PM
> To: Punnaiah Choudary Kalluri; ba...@ti.com
> Cc: Rob Herring; Subbaraya Sundeep Bhatta; Peter Chen;
> devicet...@vger.kernel.org; gre...@linuxfoundation.org; linux-
> u...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org
> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver
> 
> Hi,
> 
> On Sunday 11 October 2015 04:45 PM, punnaiah choudary kalluri wrote:
> > On Wed, Sep 30, 2015 at 9:48 PM, Felipe Balbi  wrote:
> >> On Thu, Sep 24, 2015 at 11:18:01AM -0500, Rob Herring wrote:
> >>> On Thu, Sep 24, 2015 at 4:26 AM, Subbaraya Sundeep Bhatta
> >>>  wrote:
> >>>> Hi Peter,
> >>>>
> >>>>> -Original Message-----
> >>>>> From: Peter Chen [mailto:peter.c...@freescale.com]
> >>>>> Sent: Thursday, September 24, 2015 2:41 PM
> >>>>> To: Subbaraya Sundeep Bhatta
> >>>>> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> >>>>> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> >>>>> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya
> >>>>> Sundeep Bhatta; linux-arm-ker...@lists.infradead.org
> >>>>> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI
> >>>>> platform driver
> >>>>>
> >>>>> On Wed, Sep 23, 2015 at 06:24:01PM +0530, Subbaraya Sundeep
> Bhatta
> >>>>> wrote:
> >>>>>> This patch adds binding doc info for generic ULPI PHYs platform
> >>>>>> driver.
> >>>>>>
> >>>>>> Signed-off-by: Subbaraya Sundeep Bhatta 
> >>>>>> ---
> >>>>>>  .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34
> >>>>> 
> >>>>>>  1 files changed, 34 insertions(+), 0 deletions(-)  create mode
> >>>>>> 100644
> >>>>>> Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>>
> >>>>>> diff --git
> >>>>>> a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> new file mode 100644
> >>>>>> index 000..7b8cbb4
> >>>>>> --- /dev/null
> >>>>>> +++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> @@ -0,0 +1,34 @@
> >>>>>> +Platform driver for generic ULPI PHYs
> >>>>>> +
> >>>>>> +Required properties:
> >>>>>> +- compatible   : Should be "ulpi-phy"
> >>>>>> +- reg  : Physical base address and size of the USB
> >>>>>> + controller registers map to which this PHY
> >>>>>> + is connected.
> >>>>>> +- view-port: Should contain viewport register offset 
> >>>>>> of the
> >>>>>> + USB controller to which this PHY is
> >>>>>> +connected Optional
> >>>>>> +properties:
> >>>>>> +- drv-vbus : required if turning VBUS on/off has to be driven
> >>>>>> + by writing to PHY. This feature depends on board
> >>>>>> + design.
> >>>>>> +
> >>>>>> +Example:
> >>>>>> +Below example shows the PHY binding for Chipidea USB controller
> >>>>>> +which has ulpi viewport register at 0x0170
> >>>>>> +
> >>>>>> +   usb_phy0: phy0 {
> >>>>>> +   compatible = "ulpi-phy";
> >>>>>> +   reg = <0xe0002000 0x1000>;
> >>>>>> +   view-port = <0x0170>;
> >>>>>> +   drv-vbus;
> >>>>>> +   };
> >>>>>> +
> >>>>>> +   usb0: usb@e0002000 {
> >>>>>> +compatible = "chipidea,usb2";
> >>>>>> +interrupt-parent = <>;
&g

RE: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-10-28 Thread Subbaraya Sundeep Bhatta
Hi Kishon,

> -Original Message-
> From: Kishon Vijay Abraham I [mailto:kis...@ti.com]
> Sent: Sunday, October 11, 2015 8:11 PM
> To: Punnaiah Choudary Kalluri; ba...@ti.com
> Cc: Rob Herring; Subbaraya Sundeep Bhatta; Peter Chen;
> devicet...@vger.kernel.org; gre...@linuxfoundation.org; linux-
> u...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm-
> ker...@lists.infradead.org
> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver
> 
> Hi,
> 
> On Sunday 11 October 2015 04:45 PM, punnaiah choudary kalluri wrote:
> > On Wed, Sep 30, 2015 at 9:48 PM, Felipe Balbi <ba...@ti.com> wrote:
> >> On Thu, Sep 24, 2015 at 11:18:01AM -0500, Rob Herring wrote:
> >>> On Thu, Sep 24, 2015 at 4:26 AM, Subbaraya Sundeep Bhatta
> >>> <subbaraya.sundeep.bha...@xilinx.com> wrote:
> >>>> Hi Peter,
> >>>>
> >>>>> -Original Message-
> >>>>> From: Peter Chen [mailto:peter.c...@freescale.com]
> >>>>> Sent: Thursday, September 24, 2015 2:41 PM
> >>>>> To: Subbaraya Sundeep Bhatta
> >>>>> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> >>>>> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> >>>>> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya
> >>>>> Sundeep Bhatta; linux-arm-ker...@lists.infradead.org
> >>>>> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI
> >>>>> platform driver
> >>>>>
> >>>>> On Wed, Sep 23, 2015 at 06:24:01PM +0530, Subbaraya Sundeep
> Bhatta
> >>>>> wrote:
> >>>>>> This patch adds binding doc info for generic ULPI PHYs platform
> >>>>>> driver.
> >>>>>>
> >>>>>> Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
> >>>>>> ---
> >>>>>>  .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34
> >>>>> 
> >>>>>>  1 files changed, 34 insertions(+), 0 deletions(-)  create mode
> >>>>>> 100644
> >>>>>> Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>>
> >>>>>> diff --git
> >>>>>> a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> new file mode 100644
> >>>>>> index 000..7b8cbb4
> >>>>>> --- /dev/null
> >>>>>> +++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >>>>>> @@ -0,0 +1,34 @@
> >>>>>> +Platform driver for generic ULPI PHYs
> >>>>>> +
> >>>>>> +Required properties:
> >>>>>> +- compatible   : Should be "ulpi-phy"
> >>>>>> +- reg  : Physical base address and size of the USB
> >>>>>> + controller registers map to which this PHY
> >>>>>> + is connected.
> >>>>>> +- view-port: Should contain viewport register offset 
> >>>>>> of the
> >>>>>> + USB controller to which this PHY is
> >>>>>> +connected Optional
> >>>>>> +properties:
> >>>>>> +- drv-vbus : required if turning VBUS on/off has to be driven
> >>>>>> + by writing to PHY. This feature depends on board
> >>>>>> + design.
> >>>>>> +
> >>>>>> +Example:
> >>>>>> +Below example shows the PHY binding for Chipidea USB controller
> >>>>>> +which has ulpi viewport register at 0x0170
> >>>>>> +
> >>>>>> +   usb_phy0: phy0 {
> >>>>>> +   compatible = "ulpi-phy";
> >>>>>> +   reg = <0xe0002000 0x1000>;
> >>>>>> +   view-port = <0x0170>;
> >>>>>> +   drv-vbus;
> >>>>>> +   };
> >>>>>> +
> >>>>>> +   usb0: usb@e0002000 {
> >>>>>> +compatible = "chipidea,usb2";
&g

RE: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-09-24 Thread Subbaraya Sundeep Bhatta
Hi Peter,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Thursday, September 24, 2015 2:41 PM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya Sundeep Bhatta;
> linux-arm-ker...@lists.infradead.org
> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver
> 
> On Wed, Sep 23, 2015 at 06:24:01PM +0530, Subbaraya Sundeep Bhatta
> wrote:
> > This patch adds binding doc info for generic ULPI PHYs platform
> > driver.
> >
> > Signed-off-by: Subbaraya Sundeep Bhatta 
> > ---
> >  .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34
> 
> >  1 files changed, 34 insertions(+), 0 deletions(-)  create mode 100644
> > Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >
> > diff --git
> > a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > new file mode 100644
> > index 000..7b8cbb4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > @@ -0,0 +1,34 @@
> > +Platform driver for generic ULPI PHYs
> > +
> > +Required properties:
> > +- compatible   : Should be "ulpi-phy"
> > +- reg  : Physical base address and size of the USB
> > + controller registers map to which this PHY
> > + is connected.
> > +- view-port: Should contain viewport register offset of the
> > + USB controller to which this PHY is connected Optional
> > +properties:
> > +- drv-vbus : required if turning VBUS on/off has to be driven
> > + by writing to PHY. This feature depends on board
> > + design.
> > +
> > +Example:
> > +Below example shows the PHY binding for Chipidea USB controller which
> > +has ulpi viewport register at 0x0170
> > +
> > +   usb_phy0: phy0 {
> > +   compatible = "ulpi-phy";
> > +   reg = <0xe0002000 0x1000>;
> > +   view-port = <0x0170>;
> > +   drv-vbus;
> > +   };
> > +
> > +   usb0: usb@e0002000 {
> > +compatible = "chipidea,usb2";
> > +interrupt-parent = <>;
> > +interrupts = <0 21 4>;
> > +reg = <0xe0002000 0x1000>;
> 
> Although just call devm_ioremap twice for the same register region does not
> cause any errors, I am not sure if it will has other potential problems. Cc: 
> arm
> list.

Yes Peter I was also in doubt to call devm_ioremap twice for same register 
region.
devm_ioremap_resource complained hence modified to devm_ioremap. Thanks for
adding arm-list.

Sundeep
> 
> > +phy_type = "ulpi";
> > +   dr_mode = "host";
> > +   usb-phy = <_phy0>;
> > +};
> > --
> > 1.7.1
> >
> 
> --
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI PHYs

2015-09-24 Thread Subbaraya Sundeep Bhatta
Hi Peter,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Thursday, September 24, 2015 2:37 PM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya Sundeep Bhatta
> Subject: Re: [RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI
> PHYs
> 
> On Wed, Sep 23, 2015 at 06:24:33PM +0530, Subbaraya Sundeep Bhatta
> wrote:
> > Based on board design USB controller needs explicit software access to
> > ULPI PHY for controlling VBUS. This patch adds platform driver support
> > for generic ULPI PHYs and provides a USB2 PHY device to controllers.
> >
> > Signed-off-by: Subbaraya Sundeep Bhatta 
> > ---
> >  drivers/usb/phy/Kconfig |   12 +++
> >  drivers/usb/phy/Makefile|1 +
> >  drivers/usb/phy/phy-platform-ulpi.c |  143
> > +++
> >  3 files changed, 156 insertions(+), 0 deletions(-)  create mode
> > 100644 drivers/usb/phy/phy-platform-ulpi.c
> >
> > diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index
> > 7d3beee..2956ad4 100644
> > --- a/drivers/usb/phy/Kconfig
> > +++ b/drivers/usb/phy/Kconfig
> > @@ -201,6 +201,18 @@ config USB_RCAR_PHY
> >   To compile this driver as a module, choose M here: the
> >   module will be called phy-rcar-usb.
> >
> > +config USB_PLATFORM_ULPI_PHY
> > +   tristate "Platform driver support for ULPI PHYs"
> > +   depends on ARCH_ZYNQ || COMPILE_TEST
> 
> If you want this as a common driver, drop platform dependency please.

Ok I will remove depends on.
> 
> > +   select USB_PHY
> > +   select USB_ULPI_VIEWPORT
> > +   help
> > + Say Y here to add support for the Platform driver for ULPI PHYs.
> > + This adds platform driver support for all generic ULPI PHYs and is
> > + typically used if usb controller driver needs explicit access to PHY.
> > +
> > + To compile this driver as a module, choose M here.
> > +
> >  config USB_ULPI
> > bool "Generic ULPI Transceiver Driver"
> > depends on ARM || ARM64
> > diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index
> > 19c0dcc..8431b6b 100644
> > --- a/drivers/usb/phy/Makefile
> > +++ b/drivers/usb/phy/Makefile
> > @@ -24,6 +24,7 @@ obj-$(CONFIG_USB_QCOM_8X16_PHY)   += phy-
> qcom-8x16-usb.o
> >  obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
> >  obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
> >  obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
> > +obj-$(CONFIG_USB_PLATFORM_ULPI_PHY)+= phy-platform-ulpi.o
> >  obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
> >  obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o
> >  obj-$(CONFIG_KEYSTONE_USB_PHY) += phy-keystone.o
> > diff --git a/drivers/usb/phy/phy-platform-ulpi.c
> > b/drivers/usb/phy/phy-platform-ulpi.c
> > new file mode 100644
> > index 000..fb89363
> > --- /dev/null
> > +++ b/drivers/usb/phy/phy-platform-ulpi.c
> > @@ -0,0 +1,143 @@
> > +/*
> > + * Platform driver for generic ULPI PHYs.
> > + *
> > + * Copyright (C) 2015 Xilinx, Inc.
> > + *
> > + * Author: Subbaraya Sundeep 
> > + *
> > + * This program is free software; you can redistribute it
> > + * and/or modify it under the terms of the GNU General Public
> > + * License as published by the Free Software Foundation;
> > + * either version 2 of the License, or (at your option) any
> > + * later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/**
> > + * struct ulpi_phy - The ULPI PHY
> > + * @usb_phy: pointer to usb phy
> > + * @regs: base address of USB controller to which PHY is connected
> > + * @vp_offset: ulpi viewport register offset of USB controller
> > + * @flags: initial required settings of PHY  */
> > +
> > +struct ulpi_phy {
> > +   struct usb_phy  *usb_phy;
> > +   void __iomem *regs;
> > +   unsigned int vp_offset;
> > +   unsigned int flags;
> > +};
> > +
> > +/**
> > + * usbphy_set_vbus - Sets VBUS by writing to PHY.
> > + * @phy: pointer to PHY
> > + * @on: 1 - turn on VBUS
> > + * 0 - turn off VBUS
> > + * Return: 0 for success and error value on failure  */ static int
> > +usbphy_set_vbus(stru

RE: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-09-24 Thread Subbaraya Sundeep Bhatta
Hi Peter,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Thursday, September 24, 2015 2:41 PM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya Sundeep Bhatta;
> linux-arm-ker...@lists.infradead.org
> Subject: Re: [RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver
> 
> On Wed, Sep 23, 2015 at 06:24:01PM +0530, Subbaraya Sundeep Bhatta
> wrote:
> > This patch adds binding doc info for generic ULPI PHYs platform
> > driver.
> >
> > Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
> > ---
> >  .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34
> 
> >  1 files changed, 34 insertions(+), 0 deletions(-)  create mode 100644
> > Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> >
> > diff --git
> > a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > new file mode 100644
> > index 000..7b8cbb4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
> > @@ -0,0 +1,34 @@
> > +Platform driver for generic ULPI PHYs
> > +
> > +Required properties:
> > +- compatible   : Should be "ulpi-phy"
> > +- reg  : Physical base address and size of the USB
> > + controller registers map to which this PHY
> > + is connected.
> > +- view-port: Should contain viewport register offset of the
> > + USB controller to which this PHY is connected Optional
> > +properties:
> > +- drv-vbus : required if turning VBUS on/off has to be driven
> > + by writing to PHY. This feature depends on board
> > + design.
> > +
> > +Example:
> > +Below example shows the PHY binding for Chipidea USB controller which
> > +has ulpi viewport register at 0x0170
> > +
> > +   usb_phy0: phy0 {
> > +   compatible = "ulpi-phy";
> > +   reg = <0xe0002000 0x1000>;
> > +   view-port = <0x0170>;
> > +   drv-vbus;
> > +   };
> > +
> > +   usb0: usb@e0002000 {
> > +compatible = "chipidea,usb2";
> > +interrupt-parent = <>;
> > +interrupts = <0 21 4>;
> > +reg = <0xe0002000 0x1000>;
> 
> Although just call devm_ioremap twice for the same register region does not
> cause any errors, I am not sure if it will has other potential problems. Cc: 
> arm
> list.

Yes Peter I was also in doubt to call devm_ioremap twice for same register 
region.
devm_ioremap_resource complained hence modified to devm_ioremap. Thanks for
adding arm-list.

Sundeep
> 
> > +phy_type = "ulpi";
> > +   dr_mode = "host";
> > +   usb-phy = <_phy0>;
> > +};
> > --
> > 1.7.1
> >
> 
> --
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI PHYs

2015-09-24 Thread Subbaraya Sundeep Bhatta
Hi Peter,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Thursday, September 24, 2015 2:37 PM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; devicet...@vger.kernel.org; kis...@ti.com;
> gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Punnaiah Choudary Kalluri; Subbaraya Sundeep Bhatta
> Subject: Re: [RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI
> PHYs
> 
> On Wed, Sep 23, 2015 at 06:24:33PM +0530, Subbaraya Sundeep Bhatta
> wrote:
> > Based on board design USB controller needs explicit software access to
> > ULPI PHY for controlling VBUS. This patch adds platform driver support
> > for generic ULPI PHYs and provides a USB2 PHY device to controllers.
> >
> > Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
> > ---
> >  drivers/usb/phy/Kconfig |   12 +++
> >  drivers/usb/phy/Makefile|1 +
> >  drivers/usb/phy/phy-platform-ulpi.c |  143
> > +++
> >  3 files changed, 156 insertions(+), 0 deletions(-)  create mode
> > 100644 drivers/usb/phy/phy-platform-ulpi.c
> >
> > diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index
> > 7d3beee..2956ad4 100644
> > --- a/drivers/usb/phy/Kconfig
> > +++ b/drivers/usb/phy/Kconfig
> > @@ -201,6 +201,18 @@ config USB_RCAR_PHY
> >   To compile this driver as a module, choose M here: the
> >   module will be called phy-rcar-usb.
> >
> > +config USB_PLATFORM_ULPI_PHY
> > +   tristate "Platform driver support for ULPI PHYs"
> > +   depends on ARCH_ZYNQ || COMPILE_TEST
> 
> If you want this as a common driver, drop platform dependency please.

Ok I will remove depends on.
> 
> > +   select USB_PHY
> > +   select USB_ULPI_VIEWPORT
> > +   help
> > + Say Y here to add support for the Platform driver for ULPI PHYs.
> > + This adds platform driver support for all generic ULPI PHYs and is
> > + typically used if usb controller driver needs explicit access to PHY.
> > +
> > + To compile this driver as a module, choose M here.
> > +
> >  config USB_ULPI
> > bool "Generic ULPI Transceiver Driver"
> > depends on ARM || ARM64
> > diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile index
> > 19c0dcc..8431b6b 100644
> > --- a/drivers/usb/phy/Makefile
> > +++ b/drivers/usb/phy/Makefile
> > @@ -24,6 +24,7 @@ obj-$(CONFIG_USB_QCOM_8X16_PHY)   += phy-
> qcom-8x16-usb.o
> >  obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
> >  obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
> >  obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
> > +obj-$(CONFIG_USB_PLATFORM_ULPI_PHY)+= phy-platform-ulpi.o
> >  obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
> >  obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o
> >  obj-$(CONFIG_KEYSTONE_USB_PHY) += phy-keystone.o
> > diff --git a/drivers/usb/phy/phy-platform-ulpi.c
> > b/drivers/usb/phy/phy-platform-ulpi.c
> > new file mode 100644
> > index 000..fb89363
> > --- /dev/null
> > +++ b/drivers/usb/phy/phy-platform-ulpi.c
> > @@ -0,0 +1,143 @@
> > +/*
> > + * Platform driver for generic ULPI PHYs.
> > + *
> > + * Copyright (C) 2015 Xilinx, Inc.
> > + *
> > + * Author: Subbaraya Sundeep <sbha...@xilinx.com>
> > + *
> > + * This program is free software; you can redistribute it
> > + * and/or modify it under the terms of the GNU General Public
> > + * License as published by the Free Software Foundation;
> > + * either version 2 of the License, or (at your option) any
> > + * later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +/**
> > + * struct ulpi_phy - The ULPI PHY
> > + * @usb_phy: pointer to usb phy
> > + * @regs: base address of USB controller to which PHY is connected
> > + * @vp_offset: ulpi viewport register offset of USB controller
> > + * @flags: initial required settings of PHY  */
> > +
> > +struct ulpi_phy {
> > +   struct usb_phy  *usb_phy;
> > +   void __iomem *regs;
> > +   unsigned int vp_offset;
> > +   unsigned int flags;
> > +};
> > +
> > +/**
> > + * usbphy_set_vbus - Sets VBUS by writing to PHY.
> > + * @phy: pointer to PHY
> > + * @on: 1 - turn on VBUS
> > + * 0 - turn off VBUS
> > + * Return: 0 for success and error value on failure  

[RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI PHYs

2015-09-23 Thread Subbaraya Sundeep Bhatta
Based on board design USB controller needs explicit software
access to ULPI PHY for controlling VBUS. This patch adds platform
driver support for generic ULPI PHYs and provides a USB2 PHY device
to controllers.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/usb/phy/Kconfig |   12 +++
 drivers/usb/phy/Makefile|1 +
 drivers/usb/phy/phy-platform-ulpi.c |  143 +++
 3 files changed, 156 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/phy/phy-platform-ulpi.c

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 7d3beee..2956ad4 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -201,6 +201,18 @@ config USB_RCAR_PHY
  To compile this driver as a module, choose M here: the
  module will be called phy-rcar-usb.
 
+config USB_PLATFORM_ULPI_PHY
+   tristate "Platform driver support for ULPI PHYs"
+   depends on ARCH_ZYNQ || COMPILE_TEST
+   select USB_PHY
+   select USB_ULPI_VIEWPORT
+   help
+ Say Y here to add support for the Platform driver for ULPI PHYs.
+ This adds platform driver support for all generic ULPI PHYs and is
+ typically used if usb controller driver needs explicit access to PHY.
+ 
+ To compile this driver as a module, choose M here.
+
 config USB_ULPI
bool "Generic ULPI Transceiver Driver"
depends on ARM || ARM64
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 19c0dcc..8431b6b 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_USB_QCOM_8X16_PHY)   += phy-qcom-8x16-usb.o
 obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
 obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
 obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
+obj-$(CONFIG_USB_PLATFORM_ULPI_PHY)+= phy-platform-ulpi.o
 obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
 obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o
 obj-$(CONFIG_KEYSTONE_USB_PHY) += phy-keystone.o
diff --git a/drivers/usb/phy/phy-platform-ulpi.c 
b/drivers/usb/phy/phy-platform-ulpi.c
new file mode 100644
index 000..fb89363
--- /dev/null
+++ b/drivers/usb/phy/phy-platform-ulpi.c
@@ -0,0 +1,143 @@
+/*
+ * Platform driver for generic ULPI PHYs.
+ *
+ * Copyright (C) 2015 Xilinx, Inc.
+ *
+ * Author: Subbaraya Sundeep 
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * struct ulpi_phy - The ULPI PHY
+ * @usb_phy: pointer to usb phy
+ * @regs: base address of USB controller to which PHY is connected
+ * @vp_offset: ulpi viewport register offset of USB controller
+ * @flags: initial required settings of PHY
+ */
+
+struct ulpi_phy {
+   struct usb_phy  *usb_phy;
+   void __iomem *regs;
+   unsigned int vp_offset;
+   unsigned int flags;
+};
+
+/**
+ * usbphy_set_vbus - Sets VBUS by writing to PHY.
+ * @phy: pointer to PHY
+ * @on: 1 - turn on VBUS
+ * 0 - turn off VBUS
+ * Return: 0 for success and error value on failure
+ */
+static int usbphy_set_vbus(struct usb_phy *phy, int on)
+{
+   unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);
+
+   flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT);
+
+   if (on) {
+   if (phy->flags & ULPI_OTG_DRVVBUS)
+   flags |= ULPI_OTG_CTRL_DRVVBUS;
+
+   if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
+   flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
+   }
+
+   return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
+}
+
+/**
+ * ulpi_phy_probe - The device probe function for driver initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 for success and error value on failure
+ */
+static int ulpi_phy_probe(struct platform_device *pdev)
+{
+   struct device_node *np = pdev->dev.of_node;
+   struct resource *res;
+   struct ulpi_phy *uphy;
+   bool flag;
+   int ret;
+
+   uphy = devm_kzalloc(>dev, sizeof(*uphy), GFP_KERNEL);
+   if (!uphy)
+   return -ENOMEM;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   uphy->regs = devm_ioremap(>dev, res->start, resource_size(res));
+   if (IS_ERR(uphy->regs))
+   return PTR_ERR(uphy->regs);
+
+   ret = of_property_read_u32(np, "view-port", >vp_offset);
+   if (IS_ERR(uphy->regs)) {
+   dev_err(>dev, "view-port register not specified\n");
+   return PTR_ERR(uphy->regs);
+   }
+
+   flag = of_property_read_bool(np, "drv-

[RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-09-23 Thread Subbaraya Sundeep Bhatta
This patch adds binding doc info for generic ULPI PHYs
platform driver.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34 
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt

diff --git a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt 
b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
new file mode 100644
index 000..7b8cbb4
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
@@ -0,0 +1,34 @@
+Platform driver for generic ULPI PHYs
+
+Required properties:
+- compatible   : Should be "ulpi-phy"
+- reg  : Physical base address and size of the USB
+ controller registers map to which this PHY
+ is connected.
+- view-port: Should contain viewport register offset of the
+ USB controller to which this PHY is connected
+Optional properties:
+- drv-vbus : required if turning VBUS on/off has to be driven
+ by writing to PHY. This feature depends on board
+ design.
+
+Example:
+Below example shows the PHY binding for Chipidea USB controller which has
+ulpi viewport register at 0x0170
+
+   usb_phy0: phy0 {
+   compatible = "ulpi-phy";
+   reg = <0xe0002000 0x1000>;
+   view-port = <0x0170>;
+   drv-vbus;
+   };
+
+   usb0: usb@e0002000 {
+compatible = "chipidea,usb2";
+interrupt-parent = <>;
+interrupts = <0 21 4>;
+reg = <0xe0002000 0x1000>;
+phy_type = "ulpi";
+   dr_mode = "host";
+   usb-phy = <_phy0>;
+};
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-23 Thread Subbaraya Sundeep Bhatta
Please ignore got the answer.

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Wednesday, September 23, 2015 12:29 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: 'Nathan Sullivan'; 'sundeep subbaraya'; 'robh...@kernel.org';
> 'pawel.m...@arm.com'; 'Mark Rutland'; 'ijc+devicet...@hellion.org.uk'; 'Kumar
> Gala'; 'Greg Kroah-Hartman'; 'devicet...@vger.kernel.org'; 'linux-
> ker...@vger.kernel.org'; 'linux-...@vger.kernel.org'
> Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> Hi Nathan and Peter,
> 
> Is this patch applied? Please let me know I have some other patches to send on
> top of this.
> 
> Thanks,
> Sundeep
> 
> > -Original Message-
> > From: Subbaraya Sundeep Bhatta
> > Sent: Tuesday, September 01, 2015 12:22 PM
> > To: 'Peter Chen'; Punnaiah Choudary Kalluri
> > Cc: Nathan Sullivan; sundeep subbaraya; robh...@kernel.org;
> > pawel.m...@arm.com; Mark Rutland; ijc+devicet...@hellion.org.uk; Kumar
> > Gala; Greg Kroah-Hartman; devicet...@vger.kernel.org; linux-
> > ker...@vger.kernel.org; linux-...@vger.kernel.org
> > Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> >
> > Hi,
> >
> > > -Original Message-
> > > From: Peter Chen [mailto:peter.c...@freescale.com]
> > > Sent: Monday, August 31, 2015 7:59 AM
> > > To: Punnaiah Choudary Kalluri
> > > Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> > > robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> > > ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> > > devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > > u...@vger.kernel.org
> > > Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform
> > > data
> > >
> > > On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> > > wrote:
> > > > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
> > >  wrote:
> > > > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > > > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > > > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > > > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> > > kalluri wrote:
> > > > >> > > > Hi,
> > > > >> > > >
> > > > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
> > >  wrote:
> > > > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> > > subbaraya wrote:
> > > > >> > > > >> Hi,
> > > > >> > > > >>
> > > > >> > > > >>
> > > > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
> > >  wrote:
> > > > >> > > > >> > The Xilinx Zynq udc does not need the
> > > > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > > > >> > > > >> > platform data.  Add platform data specific to the Zynq 
> > > > >> > > > >> > udc.
> > > > >> > > > >> >
> > > > >> > > > >> > Based on a patch by the same name from the Xilinx
> > > > >> > > > >> > vendor
> > > tree.
> > > > >> > > > >>
> > > > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > > > >> > > > >> Xilinx tree as temporary fix and I did not debug
> > > > >> > > > >> further why UDC works only when streaming is enabled.
> > > > >> > > > >> Probably this is right time to post my question here.
> > > > >> > > > >> I was expecting like:
> > > > >> > > > >> Streaming disabled - both low bandwidth and high
> > > > >> > > > >> bandwidth systems should work fine Streaming enabled -
> > > > >> > > > >> only for high bandwidth systems but this is not the
> > > > >> > > > >> case, Zynq UDC works only when Streaming is enabled.
> > > > >> > > > >> Please correct me if I am wrong.
> > > > >> > > > >
> > > > >> > > > > You 

RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-23 Thread Subbaraya Sundeep Bhatta
Hi Nathan and Peter,

Is this patch applied? Please let me know I have some other patches to send on 
top of this.

Thanks,
Sundeep

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Tuesday, September 01, 2015 12:22 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: Nathan Sullivan; sundeep subbaraya; robh...@kernel.org;
> pawel.m...@arm.com; Mark Rutland; ijc+devicet...@hellion.org.uk; Kumar
> Gala; Greg Kroah-Hartman; devicet...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-...@vger.kernel.org
> Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> Hi,
> 
> > -Original Message-
> > From: Peter Chen [mailto:peter.c...@freescale.com]
> > Sent: Monday, August 31, 2015 7:59 AM
> > To: Punnaiah Choudary Kalluri
> > Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> > robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> > ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> > devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > u...@vger.kernel.org
> > Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> >
> > On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> > wrote:
> > > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
> >  wrote:
> > > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> > kalluri wrote:
> > > >> > > > Hi,
> > > >> > > >
> > > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
> >  wrote:
> > > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> > subbaraya wrote:
> > > >> > > > >> Hi,
> > > >> > > > >>
> > > >> > > > >>
> > > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
> >  wrote:
> > > >> > > > >> > The Xilinx Zynq udc does not need the
> > > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > > >> > > > >> > platform data.  Add platform data specific to the Zynq udc.
> > > >> > > > >> >
> > > >> > > > >> > Based on a patch by the same name from the Xilinx
> > > >> > > > >> > vendor
> > tree.
> > > >> > > > >>
> > > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > > >> > > > >> Xilinx tree as temporary fix and I did not debug further
> > > >> > > > >> why UDC works only when streaming is enabled.
> > > >> > > > >> Probably this is right time to post my question here.
> > > >> > > > >> I was expecting like:
> > > >> > > > >> Streaming disabled - both low bandwidth and high
> > > >> > > > >> bandwidth systems should work fine Streaming enabled -
> > > >> > > > >> only for high bandwidth systems but this is not the
> > > >> > > > >> case, Zynq UDC works only when Streaming is enabled.
> > > >> > > > >> Please correct me if I am wrong.
> > > >> > > > >
> > > >> > > > > You are right, stream mode disabled should work at anytime.
> > > >> > > > > It is so strange why zynq UDC only works when stream mode
> > > >> > > > > is
> > enabled.
> > > >> > > >
> > > >> > > > I am referring the section 8.5.2 in Synopsys usb 2.0 HS
> > > >> > > > controllervDoc 2.20a,  this is what it says about SDIS
> > > >> > > > (streaming mode disable option)
> > > >> > > >
> > > >> > > > Before activating this mode, the user must check if the TX
> > > >> > > > latency buffers per endpoint are able to accommodate at
> > > >> > > > least one entire maximum size packet. The RX buffer size
> > > >> > > > must, at least, double the TX buffer size per endpoint. To
> > > >> > >

[RFC PATCH 1/2] usb: doc: Add bindings for ULPI platform driver

2015-09-23 Thread Subbaraya Sundeep Bhatta
This patch adds binding doc info for generic ULPI PHYs
platform driver.

Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
---
 .../devicetree/bindings/usb/ulpi-platform-phy.txt  |   34 
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt

diff --git a/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt 
b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
new file mode 100644
index 000..7b8cbb4
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/ulpi-platform-phy.txt
@@ -0,0 +1,34 @@
+Platform driver for generic ULPI PHYs
+
+Required properties:
+- compatible   : Should be "ulpi-phy"
+- reg  : Physical base address and size of the USB
+ controller registers map to which this PHY
+ is connected.
+- view-port: Should contain viewport register offset of the
+ USB controller to which this PHY is connected
+Optional properties:
+- drv-vbus : required if turning VBUS on/off has to be driven
+ by writing to PHY. This feature depends on board
+ design.
+
+Example:
+Below example shows the PHY binding for Chipidea USB controller which has
+ulpi viewport register at 0x0170
+
+   usb_phy0: phy0 {
+   compatible = "ulpi-phy";
+   reg = <0xe0002000 0x1000>;
+   view-port = <0x0170>;
+   drv-vbus;
+   };
+
+   usb0: usb@e0002000 {
+compatible = "chipidea,usb2";
+interrupt-parent = <>;
+interrupts = <0 21 4>;
+reg = <0xe0002000 0x1000>;
+phy_type = "ulpi";
+   dr_mode = "host";
+   usb-phy = <_phy0>;
+};
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH 2/2] usb: phy: Add platform driver support for ULPI PHYs

2015-09-23 Thread Subbaraya Sundeep Bhatta
Based on board design USB controller needs explicit software
access to ULPI PHY for controlling VBUS. This patch adds platform
driver support for generic ULPI PHYs and provides a USB2 PHY device
to controllers.

Signed-off-by: Subbaraya Sundeep Bhatta <sbha...@xilinx.com>
---
 drivers/usb/phy/Kconfig |   12 +++
 drivers/usb/phy/Makefile|1 +
 drivers/usb/phy/phy-platform-ulpi.c |  143 +++
 3 files changed, 156 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/phy/phy-platform-ulpi.c

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 7d3beee..2956ad4 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -201,6 +201,18 @@ config USB_RCAR_PHY
  To compile this driver as a module, choose M here: the
  module will be called phy-rcar-usb.
 
+config USB_PLATFORM_ULPI_PHY
+   tristate "Platform driver support for ULPI PHYs"
+   depends on ARCH_ZYNQ || COMPILE_TEST
+   select USB_PHY
+   select USB_ULPI_VIEWPORT
+   help
+ Say Y here to add support for the Platform driver for ULPI PHYs.
+ This adds platform driver support for all generic ULPI PHYs and is
+ typically used if usb controller driver needs explicit access to PHY.
+ 
+ To compile this driver as a module, choose M here.
+
 config USB_ULPI
bool "Generic ULPI Transceiver Driver"
depends on ARM || ARM64
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 19c0dcc..8431b6b 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_USB_QCOM_8X16_PHY)   += phy-qcom-8x16-usb.o
 obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
 obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
 obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
+obj-$(CONFIG_USB_PLATFORM_ULPI_PHY)+= phy-platform-ulpi.o
 obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
 obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o
 obj-$(CONFIG_KEYSTONE_USB_PHY) += phy-keystone.o
diff --git a/drivers/usb/phy/phy-platform-ulpi.c 
b/drivers/usb/phy/phy-platform-ulpi.c
new file mode 100644
index 000..fb89363
--- /dev/null
+++ b/drivers/usb/phy/phy-platform-ulpi.c
@@ -0,0 +1,143 @@
+/*
+ * Platform driver for generic ULPI PHYs.
+ *
+ * Copyright (C) 2015 Xilinx, Inc.
+ *
+ * Author: Subbaraya Sundeep <sbha...@xilinx.com>
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/**
+ * struct ulpi_phy - The ULPI PHY
+ * @usb_phy: pointer to usb phy
+ * @regs: base address of USB controller to which PHY is connected
+ * @vp_offset: ulpi viewport register offset of USB controller
+ * @flags: initial required settings of PHY
+ */
+
+struct ulpi_phy {
+   struct usb_phy  *usb_phy;
+   void __iomem *regs;
+   unsigned int vp_offset;
+   unsigned int flags;
+};
+
+/**
+ * usbphy_set_vbus - Sets VBUS by writing to PHY.
+ * @phy: pointer to PHY
+ * @on: 1 - turn on VBUS
+ * 0 - turn off VBUS
+ * Return: 0 for success and error value on failure
+ */
+static int usbphy_set_vbus(struct usb_phy *phy, int on)
+{
+   unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL);
+
+   flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT);
+
+   if (on) {
+   if (phy->flags & ULPI_OTG_DRVVBUS)
+   flags |= ULPI_OTG_CTRL_DRVVBUS;
+
+   if (phy->flags & ULPI_OTG_DRVVBUS_EXT)
+   flags |= ULPI_OTG_CTRL_DRVVBUS_EXT;
+   }
+
+   return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL);
+}
+
+/**
+ * ulpi_phy_probe - The device probe function for driver initialization.
+ * @pdev: pointer to the platform device structure.
+ *
+ * Return: 0 for success and error value on failure
+ */
+static int ulpi_phy_probe(struct platform_device *pdev)
+{
+   struct device_node *np = pdev->dev.of_node;
+   struct resource *res;
+   struct ulpi_phy *uphy;
+   bool flag;
+   int ret;
+
+   uphy = devm_kzalloc(>dev, sizeof(*uphy), GFP_KERNEL);
+   if (!uphy)
+   return -ENOMEM;
+
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+   uphy->regs = devm_ioremap(>dev, res->start, resource_size(res));
+   if (IS_ERR(uphy->regs))
+   return PTR_ERR(uphy->regs);
+
+   ret = of_property_read_u32(np, "view-port", >vp_offset);
+   if (IS_ERR(uphy->regs)) {
+   dev_err(>dev, "view-port register not specified\n");
+   return PTR_ERR(uphy->regs);
+   

RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-23 Thread Subbaraya Sundeep Bhatta
Hi Nathan and Peter,

Is this patch applied? Please let me know I have some other patches to send on 
top of this.

Thanks,
Sundeep

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Tuesday, September 01, 2015 12:22 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: Nathan Sullivan; sundeep subbaraya; robh...@kernel.org;
> pawel.m...@arm.com; Mark Rutland; ijc+devicet...@hellion.org.uk; Kumar
> Gala; Greg Kroah-Hartman; devicet...@vger.kernel.org; linux-
> ker...@vger.kernel.org; linux-...@vger.kernel.org
> Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> Hi,
> 
> > -Original Message-
> > From: Peter Chen [mailto:peter.c...@freescale.com]
> > Sent: Monday, August 31, 2015 7:59 AM
> > To: Punnaiah Choudary Kalluri
> > Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> > robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> > ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> > devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > u...@vger.kernel.org
> > Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> >
> > On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> > wrote:
> > > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
> > <peter.c...@freescale.com> wrote:
> > > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> > kalluri wrote:
> > > >> > > > Hi,
> > > >> > > >
> > > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
> > <peter.c...@freescale.com> wrote:
> > > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> > subbaraya wrote:
> > > >> > > > >> Hi,
> > > >> > > > >>
> > > >> > > > >>
> > > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
> > <nathan.sulli...@ni.com> wrote:
> > > >> > > > >> > The Xilinx Zynq udc does not need the
> > > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > > >> > > > >> > platform data.  Add platform data specific to the Zynq udc.
> > > >> > > > >> >
> > > >> > > > >> > Based on a patch by the same name from the Xilinx
> > > >> > > > >> > vendor
> > tree.
> > > >> > > > >>
> > > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > > >> > > > >> Xilinx tree as temporary fix and I did not debug further
> > > >> > > > >> why UDC works only when streaming is enabled.
> > > >> > > > >> Probably this is right time to post my question here.
> > > >> > > > >> I was expecting like:
> > > >> > > > >> Streaming disabled - both low bandwidth and high
> > > >> > > > >> bandwidth systems should work fine Streaming enabled -
> > > >> > > > >> only for high bandwidth systems but this is not the
> > > >> > > > >> case, Zynq UDC works only when Streaming is enabled.
> > > >> > > > >> Please correct me if I am wrong.
> > > >> > > > >
> > > >> > > > > You are right, stream mode disabled should work at anytime.
> > > >> > > > > It is so strange why zynq UDC only works when stream mode
> > > >> > > > > is
> > enabled.
> > > >> > > >
> > > >> > > > I am referring the section 8.5.2 in Synopsys usb 2.0 HS
> > > >> > > > controllervDoc 2.20a,  this is what it says about SDIS
> > > >> > > > (streaming mode disable option)
> > > >> > > >
> > > >> > > > Before activating this mode, the user must check if the TX
> > > >> > > > latency buffers per endpoint are able to accommodate at
> > > >> > > > least one entire maximum size packet. The RX buffer size
> > > >> > > > m

RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-23 Thread Subbaraya Sundeep Bhatta
Please ignore got the answer.

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Wednesday, September 23, 2015 12:29 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: 'Nathan Sullivan'; 'sundeep subbaraya'; 'robh...@kernel.org';
> 'pawel.m...@arm.com'; 'Mark Rutland'; 'ijc+devicet...@hellion.org.uk'; 'Kumar
> Gala'; 'Greg Kroah-Hartman'; 'devicet...@vger.kernel.org'; 'linux-
> ker...@vger.kernel.org'; 'linux-...@vger.kernel.org'
> Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> Hi Nathan and Peter,
> 
> Is this patch applied? Please let me know I have some other patches to send on
> top of this.
> 
> Thanks,
> Sundeep
> 
> > -Original Message-
> > From: Subbaraya Sundeep Bhatta
> > Sent: Tuesday, September 01, 2015 12:22 PM
> > To: 'Peter Chen'; Punnaiah Choudary Kalluri
> > Cc: Nathan Sullivan; sundeep subbaraya; robh...@kernel.org;
> > pawel.m...@arm.com; Mark Rutland; ijc+devicet...@hellion.org.uk; Kumar
> > Gala; Greg Kroah-Hartman; devicet...@vger.kernel.org; linux-
> > ker...@vger.kernel.org; linux-...@vger.kernel.org
> > Subject: RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> >
> > Hi,
> >
> > > -Original Message-
> > > From: Peter Chen [mailto:peter.c...@freescale.com]
> > > Sent: Monday, August 31, 2015 7:59 AM
> > > To: Punnaiah Choudary Kalluri
> > > Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> > > robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> > > ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> > > devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> > > u...@vger.kernel.org
> > > Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform
> > > data
> > >
> > > On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> > > wrote:
> > > > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
> > > <peter.c...@freescale.com> wrote:
> > > > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > > > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > > > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > > > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> > > kalluri wrote:
> > > > >> > > > Hi,
> > > > >> > > >
> > > > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
> > > <peter.c...@freescale.com> wrote:
> > > > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> > > subbaraya wrote:
> > > > >> > > > >> Hi,
> > > > >> > > > >>
> > > > >> > > > >>
> > > > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
> > > <nathan.sulli...@ni.com> wrote:
> > > > >> > > > >> > The Xilinx Zynq udc does not need the
> > > > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > > > >> > > > >> > platform data.  Add platform data specific to the Zynq 
> > > > >> > > > >> > udc.
> > > > >> > > > >> >
> > > > >> > > > >> > Based on a patch by the same name from the Xilinx
> > > > >> > > > >> > vendor
> > > tree.
> > > > >> > > > >>
> > > > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > > > >> > > > >> Xilinx tree as temporary fix and I did not debug
> > > > >> > > > >> further why UDC works only when streaming is enabled.
> > > > >> > > > >> Probably this is right time to post my question here.
> > > > >> > > > >> I was expecting like:
> > > > >> > > > >> Streaming disabled - both low bandwidth and high
> > > > >> > > > >> bandwidth systems should work fine Streaming enabled -
> > > > >> > > > >> only for high bandwidth systems but this is not the
> > > > >> > > > >> case, Zynq UDC works only when Streaming is enabled.
> > > > >> > > > >> Please correct me if I am wrong.
> >

RE: Chipidea ULPI driver

2015-09-11 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Friday, September 11, 2015 5:04 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: ba...@ti.com; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> Greg Kroah-Hartman (gre...@linuxfoundation.org); kis...@ti.com
> Subject: RE: Chipidea ULPI driver
>
> Hi,
>
> > -Original Message-
> > From: Peter Chen [mailto:peter.c...@freescale.com]
> > Sent: Friday, September 11, 2015 6:52 AM
> > To: Punnaiah Choudary Kalluri
> > Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; linux-...@vger.kernel.org;
> > linux- ker...@vger.kernel.org; Greg Kroah-Hartman
> > (gre...@linuxfoundation.org); kis...@ti.com
> > Subject: Re: Chipidea ULPI driver
> >
> > On Thu, Sep 10, 2015 at 02:57:49PM +, Punnaiah Choudary Kalluri
> wrote:
> > >
> > >
> > > > -Original Message-
> > > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > > Sent: Thursday, September 10, 2015 8:14 PM
> > > > To: Subbaraya Sundeep Bhatta
> > > > Cc: Peter Chen; ba...@ti.com; linux-...@vger.kernel.org; linux-
> > > > ker...@vger.kernel.org; Greg Kroah-Hartman
> > > > (gre...@linuxfoundation.org); kis...@ti.com; Punnaiah Choudary
> > > > Kalluri
> > > > Subject: Re: Chipidea ULPI driver
> > > >
> > > > (break your lines at 80-characters)
> > > >
> > > > On Thu, Sep 10, 2015 at 12:44:58PM +, Subbaraya Sundeep Bhatta
> > wrote:
> > > > > Hi Peter,
> > > > >
> > > > > We are using NOP transceiver driver for USB3320 ULPI PHY with
> > > > > ChipIdea controller.
> > > > >
> > > > > Recently we found that one of the boards (zedboard) requires PHY
> > > > > register access to set VBUS.
> > > > >
> > > > > Note that our local driver we had before migrating to ChipIdea
> > > > > driver calls otg_ulpi_create with flags  ULPI_OTG_DRVVBUS |
> > > > > ULPI_OTG_DRVVBUS_EXT so that VBUS is enabled at initialization.
> > > > >
> > > > > Can you please let me know how to do this with ChipIdea case? I
> > > > > see the following solutions:
> > > > >
> > > > > 1. Write ULPI driver for USB3320 similar to tusb1210.
> > > >
> > > > this
> > >
> > > How about extending the phy-ulpi driver to use it as platform driver?
> > > So that boards that are using the ulpi compatible phy and driving
> > > vbus from the phy can use this driver.
> > >
> >
> > Yes, you can improve phy-ulpi driver, and it can not depend on NOP
> > transceiver driver.
>
> AFAIK phy-ulpi.c is just exporting functions and not registering to platform 
> bus
> since it is not connected to SOC bus. I don't think we can create platform 
> driver
> for this. I have read TUSB1210 data sheet and it is similar to USB3320 with no
> additional SOC bus connection and has only ULPI interface.

Sorry, I mean external PHY here.

> So it should register to ULPI bus which is in kernel recently. I will make 
> changes
> to chipidea similar to dwc3(adding ulpi.c) and write driver similar to 
> tusb1210.c.
> Is that okay?
>
> Thanks,
> Sundeep
>
> >
> > --
> >
> > Best Regards,
> > Peter Chen


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Chipidea ULPI driver

2015-09-11 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Friday, September 11, 2015 6:52 AM
> To: Punnaiah Choudary Kalluri
> Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Greg Kroah-Hartman (gre...@linuxfoundation.org);
> kis...@ti.com
> Subject: Re: Chipidea ULPI driver
> 
> On Thu, Sep 10, 2015 at 02:57:49PM +, Punnaiah Choudary Kalluri wrote:
> >
> >
> > > -Original Message-
> > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > Sent: Thursday, September 10, 2015 8:14 PM
> > > To: Subbaraya Sundeep Bhatta
> > > Cc: Peter Chen; ba...@ti.com; linux-...@vger.kernel.org; linux-
> > > ker...@vger.kernel.org; Greg Kroah-Hartman
> > > (gre...@linuxfoundation.org); kis...@ti.com; Punnaiah Choudary
> > > Kalluri
> > > Subject: Re: Chipidea ULPI driver
> > >
> > > (break your lines at 80-characters)
> > >
> > > On Thu, Sep 10, 2015 at 12:44:58PM +, Subbaraya Sundeep Bhatta
> wrote:
> > > > Hi Peter,
> > > >
> > > > We are using NOP transceiver driver for USB3320 ULPI PHY with
> > > > ChipIdea controller.
> > > >
> > > > Recently we found that one of the boards (zedboard) requires PHY
> > > > register access to set VBUS.
> > > >
> > > > Note that our local driver we had before migrating to ChipIdea
> > > > driver calls otg_ulpi_create with flags  ULPI_OTG_DRVVBUS |
> > > > ULPI_OTG_DRVVBUS_EXT so that VBUS is enabled at initialization.
> > > >
> > > > Can you please let me know how to do this with ChipIdea case? I
> > > > see the following solutions:
> > > >
> > > > 1. Write ULPI driver for USB3320 similar to tusb1210.
> > >
> > > this
> >
> > How about extending the phy-ulpi driver to use it as platform driver?
> > So that boards that are using the ulpi compatible phy and driving vbus
> > from the phy can use this driver.
> >
> 
> Yes, you can improve phy-ulpi driver, and it can not depend on NOP transceiver
> driver.

AFAIK phy-ulpi.c is just exporting functions and not registering to platform
bus since it is not connected to SOC bus. I don't think we can create platform
driver for this. I have read TUSB1210 data sheet and it is similar to USB3320
with no additional SOC bus connection and has only ULPI interface. 
So it should register to ULPI bus which is in kernel recently. I will make
changes to chipidea similar to dwc3(adding ulpi.c) and write driver similar
to tusb1210.c. Is that okay?

Thanks,
Sundeep

> 
> --
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Chipidea ULPI driver

2015-09-11 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Friday, September 11, 2015 5:04 PM
> To: 'Peter Chen'; Punnaiah Choudary Kalluri
> Cc: ba...@ti.com; linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> Greg Kroah-Hartman (gre...@linuxfoundation.org); kis...@ti.com
> Subject: RE: Chipidea ULPI driver
>
> Hi,
>
> > -Original Message-
> > From: Peter Chen [mailto:peter.c...@freescale.com]
> > Sent: Friday, September 11, 2015 6:52 AM
> > To: Punnaiah Choudary Kalluri
> > Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; linux-...@vger.kernel.org;
> > linux- ker...@vger.kernel.org; Greg Kroah-Hartman
> > (gre...@linuxfoundation.org); kis...@ti.com
> > Subject: Re: Chipidea ULPI driver
> >
> > On Thu, Sep 10, 2015 at 02:57:49PM +, Punnaiah Choudary Kalluri
> wrote:
> > >
> > >
> > > > -Original Message-
> > > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > > Sent: Thursday, September 10, 2015 8:14 PM
> > > > To: Subbaraya Sundeep Bhatta
> > > > Cc: Peter Chen; ba...@ti.com; linux-...@vger.kernel.org; linux-
> > > > ker...@vger.kernel.org; Greg Kroah-Hartman
> > > > (gre...@linuxfoundation.org); kis...@ti.com; Punnaiah Choudary
> > > > Kalluri
> > > > Subject: Re: Chipidea ULPI driver
> > > >
> > > > (break your lines at 80-characters)
> > > >
> > > > On Thu, Sep 10, 2015 at 12:44:58PM +, Subbaraya Sundeep Bhatta
> > wrote:
> > > > > Hi Peter,
> > > > >
> > > > > We are using NOP transceiver driver for USB3320 ULPI PHY with
> > > > > ChipIdea controller.
> > > > >
> > > > > Recently we found that one of the boards (zedboard) requires PHY
> > > > > register access to set VBUS.
> > > > >
> > > > > Note that our local driver we had before migrating to ChipIdea
> > > > > driver calls otg_ulpi_create with flags  ULPI_OTG_DRVVBUS |
> > > > > ULPI_OTG_DRVVBUS_EXT so that VBUS is enabled at initialization.
> > > > >
> > > > > Can you please let me know how to do this with ChipIdea case? I
> > > > > see the following solutions:
> > > > >
> > > > > 1. Write ULPI driver for USB3320 similar to tusb1210.
> > > >
> > > > this
> > >
> > > How about extending the phy-ulpi driver to use it as platform driver?
> > > So that boards that are using the ulpi compatible phy and driving
> > > vbus from the phy can use this driver.
> > >
> >
> > Yes, you can improve phy-ulpi driver, and it can not depend on NOP
> > transceiver driver.
>
> AFAIK phy-ulpi.c is just exporting functions and not registering to platform 
> bus
> since it is not connected to SOC bus. I don't think we can create platform 
> driver
> for this. I have read TUSB1210 data sheet and it is similar to USB3320 with no
> additional SOC bus connection and has only ULPI interface.

Sorry, I mean external PHY here.

> So it should register to ULPI bus which is in kernel recently. I will make 
> changes
> to chipidea similar to dwc3(adding ulpi.c) and write driver similar to 
> tusb1210.c.
> Is that okay?
>
> Thanks,
> Sundeep
>
> >
> > --
> >
> > Best Regards,
> > Peter Chen


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Chipidea ULPI driver

2015-09-11 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Friday, September 11, 2015 6:52 AM
> To: Punnaiah Choudary Kalluri
> Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Greg Kroah-Hartman (gre...@linuxfoundation.org);
> kis...@ti.com
> Subject: Re: Chipidea ULPI driver
> 
> On Thu, Sep 10, 2015 at 02:57:49PM +, Punnaiah Choudary Kalluri wrote:
> >
> >
> > > -Original Message-
> > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > Sent: Thursday, September 10, 2015 8:14 PM
> > > To: Subbaraya Sundeep Bhatta
> > > Cc: Peter Chen; ba...@ti.com; linux-...@vger.kernel.org; linux-
> > > ker...@vger.kernel.org; Greg Kroah-Hartman
> > > (gre...@linuxfoundation.org); kis...@ti.com; Punnaiah Choudary
> > > Kalluri
> > > Subject: Re: Chipidea ULPI driver
> > >
> > > (break your lines at 80-characters)
> > >
> > > On Thu, Sep 10, 2015 at 12:44:58PM +, Subbaraya Sundeep Bhatta
> wrote:
> > > > Hi Peter,
> > > >
> > > > We are using NOP transceiver driver for USB3320 ULPI PHY with
> > > > ChipIdea controller.
> > > >
> > > > Recently we found that one of the boards (zedboard) requires PHY
> > > > register access to set VBUS.
> > > >
> > > > Note that our local driver we had before migrating to ChipIdea
> > > > driver calls otg_ulpi_create with flags  ULPI_OTG_DRVVBUS |
> > > > ULPI_OTG_DRVVBUS_EXT so that VBUS is enabled at initialization.
> > > >
> > > > Can you please let me know how to do this with ChipIdea case? I
> > > > see the following solutions:
> > > >
> > > > 1. Write ULPI driver for USB3320 similar to tusb1210.
> > >
> > > this
> >
> > How about extending the phy-ulpi driver to use it as platform driver?
> > So that boards that are using the ulpi compatible phy and driving vbus
> > from the phy can use this driver.
> >
> 
> Yes, you can improve phy-ulpi driver, and it can not depend on NOP transceiver
> driver.

AFAIK phy-ulpi.c is just exporting functions and not registering to platform
bus since it is not connected to SOC bus. I don't think we can create platform
driver for this. I have read TUSB1210 data sheet and it is similar to USB3320
with no additional SOC bus connection and has only ULPI interface. 
So it should register to ULPI bus which is in kernel recently. I will make
changes to chipidea similar to dwc3(adding ulpi.c) and write driver similar
to tusb1210.c. Is that okay?

Thanks,
Sundeep

> 
> --
> 
> Best Regards,
> Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-01 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Monday, August 31, 2015 7:59 AM
> To: Punnaiah Choudary Kalluri
> Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> u...@vger.kernel.org
> Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> wrote:
> > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
>  wrote:
> > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> kalluri wrote:
> > >> > > > Hi,
> > >> > > >
> > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
>  wrote:
> > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> subbaraya wrote:
> > >> > > > >> Hi,
> > >> > > > >>
> > >> > > > >>
> > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
>  wrote:
> > >> > > > >> > The Xilinx Zynq udc does not need the
> > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > >> > > > >> > platform data.  Add platform data specific to the Zynq udc.
> > >> > > > >> >
> > >> > > > >> > Based on a patch by the same name from the Xilinx vendor
> tree.
> > >> > > > >>
> > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > >> > > > >> Xilinx tree as temporary fix and I did not debug further
> > >> > > > >> why UDC works only when streaming is enabled.
> > >> > > > >> Probably this is right time to post my question here.
> > >> > > > >> I was expecting like:
> > >> > > > >> Streaming disabled - both low bandwidth and high bandwidth
> > >> > > > >> systems should work fine Streaming enabled - only for high
> > >> > > > >> bandwidth systems but this is not the case, Zynq UDC works
> > >> > > > >> only when Streaming is enabled.
> > >> > > > >> Please correct me if I am wrong.
> > >> > > > >
> > >> > > > > You are right, stream mode disabled should work at anytime.
> > >> > > > > It is so strange why zynq UDC only works when stream mode is
> enabled.
> > >> > > >
> > >> > > > I am referring the section 8.5.2 in Synopsys usb 2.0 HS
> > >> > > > controllervDoc 2.20a,  this is what it says about SDIS
> > >> > > > (streaming mode disable option)
> > >> > > >
> > >> > > > Before activating this mode, the user must check if the TX
> > >> > > > latency buffers per endpoint are able to accommodate at least
> > >> > > > one entire maximum size packet. The RX buffer size must, at
> > >> > > > least, double the TX buffer size per endpoint. To optimize
> > >> > > > the stream disable performance, system bus burst must be set
> > >> > > > as high as possible.
> > >> > > > When the stream disable mode is used, the burst size
> > >> > > > (VUSB_HS_RX_BURST and VUSB_HS_TX_BURST) must be a
> integer
> > >> > > > sub-multiple of the latency buffer size (VUSB_HS_RX_DEPTH for
> > >> > > > RX buffer and VUSB_HS_TX_CHAN for the TX buffer). If this is
> > >> > > > not respected the controller will not work properly in stream
> > >> > > > disable mode.
> > >> > > > The stream disable mode should just be used in situations
> > >> > > > where the available system bandwidth is low or the system bus
> > >> > > > access latency is high, in order to avoid underruns and
> > >> > > > overruns in the latency buffers. This works for all types of
> > >> > > > endpoi

RE: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data

2015-09-01 Thread Subbaraya Sundeep Bhatta
Hi,

> -Original Message-
> From: Peter Chen [mailto:peter.c...@freescale.com]
> Sent: Monday, August 31, 2015 7:59 AM
> To: Punnaiah Choudary Kalluri
> Cc: Nathan Sullivan; sundeep subbaraya; Subbaraya Sundeep Bhatta;
> robh...@kernel.org; pawel.m...@arm.com; Mark Rutland;
> ijc+devicet...@hellion.org.uk; Kumar Gala; Greg Kroah-Hartman;
> devicet...@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> u...@vger.kernel.org
> Subject: Re: [PATCH 1/2] usb: chipidea: add xilinx zynq platform data
> 
> On Mon, Aug 31, 2015 at 09:01:51AM +0530, punnaiah choudary kalluri
> wrote:
> > On Mon, Aug 31, 2015 at 6:10 AM, Peter Chen
> <peter.c...@freescale.com> wrote:
> > > On Fri, Aug 28, 2015 at 09:42:56AM -0500, Nathan Sullivan wrote:
> > >> On Fri, Aug 28, 2015 at 09:30:12AM +0800, Peter Chen wrote:
> > >> > On Thu, Aug 27, 2015 at 09:33:07AM -0500, Nathan Sullivan wrote:
> > >> > > On Thu, Aug 27, 2015 at 01:11:30PM +0530, punnaiah choudary
> kalluri wrote:
> > >> > > > Hi,
> > >> > > >
> > >> > > > On Thu, Aug 27, 2015 at 10:03 AM, Peter Chen
> <peter.c...@freescale.com> wrote:
> > >> > > > > On Thu, Aug 27, 2015 at 10:59:22AM +0530, sundeep
> subbaraya wrote:
> > >> > > > >> Hi,
> > >> > > > >>
> > >> > > > >>
> > >> > > > >> On Wed, Aug 26, 2015 at 8:57 PM, Nathan Sullivan
> <nathan.sulli...@ni.com> wrote:
> > >> > > > >> > The Xilinx Zynq udc does not need the
> > >> > > > >> > CI_HDRC_DISABLE_STREAMING flag, unlike the default
> > >> > > > >> > platform data.  Add platform data specific to the Zynq udc.
> > >> > > > >> >
> > >> > > > >> > Based on a patch by the same name from the Xilinx vendor
> tree.
> > >> > > > >>
> > >> > > > >> I am that Xilinx guy who sent this patch :). It is in
> > >> > > > >> Xilinx tree as temporary fix and I did not debug further
> > >> > > > >> why UDC works only when streaming is enabled.
> > >> > > > >> Probably this is right time to post my question here.
> > >> > > > >> I was expecting like:
> > >> > > > >> Streaming disabled - both low bandwidth and high bandwidth
> > >> > > > >> systems should work fine Streaming enabled - only for high
> > >> > > > >> bandwidth systems but this is not the case, Zynq UDC works
> > >> > > > >> only when Streaming is enabled.
> > >> > > > >> Please correct me if I am wrong.
> > >> > > > >
> > >> > > > > You are right, stream mode disabled should work at anytime.
> > >> > > > > It is so strange why zynq UDC only works when stream mode is
> enabled.
> > >> > > >
> > >> > > > I am referring the section 8.5.2 in Synopsys usb 2.0 HS
> > >> > > > controllervDoc 2.20a,  this is what it says about SDIS
> > >> > > > (streaming mode disable option)
> > >> > > >
> > >> > > > Before activating this mode, the user must check if the TX
> > >> > > > latency buffers per endpoint are able to accommodate at least
> > >> > > > one entire maximum size packet. The RX buffer size must, at
> > >> > > > least, double the TX buffer size per endpoint. To optimize
> > >> > > > the stream disable performance, system bus burst must be set
> > >> > > > as high as possible.
> > >> > > > When the stream disable mode is used, the burst size
> > >> > > > (VUSB_HS_RX_BURST and VUSB_HS_TX_BURST) must be a
> integer
> > >> > > > sub-multiple of the latency buffer size (VUSB_HS_RX_DEPTH for
> > >> > > > RX buffer and VUSB_HS_TX_CHAN for the TX buffer). If this is
> > >> > > > not respected the controller will not work properly in stream
> > >> > > > disable mode.
> > >> > > > The stream disable mode should just be used in situations
> > >> > > > where the available system bandwidth is low or the system bus
> > >> > > > access latency is high, in order to avoid underruns and
> > >> > > > overruns

RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-15 Thread Subbaraya Sundeep Bhatta
Hi John,

> -Original Message-
> From: Felipe Balbi [mailto:ba...@ti.com]
> Sent: Tuesday, July 14, 2015 12:29 AM
> To: John Youn
> Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; gre...@linuxfoundation.org;
> linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> sta...@vger.kernel.org
> Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
> sent to DEPCMD register fails
> 
> Hi,
> 
> On Mon, Jul 13, 2015 at 05:50:49PM +, John Youn wrote:
> > On 7/11/2015 12:29 PM, Felipe Balbi wrote:
> > > Hi,
> > >
> > > On Sat, Jul 11, 2015 at 05:17:32PM +, Subbaraya Sundeep Bhatta
> wrote:
> > >>>>>> Hi Felipe,
> > >>>>>>
> > >>>>>> Just an update on this.
> > >>>>>>
> > >>>>>> I'm trying to get this working with our latest IP with dwc3
> > >>>>>> from your testing/next branch. It fails the usbtest with a
> > >>>>>> problem unrelated to this patch.
> > >>>>>> .
> > >>>>>> It passes on 4.1.1.
> > >>>>>>
> > >>>>>> I'll have to look into the failure but I won't get to it until
> > >>>>>> next week as I'm off the rest of this week.
> > >>>>>
> > >>>>> interesting... If you could post failure signature, I can help
> > >>>>> looking at it, but I guess it's too late to ask :-)
> > >>>>>
> > >>>>> thanks for helping though
> > >>>>>
> > >>>>
> > >>>>
> > >>>> Hi Felipe,
> > >>>>
> > >>>> Nevermind about my issue, it ended up being a setup-related
> problem.
> > >>>>
> > >>>> I actually do see the same error as you due to this series of patches.
> > >>>> Except I see it happening before even the first iteration. I get
> > >>>> a completion status of 1 for the Set Endpoint Transfer Resources
> > >>>> command. I'm not sure why this is.
> > >>>>
> > >>>> I don't see any conflict with any previous Transfer Complete.
> > >>
> > >> Same behavior at my end too. Fails before first iteration and I get
> > >> completion status of 1 for Set Endpoint Resource command. Attached
> > >> the logs of testing done with this patch and without this patch.
> > >> Without this patch I often see completion status of 1 for Set
> > >> Endpoint Transfer Resources command for Bulk and Isoc endpoints but
> > >> test proceeds because driver just logs command completion status
> > >> and moves on. We can revert this patch for time being. IP version is
> 2.90a.
> > >
> > > yeah, that's what I mean, it really seems like it's the IP misbehaving.
> > >
> > > John, let's try to figure out what's the root cause of this, we
> > > really want to use command completion status at some point, but for
> > > now we need to revert the patch :-(
> > >
> > > Let me know if you want me to log STARS ticket on your solvnet system.
> > >
> > > cheers
> > >
> >
> > Hi Felipe,
> >
> > We found the issue last week.
> >
> > The start config command isn't getting called during SET_INTERFACE.
> > Thus the transfer resource index isn't getting reset, and with
> > multiple SET_INTERFACE commands it will eventually exhaust the
> > resources.
> >
> > I tried out a fix and it works for me. I'll send it out separately for
> > review.

Thanks John for debugging :). Yes we are not handling SET_INTERFACE similar to
SET_CONFIGURATION in driver. I guess we follow 
"Alternate Initialization on SetInterface Request" sequence as per data book.
Felipe can confirm this.

> 
> Thanks a lot John. Not sure how come we missed that for such a long time
> :-) Let's Cc stable and get it plugged ASAP :-)
> 
> > Also, I noticed that the trace message that shows control transfers
> > doesn't show the SET_INTERFACE properly. Any idea why this is?
> >
> > For example, here is the line in the trace that corresponds to the
> > SET_INTERFACE:
> > irq/33-dwc3-10808 [003] d...  2443.494368: dwc3_ctrl_req:
> bRequestType
> > 01 bRequest 0b wValue 0001 wIndex  wLength 0

Can you please elaborate? What is expected here? Did you mean it shows wrong 
info
(other than the request actually sent by Host) ?

Thanks,
Sundeep.B.S.

> 
> I'll have a look at this when I'm back in the office (Jul 18th).
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-15 Thread Subbaraya Sundeep Bhatta
Hi John,

 -Original Message-
 From: Felipe Balbi [mailto:ba...@ti.com]
 Sent: Tuesday, July 14, 2015 12:29 AM
 To: John Youn
 Cc: ba...@ti.com; Subbaraya Sundeep Bhatta; gre...@linuxfoundation.org;
 linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
 sta...@vger.kernel.org
 Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
 sent to DEPCMD register fails
 
 Hi,
 
 On Mon, Jul 13, 2015 at 05:50:49PM +, John Youn wrote:
  On 7/11/2015 12:29 PM, Felipe Balbi wrote:
   Hi,
  
   On Sat, Jul 11, 2015 at 05:17:32PM +, Subbaraya Sundeep Bhatta
 wrote:
   Hi Felipe,
  
   Just an update on this.
  
   I'm trying to get this working with our latest IP with dwc3
   from your testing/next branch. It fails the usbtest with a
   problem unrelated to this patch.
   .
   It passes on 4.1.1.
  
   I'll have to look into the failure but I won't get to it until
   next week as I'm off the rest of this week.
  
   interesting... If you could post failure signature, I can help
   looking at it, but I guess it's too late to ask :-)
  
   thanks for helping though
  
  
  
   Hi Felipe,
  
   Nevermind about my issue, it ended up being a setup-related
 problem.
  
   I actually do see the same error as you due to this series of patches.
   Except I see it happening before even the first iteration. I get
   a completion status of 1 for the Set Endpoint Transfer Resources
   command. I'm not sure why this is.
  
   I don't see any conflict with any previous Transfer Complete.
  
   Same behavior at my end too. Fails before first iteration and I get
   completion status of 1 for Set Endpoint Resource command. Attached
   the logs of testing done with this patch and without this patch.
   Without this patch I often see completion status of 1 for Set
   Endpoint Transfer Resources command for Bulk and Isoc endpoints but
   test proceeds because driver just logs command completion status
   and moves on. We can revert this patch for time being. IP version is
 2.90a.
  
   yeah, that's what I mean, it really seems like it's the IP misbehaving.
  
   John, let's try to figure out what's the root cause of this, we
   really want to use command completion status at some point, but for
   now we need to revert the patch :-(
  
   Let me know if you want me to log STARS ticket on your solvnet system.
  
   cheers
  
 
  Hi Felipe,
 
  We found the issue last week.
 
  The start config command isn't getting called during SET_INTERFACE.
  Thus the transfer resource index isn't getting reset, and with
  multiple SET_INTERFACE commands it will eventually exhaust the
  resources.
 
  I tried out a fix and it works for me. I'll send it out separately for
  review.

Thanks John for debugging :). Yes we are not handling SET_INTERFACE similar to
SET_CONFIGURATION in driver. I guess we follow 
Alternate Initialization on SetInterface Request sequence as per data book.
Felipe can confirm this.

 
 Thanks a lot John. Not sure how come we missed that for such a long time
 :-) Let's Cc stable and get it plugged ASAP :-)
 
  Also, I noticed that the trace message that shows control transfers
  doesn't show the SET_INTERFACE properly. Any idea why this is?
 
  For example, here is the line in the trace that corresponds to the
  SET_INTERFACE:
  irq/33-dwc3-10808 [003] d...  2443.494368: dwc3_ctrl_req:
 bRequestType
  01 bRequest 0b wValue 0001 wIndex  wLength 0

Can you please elaborate? What is expected here? Did you mean it shows wrong 
info
(other than the request actually sent by Host) ?

Thanks,
Sundeep.B.S.

 
 I'll have a look at this when I'm back in the office (Jul 18th).
 
 --
 balbi
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-08 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

> -Original Message-
> From: Subbaraya Sundeep Bhatta
> Sent: Tuesday, July 07, 2015 10:32 AM
> To: 'ba...@ti.com'
> Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
> ker...@vger.kernel.org; sta...@vger.kernel.org
> Subject: RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
> sent to DEPCMD register fails
>
> Hi Felipe,
>
> > -Original Message-
> > From: Felipe Balbi [mailto:ba...@ti.com]
> > Sent: Monday, July 06, 2015 10:38 PM
> > To: Subbaraya Sundeep Bhatta
> > Cc: ba...@ti.com; gre...@linuxfoundation.org;
> > linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> > sta...@vger.kernel.org
> > Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
> > sent to DEPCMD register fails
> >
> > On Wed, Jul 01, 2015 at 07:29:28AM +, Subbaraya Sundeep Bhatta
> > wrote:
> > > Hi Felipe,
> > >
> > > > -Original Message-
> > > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > > Sent: Tuesday, June 30, 2015 3:17 AM
> > > > To: Subbaraya Sundeep Bhatta
> > > > Cc: ba...@ti.com; gre...@linuxfoundation.org;
> > > > linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> > > > sta...@vger.kernel.org; Subbaraya Sundeep Bhatta
> > > > Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if
> > > > command sent to DEPCMD register fails
> > > >
> > > > Hi,
> > > >
> > > > On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep
> > Bhatta
> > > > wrote:
> > > > > We need to return error to caller if command is not sent to
> > > > > controller succesfully.
> > > > >
> > > > > Signed-off-by: Subbaraya Sundeep Bhatta 
> > > > > Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
> > > > > Cc: 
> > > > > ---
> > > > > v2 changes:
> > > > >   Added Fixes and Cc in commit message.
> > > >
> > > > I noticed that this breaks at least my AM437x silicon with DWC3
> > > > 2.40a when used with g_zero and testusb. As of now, it could be
> > > > that silicon is mis-behaving because I got a Transfer Complete
> > > > before the failing Set Endpoint Transfer Resource command.
> > > >
> > > > In any case, can you run on your setup with g_zero and
> > > > test.sh/testusb [1]/[2] just to verify that it really works for you ?

Can you please send test.sh and testusb.c in attachment. I guess am not able to 
access gitorious because of its migration.

Thanks,
Sundeep

> > >
> > > Ok I will do that.
> >
> > Did you manage to run the test I asked ? If we don't get down to this,
> > I'll have to revert your patch as it regresses my platforms.
>
> Sorry I caught up with some other customer reported issue on Zynq
> (Chipidea). I will do it by this weekend at any cost. Please wait.
>
> Thanks,
> Sundeep.B.S.
>
> >
> > --
> > balbi


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-08 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

 -Original Message-
 From: Subbaraya Sundeep Bhatta
 Sent: Tuesday, July 07, 2015 10:32 AM
 To: 'ba...@ti.com'
 Cc: gre...@linuxfoundation.org; linux-...@vger.kernel.org; linux-
 ker...@vger.kernel.org; sta...@vger.kernel.org
 Subject: RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
 sent to DEPCMD register fails

 Hi Felipe,

  -Original Message-
  From: Felipe Balbi [mailto:ba...@ti.com]
  Sent: Monday, July 06, 2015 10:38 PM
  To: Subbaraya Sundeep Bhatta
  Cc: ba...@ti.com; gre...@linuxfoundation.org;
  linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
  sta...@vger.kernel.org
  Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
  sent to DEPCMD register fails
 
  On Wed, Jul 01, 2015 at 07:29:28AM +, Subbaraya Sundeep Bhatta
  wrote:
   Hi Felipe,
  
-Original Message-
From: Felipe Balbi [mailto:ba...@ti.com]
Sent: Tuesday, June 30, 2015 3:17 AM
To: Subbaraya Sundeep Bhatta
Cc: ba...@ti.com; gre...@linuxfoundation.org;
linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
sta...@vger.kernel.org; Subbaraya Sundeep Bhatta
Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if
command sent to DEPCMD register fails
   
Hi,
   
On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep
  Bhatta
wrote:
 We need to return error to caller if command is not sent to
 controller succesfully.

 Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
 Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
 Cc: sta...@vger.kernel.org
 ---
 v2 changes:
   Added Fixes and Cc in commit message.
   
I noticed that this breaks at least my AM437x silicon with DWC3
2.40a when used with g_zero and testusb. As of now, it could be
that silicon is mis-behaving because I got a Transfer Complete
before the failing Set Endpoint Transfer Resource command.
   
In any case, can you run on your setup with g_zero and
test.sh/testusb [1]/[2] just to verify that it really works for you ?

Can you please send test.sh and testusb.c in attachment. I guess am not able to 
access gitorious because of its migration.

Thanks,
Sundeep

  
   Ok I will do that.
 
  Did you manage to run the test I asked ? If we don't get down to this,
  I'll have to revert your patch as it regresses my platforms.

 Sorry I caught up with some other customer reported issue on Zynq
 (Chipidea). I will do it by this weekend at any cost. Please wait.

 Thanks,
 Sundeep.B.S.

 
  --
  balbi


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-06 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

> -Original Message-
> From: Felipe Balbi [mailto:ba...@ti.com]
> Sent: Monday, July 06, 2015 10:38 PM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; gre...@linuxfoundation.org; linux-...@vger.kernel.org;
> linux-kernel@vger.kernel.org; sta...@vger.kernel.org
> Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
> sent to DEPCMD register fails
> 
> On Wed, Jul 01, 2015 at 07:29:28AM +, Subbaraya Sundeep Bhatta
> wrote:
> > Hi Felipe,
> >
> > > -Original Message-
> > > From: Felipe Balbi [mailto:ba...@ti.com]
> > > Sent: Tuesday, June 30, 2015 3:17 AM
> > > To: Subbaraya Sundeep Bhatta
> > > Cc: ba...@ti.com; gre...@linuxfoundation.org;
> > > linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
> > > sta...@vger.kernel.org; Subbaraya Sundeep Bhatta
> > > Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if
> > > command sent to DEPCMD register fails
> > >
> > > Hi,
> > >
> > > On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep
> Bhatta
> > > wrote:
> > > > We need to return error to caller if command is not sent to
> > > > controller succesfully.
> > > >
> > > > Signed-off-by: Subbaraya Sundeep Bhatta 
> > > > Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
> > > > Cc: 
> > > > ---
> > > > v2 changes:
> > > > Added Fixes and Cc in commit message.
> > >
> > > I noticed that this breaks at least my AM437x silicon with DWC3
> > > 2.40a when used with g_zero and testusb. As of now, it could be that
> > > silicon is mis-behaving because I got a Transfer Complete before the
> > > failing Set Endpoint Transfer Resource command.
> > >
> > > In any case, can you run on your setup with g_zero and
> > > test.sh/testusb [1]/[2] just to verify that it really works for you ?
> >
> > Ok I will do that.
> 
> Did you manage to run the test I asked ? If we don't get down to this, I'll
> have to revert your patch as it regresses my platforms.

Sorry I caught up with some other customer reported issue on Zynq (Chipidea). I 
will do it by this weekend at any cost. Please wait.

Thanks,
Sundeep.B.S.

> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-06 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

 -Original Message-
 From: Felipe Balbi [mailto:ba...@ti.com]
 Sent: Monday, July 06, 2015 10:38 PM
 To: Subbaraya Sundeep Bhatta
 Cc: ba...@ti.com; gre...@linuxfoundation.org; linux-...@vger.kernel.org;
 linux-kernel@vger.kernel.org; sta...@vger.kernel.org
 Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
 sent to DEPCMD register fails
 
 On Wed, Jul 01, 2015 at 07:29:28AM +, Subbaraya Sundeep Bhatta
 wrote:
  Hi Felipe,
 
   -Original Message-
   From: Felipe Balbi [mailto:ba...@ti.com]
   Sent: Tuesday, June 30, 2015 3:17 AM
   To: Subbaraya Sundeep Bhatta
   Cc: ba...@ti.com; gre...@linuxfoundation.org;
   linux-...@vger.kernel.org; linux-kernel@vger.kernel.org;
   sta...@vger.kernel.org; Subbaraya Sundeep Bhatta
   Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if
   command sent to DEPCMD register fails
  
   Hi,
  
   On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep
 Bhatta
   wrote:
We need to return error to caller if command is not sent to
controller succesfully.
   
Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Cc: sta...@vger.kernel.org
---
v2 changes:
Added Fixes and Cc in commit message.
  
   I noticed that this breaks at least my AM437x silicon with DWC3
   2.40a when used with g_zero and testusb. As of now, it could be that
   silicon is mis-behaving because I got a Transfer Complete before the
   failing Set Endpoint Transfer Resource command.
  
   In any case, can you run on your setup with g_zero and
   test.sh/testusb [1]/[2] just to verify that it really works for you ?
 
  Ok I will do that.
 
 Did you manage to run the test I asked ? If we don't get down to this, I'll
 have to revert your patch as it regresses my platforms.

Sorry I caught up with some other customer reported issue on Zynq (Chipidea). I 
will do it by this weekend at any cost. Please wait.

Thanks,
Sundeep.B.S.

 
 --
 balbi
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-01 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

> -Original Message-
> From: Felipe Balbi [mailto:ba...@ti.com]
> Sent: Tuesday, June 30, 2015 3:17 AM
> To: Subbaraya Sundeep Bhatta
> Cc: ba...@ti.com; gre...@linuxfoundation.org; linux-...@vger.kernel.org;
> linux-kernel@vger.kernel.org; sta...@vger.kernel.org; Subbaraya Sundeep
> Bhatta
> Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
> sent to DEPCMD register fails
> 
> Hi,
> 
> On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep Bhatta
> wrote:
> > We need to return error to caller if command is not sent to controller
> > succesfully.
> >
> > Signed-off-by: Subbaraya Sundeep Bhatta 
> > Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
> > Cc: 
> > ---
> > v2 changes:
> > Added Fixes and Cc in commit message.
> 
> I noticed that this breaks at least my AM437x silicon with DWC3 2.40a
> when used with g_zero and testusb. As of now, it could be that silicon is
> mis-behaving because I got a Transfer Complete before the failing Set
> Endpoint Transfer Resource command.
> 
> In any case, can you run on your setup with g_zero and test.sh/testusb
> [1]/[2] just to verify that it really works for you ?

Ok I will do that.

Thanks,
Sundeep.B.S.

> 
> Meanwhile, I'll continue testing on my end.
> 
> cheers
> 
> [1] https://gitorious.org/usb/usb-
> tools/source/47ef073d9b6c0eae816204c81374aafb795c6e40:testusb.c
> [2] https://gitorious.org/usb/usb-
> tools/source/47ef073d9b6c0eae816204c81374aafb795c6e40:test.sh
> 
> --
> balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-07-01 Thread Subbaraya Sundeep Bhatta
Hi Felipe,

 -Original Message-
 From: Felipe Balbi [mailto:ba...@ti.com]
 Sent: Tuesday, June 30, 2015 3:17 AM
 To: Subbaraya Sundeep Bhatta
 Cc: ba...@ti.com; gre...@linuxfoundation.org; linux-...@vger.kernel.org;
 linux-kernel@vger.kernel.org; sta...@vger.kernel.org; Subbaraya Sundeep
 Bhatta
 Subject: Re: [PATCH v2 3/3] usb: dwc3: gadget: return error if command
 sent to DEPCMD register fails
 
 Hi,
 
 On Thu, May 21, 2015 at 03:46:48PM +0530, Subbaraya Sundeep Bhatta
 wrote:
  We need to return error to caller if command is not sent to controller
  succesfully.
 
  Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
  Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
  Cc: sta...@vger.kernel.org
  ---
  v2 changes:
  Added Fixes and Cc in commit message.
 
 I noticed that this breaks at least my AM437x silicon with DWC3 2.40a
 when used with g_zero and testusb. As of now, it could be that silicon is
 mis-behaving because I got a Transfer Complete before the failing Set
 Endpoint Transfer Resource command.
 
 In any case, can you run on your setup with g_zero and test.sh/testusb
 [1]/[2] just to verify that it really works for you ?

Ok I will do that.

Thanks,
Sundeep.B.S.

 
 Meanwhile, I'll continue testing on my end.
 
 cheers
 
 [1] https://gitorious.org/usb/usb-
 tools/source/47ef073d9b6c0eae816204c81374aafb795c6e40:testusb.c
 [2] https://gitorious.org/usb/usb-
 tools/source/47ef073d9b6c0eae816204c81374aafb795c6e40:test.sh
 
 --
 balbi
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-05-21 Thread Subbaraya Sundeep Bhatta
We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: Subbaraya Sundeep Bhatta 
Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Cc: 
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/gadget.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index fcbe120..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -330,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DEPCMD_STATUS(reg));
+   if (DWC3_DEPCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 2/3] usb: dwc3: gadget: return error if command sent to DGCMD register fails

2015-05-21 Thread Subbaraya Sundeep Bhatta
We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: Subbaraya Sundeep Bhatta 
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc:  #v3.5+
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/gadget.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..fcbe120 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, 
unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DGCMD_STATUS(reg));
+   if (DWC3_DGCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/3] usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros

2015-05-21 Thread Subbaraya Sundeep Bhatta
Fixed the incorrect macro definitions correctly as per databook.

Signed-off-by: Subbaraya Sundeep Bhatta 
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc:  #v3.5+
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/core.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fdab715..c0eafa6 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -339,7 +339,7 @@
 #define DWC3_DGCMD_SET_ENDPOINT_NRDY   0x0c
 #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK0x10
 
-#define DWC3_DGCMD_STATUS(n)   (((n) >> 15) & 1)
+#define DWC3_DGCMD_STATUS(n)   (((n) >> 12) & 0x0F)
 #define DWC3_DGCMD_CMDACT  (1 << 10)
 #define DWC3_DGCMD_CMDIOC  (1 << 8)
 
@@ -355,7 +355,7 @@
 #define DWC3_DEPCMD_PARAM_SHIFT16
 #define DWC3_DEPCMD_PARAM(x)   ((x) << DWC3_DEPCMD_PARAM_SHIFT)
 #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 
0x7f)
-#define DWC3_DEPCMD_STATUS(x)  (((x) >> 15) & 1)
+#define DWC3_DEPCMD_STATUS(x)  (((x) >> 12) & 0x0F)
 #define DWC3_DEPCMD_HIPRI_FORCERM  (1 << 11)
 #define DWC3_DEPCMD_CMDACT (1 << 10)
 #define DWC3_DEPCMD_CMDIOC (1 << 8)
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/3] usb: dwc3: gadget: Fix incorrect DEPCMD and DGCMD status macros

2015-05-21 Thread Subbaraya Sundeep Bhatta
Fixed the incorrect macro definitions correctly as per databook.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc: sta...@vger.kernel.org #v3.5+
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/core.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fdab715..c0eafa6 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -339,7 +339,7 @@
 #define DWC3_DGCMD_SET_ENDPOINT_NRDY   0x0c
 #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK0x10
 
-#define DWC3_DGCMD_STATUS(n)   (((n)  15)  1)
+#define DWC3_DGCMD_STATUS(n)   (((n)  12)  0x0F)
 #define DWC3_DGCMD_CMDACT  (1  10)
 #define DWC3_DGCMD_CMDIOC  (1  8)
 
@@ -355,7 +355,7 @@
 #define DWC3_DEPCMD_PARAM_SHIFT16
 #define DWC3_DEPCMD_PARAM(x)   ((x)  DWC3_DEPCMD_PARAM_SHIFT)
 #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x)  DWC3_DEPCMD_PARAM_SHIFT)  
0x7f)
-#define DWC3_DEPCMD_STATUS(x)  (((x)  15)  1)
+#define DWC3_DEPCMD_STATUS(x)  (((x)  12)  0x0F)
 #define DWC3_DEPCMD_HIPRI_FORCERM  (1  11)
 #define DWC3_DEPCMD_CMDACT (1  10)
 #define DWC3_DEPCMD_CMDIOC (1  8)
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 2/3] usb: dwc3: gadget: return error if command sent to DGCMD register fails

2015-05-21 Thread Subbaraya Sundeep Bhatta
We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
Fixes: b09bb64239c8 (usb: dwc3: gadget: implement Global Command support)
Cc: sta...@vger.kernel.org #v3.5+
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/gadget.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..fcbe120 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, 
unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
Command Complete -- %d,
DWC3_DGCMD_STATUS(reg));
+   if (DWC3_DGCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/3] usb: dwc3: gadget: return error if command sent to DEPCMD register fails

2015-05-21 Thread Subbaraya Sundeep Bhatta
We need to return error to caller if command is not sent to
controller succesfully.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
Fixes: 72246da40f37 (usb: Introduce DesignWare USB3 DRD Driver)
Cc: sta...@vger.kernel.org
---
v2 changes:
Added Fixes and Cc in commit message.

 drivers/usb/dwc3/gadget.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index fcbe120..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -330,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
dwc3_trace(trace_dwc3_gadget,
Command Complete -- %d,
DWC3_DEPCMD_STATUS(reg));
+   if (DWC3_DEPCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros

2015-05-14 Thread Subbaraya Sundeep Bhatta
Modified DEPCMD and DGCMD status checking macros as per databook.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/usb/dwc3/core.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fdab715..60acc5c9 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -339,7 +339,7 @@
 #define DWC3_DGCMD_SET_ENDPOINT_NRDY   0x0c
 #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK0x10
 
-#define DWC3_DGCMD_STATUS(n)   (((n) >> 15) & 1)
+#define DWC3_DGCMD_STATUS(n)   (((n) >> 12) & 1)
 #define DWC3_DGCMD_CMDACT  (1 << 10)
 #define DWC3_DGCMD_CMDIOC  (1 << 8)
 
@@ -355,7 +355,7 @@
 #define DWC3_DEPCMD_PARAM_SHIFT16
 #define DWC3_DEPCMD_PARAM(x)   ((x) << DWC3_DEPCMD_PARAM_SHIFT)
 #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x) >> DWC3_DEPCMD_PARAM_SHIFT) & 
0x7f)
-#define DWC3_DEPCMD_STATUS(x)  (((x) >> 15) & 1)
+#define DWC3_DEPCMD_STATUS(x)  (((x) >> 12) & 0x0F)
 #define DWC3_DEPCMD_HIPRI_FORCERM  (1 << 11)
 #define DWC3_DEPCMD_CMDACT (1 << 10)
 #define DWC3_DEPCMD_CMDIOC (1 << 8)
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails

2015-05-14 Thread Subbaraya Sundeep Bhatta
When sending DEPCMD or DGCMD command fails return error to caller.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/usb/dwc3/gadget.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, 
unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DGCMD_STATUS(reg));
+   if (DWC3_DGCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
@@ -328,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
dwc3_trace(trace_dwc3_gadget,
"Command Complete --> %d",
DWC3_DEPCMD_STATUS(reg));
+   if (DWC3_DEPCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] usb: dwc3: gadget: return error when DEPCMD or DGCMD fails

2015-05-14 Thread Subbaraya Sundeep Bhatta
When sending DEPCMD or DGCMD command fails return error to caller.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
 drivers/usb/dwc3/gadget.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 8946c32..55b5edc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -291,6 +291,8 @@ int dwc3_send_gadget_generic_command(struct dwc3 *dwc, 
unsigned cmd, u32 param)
dwc3_trace(trace_dwc3_gadget,
Command Complete -- %d,
DWC3_DGCMD_STATUS(reg));
+   if (DWC3_DGCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
@@ -328,6 +330,8 @@ int dwc3_send_gadget_ep_cmd(struct dwc3 *dwc, unsigned ep,
dwc3_trace(trace_dwc3_gadget,
Command Complete -- %d,
DWC3_DEPCMD_STATUS(reg));
+   if (DWC3_DEPCMD_STATUS(reg))
+   return -EINVAL;
return 0;
}
 
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] usb: dwc3: Fix incorrect DEPCMD and DGCMD status macros

2015-05-14 Thread Subbaraya Sundeep Bhatta
Modified DEPCMD and DGCMD status checking macros as per databook.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
 drivers/usb/dwc3/core.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index fdab715..60acc5c9 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -339,7 +339,7 @@
 #define DWC3_DGCMD_SET_ENDPOINT_NRDY   0x0c
 #define DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK0x10
 
-#define DWC3_DGCMD_STATUS(n)   (((n)  15)  1)
+#define DWC3_DGCMD_STATUS(n)   (((n)  12)  1)
 #define DWC3_DGCMD_CMDACT  (1  10)
 #define DWC3_DGCMD_CMDIOC  (1  8)
 
@@ -355,7 +355,7 @@
 #define DWC3_DEPCMD_PARAM_SHIFT16
 #define DWC3_DEPCMD_PARAM(x)   ((x)  DWC3_DEPCMD_PARAM_SHIFT)
 #define DWC3_DEPCMD_GET_RSC_IDX(x) (((x)  DWC3_DEPCMD_PARAM_SHIFT)  
0x7f)
-#define DWC3_DEPCMD_STATUS(x)  (((x)  15)  1)
+#define DWC3_DEPCMD_STATUS(x)  (((x)  12)  0x0F)
 #define DWC3_DEPCMD_HIPRI_FORCERM  (1  11)
 #define DWC3_DEPCMD_CMDACT (1  10)
 #define DWC3_DEPCMD_CMDIOC (1  8)
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: axienet: remove unnecessary ether_setup after alloc_etherdev

2014-09-11 Thread Subbaraya Sundeep Bhatta
calling ether_setup is redundant since alloc_etherdev calls
it.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c 
b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index c8fd941..4ea2d4e 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1485,7 +1485,6 @@ static int axienet_of_probe(struct platform_device *op)
if (!ndev)
return -ENOMEM;
 
-   ether_setup(ndev);
platform_set_drvdata(op, ndev);
 
SET_NETDEV_DEV(ndev, >dev);
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iio: adc: xilinx-xadc: assign auxiliary channels address correctly

2014-09-11 Thread Subbaraya Sundeep Bhatta
This patch fixes incorrect logic for assigning address
to auxiliary channels of xilinx xadc.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
 drivers/iio/adc/xilinx-xadc-core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c 
b/drivers/iio/adc/xilinx-xadc-core.c
index fd2745c..626b397 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, 
struct device_node *np,
chan->address = XADC_REG_VPVN;
} else {
chan->scan_index = 15 + reg;
-   chan->scan_index = XADC_REG_VAUX(reg - 1);
+   chan->address = XADC_REG_VAUX(reg - 1);
}
num_channels++;
chan++;
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] iio: adc: xilinx-xadc: assign auxiliary channels address correctly

2014-09-11 Thread Subbaraya Sundeep Bhatta
This patch fixes incorrect logic for assigning address
to auxiliary channels of xilinx xadc.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
 drivers/iio/adc/xilinx-xadc-core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/iio/adc/xilinx-xadc-core.c 
b/drivers/iio/adc/xilinx-xadc-core.c
index fd2745c..626b397 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1126,7 +1126,7 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, 
struct device_node *np,
chan-address = XADC_REG_VPVN;
} else {
chan-scan_index = 15 + reg;
-   chan-scan_index = XADC_REG_VAUX(reg - 1);
+   chan-address = XADC_REG_VAUX(reg - 1);
}
num_channels++;
chan++;
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: axienet: remove unnecessary ether_setup after alloc_etherdev

2014-09-11 Thread Subbaraya Sundeep Bhatta
calling ether_setup is redundant since alloc_etherdev calls
it.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c 
b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index c8fd941..4ea2d4e 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1485,7 +1485,6 @@ static int axienet_of_probe(struct platform_device *op)
if (!ndev)
return -ENOMEM;
 
-   ether_setup(ndev);
platform_set_drvdata(op, ndev);
 
SET_NETDEV_DEV(ndev, op-dev);
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-09-10 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
Changes for v5:
- None
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- None
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..47b4e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,18 @@
+Xilinx USB2 device controller
+
+Required properties:
+- compatible   : Should be "xlnx,usb2-device-4.00.a"
+- reg  : Physical base address and size of the USB2
+ device registers map.
+- interrupts   : Should contain single irq line of USB2 device
+ controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = "xlnx,usb2-device-4.00.a";
+interrupts = <0x0 0x39 0x1>;
+reg = <0x42e0 0x1>;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v5 2/2] usb: gadget: Add xilinx usb2 device support

2014-09-10 Thread Subbaraya Sundeep Bhatta
Xilinx USB2 device is a soft IP which supports both full
and high speed USB 2.0 data transfers. This patch adds
xilinx usb2 device driver support.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
Changes for v5:
- used devm_kzalloc instead of kzalloc
- used snprintf instead of sprintf
- fixed minor indentation issues
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- Added pullup function
- Modified error handling
- Fixed all v2 comments except DMA interrupt handling
  since polling seems to be faster.
Please refer to below message thread:
http://www.kernelhub.org/?p=2=481724
Changes for v2:
- Added Resume
- Added Remote wakeup
- Fixed v1 comments

 drivers/usb/gadget/udc/Kconfig  |   15 +
 drivers/usb/gadget/udc/Makefile |1 +
 drivers/usb/gadget/udc/udc-xilinx.c | 2180 +++
 3 files changed, 2196 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/udc/udc-xilinx.c

diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
index 34ebaa6..021eb4a 100644
--- a/drivers/usb/gadget/udc/Kconfig
+++ b/drivers/usb/gadget/udc/Kconfig
@@ -354,6 +354,21 @@ config USB_EG20T
  ML7213/ML7831 is completely compatible for Intel EG20T PCH.
 
  This driver can be used with Intel's Quark X1000 SOC platform
+
+config USB_GADGET_XILINX
+   tristate "Xilinx USB Driver"
+   depends on OF || COMPILE_TEST
+   help
+ USB peripheral controller driver for Xilinx USB2 device.
+ Xilinx USB2 device is a soft IP which supports both full
+ and high speed USB 2.0 data transfers. It has seven configurable
+ endpoints(bulk or interrupt or isochronous), as well as
+ endpoint zero(for control transfers).
+
+ Say "y" to link the driver statically, or "m" to build a
+ dynamically linked module called "udc-xilinx" and force all
+ gadget drivers to also be dynamically linked.
+
 #
 # LAST -- dummy/emulated controller
 #
diff --git a/drivers/usb/gadget/udc/Makefile b/drivers/usb/gadget/udc/Makefile
index 4096122..a7f4491 100644
--- a/drivers/usb/gadget/udc/Makefile
+++ b/drivers/usb/gadget/udc/Makefile
@@ -29,3 +29,4 @@ obj-$(CONFIG_USB_FUSB300) += fusb300_udc.o
 obj-$(CONFIG_USB_FOTG210_UDC)  += fotg210-udc.o
 obj-$(CONFIG_USB_MV_U3D)   += mv_u3d_core.o
 obj-$(CONFIG_USB_GR_UDC)   += gr_udc.o
+obj-$(CONFIG_USB_GADGET_XILINX)+= udc-xilinx.o
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c 
b/drivers/usb/gadget/udc/udc-xilinx.c
new file mode 100644
index 000..ed27e16
--- /dev/null
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -0,0 +1,2180 @@
+/*
+ * Xilinx USB peripheral controller driver
+ *
+ * Copyright (C) 2004 by Thomas Rathbone
+ * Copyright (C) 2005 by HP Labs
+ * Copyright (C) 2005 by David Brownell
+ * Copyright (C) 2010 - 2014 Xilinx, Inc.
+ *
+ * Some parts of this driver code is based on the driver for at91-series
+ * USB peripheral controller (at91_udc.c).
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* Register offsets for the USB device.*/
+#define XUSB_EP0_CONFIG_OFFSET 0x  /* EP0 Config Reg Offset */
+#define XUSB_SETUP_PKT_ADDR_OFFSET 0x0080  /* Setup Packet Address */
+#define XUSB_ADDRESS_OFFSET0x0100  /* Address Register */
+#define XUSB_CONTROL_OFFSET0x0104  /* Control Register */
+#define XUSB_STATUS_OFFSET 0x0108  /* Status Register */
+#define XUSB_FRAMENUM_OFFSET   0x010C  /* Frame Number Register */
+#define XUSB_IER_OFFSET0x0110  /* Interrupt Enable 
Register */
+#define XUSB_BUFFREADY_OFFSET  0x0114  /* Buffer Ready Register */
+#define XUSB_TESTMODE_OFFSET   0x0118  /* Test Mode Register */
+#define XUSB_DMA_RESET_OFFSET  0x0200  /* DMA Soft Reset Register */
+#define XUSB_DMA_CONTROL_OFFSET0x0204  /* DMA Control Register 
*/
+#define XUSB_DMA_DSAR_ADDR_OFFSET  0x0208  /* DMA source Address Reg */
+#define XUSB_DMA_DDAR_ADDR_OFFSET  0x020C  /* DMA destination Addr Reg */
+#define XUSB_DMA_LENGTH_OFFSET 0x0210  /* DMA Length Register */
+#define XUSB_DMA_STATUS_OFFSET 0x0214  /* DMA Status Register */
+
+/* Endpoint Configuration Space offsets */
+#define XUSB_EP_CFGSTATUS_OFFSET   0x00/* Endpoint Config Status  */
+#define XUSB_EP_BUF0COUNT_OFFSET   0x08/* Buffer 0 Count */
+#define XUSB_EP_BUF1COUNT_OFFSET  

[PATCH v5 2/2] usb: gadget: Add xilinx usb2 device support

2014-09-10 Thread Subbaraya Sundeep Bhatta
Xilinx USB2 device is a soft IP which supports both full
and high speed USB 2.0 data transfers. This patch adds
xilinx usb2 device driver support.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
Changes for v5:
- used devm_kzalloc instead of kzalloc
- used snprintf instead of sprintf
- fixed minor indentation issues
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- Added pullup function
- Modified error handling
- Fixed all v2 comments except DMA interrupt handling
  since polling seems to be faster.
Please refer to below message thread:
http://www.kernelhub.org/?p=2msg=481724
Changes for v2:
- Added Resume
- Added Remote wakeup
- Fixed v1 comments

 drivers/usb/gadget/udc/Kconfig  |   15 +
 drivers/usb/gadget/udc/Makefile |1 +
 drivers/usb/gadget/udc/udc-xilinx.c | 2180 +++
 3 files changed, 2196 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/udc/udc-xilinx.c

diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig
index 34ebaa6..021eb4a 100644
--- a/drivers/usb/gadget/udc/Kconfig
+++ b/drivers/usb/gadget/udc/Kconfig
@@ -354,6 +354,21 @@ config USB_EG20T
  ML7213/ML7831 is completely compatible for Intel EG20T PCH.
 
  This driver can be used with Intel's Quark X1000 SOC platform
+
+config USB_GADGET_XILINX
+   tristate Xilinx USB Driver
+   depends on OF || COMPILE_TEST
+   help
+ USB peripheral controller driver for Xilinx USB2 device.
+ Xilinx USB2 device is a soft IP which supports both full
+ and high speed USB 2.0 data transfers. It has seven configurable
+ endpoints(bulk or interrupt or isochronous), as well as
+ endpoint zero(for control transfers).
+
+ Say y to link the driver statically, or m to build a
+ dynamically linked module called udc-xilinx and force all
+ gadget drivers to also be dynamically linked.
+
 #
 # LAST -- dummy/emulated controller
 #
diff --git a/drivers/usb/gadget/udc/Makefile b/drivers/usb/gadget/udc/Makefile
index 4096122..a7f4491 100644
--- a/drivers/usb/gadget/udc/Makefile
+++ b/drivers/usb/gadget/udc/Makefile
@@ -29,3 +29,4 @@ obj-$(CONFIG_USB_FUSB300) += fusb300_udc.o
 obj-$(CONFIG_USB_FOTG210_UDC)  += fotg210-udc.o
 obj-$(CONFIG_USB_MV_U3D)   += mv_u3d_core.o
 obj-$(CONFIG_USB_GR_UDC)   += gr_udc.o
+obj-$(CONFIG_USB_GADGET_XILINX)+= udc-xilinx.o
diff --git a/drivers/usb/gadget/udc/udc-xilinx.c 
b/drivers/usb/gadget/udc/udc-xilinx.c
new file mode 100644
index 000..ed27e16
--- /dev/null
+++ b/drivers/usb/gadget/udc/udc-xilinx.c
@@ -0,0 +1,2180 @@
+/*
+ * Xilinx USB peripheral controller driver
+ *
+ * Copyright (C) 2004 by Thomas Rathbone
+ * Copyright (C) 2005 by HP Labs
+ * Copyright (C) 2005 by David Brownell
+ * Copyright (C) 2010 - 2014 Xilinx, Inc.
+ *
+ * Some parts of this driver code is based on the driver for at91-series
+ * USB peripheral controller (at91_udc.c).
+ *
+ * This program is free software; you can redistribute it
+ * and/or modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation;
+ * either version 2 of the License, or (at your option) any
+ * later version.
+ */
+
+#include linux/delay.h
+#include linux/device.h
+#include linux/dma-mapping.h
+#include linux/interrupt.h
+#include linux/io.h
+#include linux/module.h
+#include linux/of_address.h
+#include linux/of_device.h
+#include linux/of_platform.h
+#include linux/of_irq.h
+#include linux/prefetch.h
+#include linux/usb/ch9.h
+#include linux/usb/gadget.h
+
+/* Register offsets for the USB device.*/
+#define XUSB_EP0_CONFIG_OFFSET 0x  /* EP0 Config Reg Offset */
+#define XUSB_SETUP_PKT_ADDR_OFFSET 0x0080  /* Setup Packet Address */
+#define XUSB_ADDRESS_OFFSET0x0100  /* Address Register */
+#define XUSB_CONTROL_OFFSET0x0104  /* Control Register */
+#define XUSB_STATUS_OFFSET 0x0108  /* Status Register */
+#define XUSB_FRAMENUM_OFFSET   0x010C  /* Frame Number Register */
+#define XUSB_IER_OFFSET0x0110  /* Interrupt Enable 
Register */
+#define XUSB_BUFFREADY_OFFSET  0x0114  /* Buffer Ready Register */
+#define XUSB_TESTMODE_OFFSET   0x0118  /* Test Mode Register */
+#define XUSB_DMA_RESET_OFFSET  0x0200  /* DMA Soft Reset Register */
+#define XUSB_DMA_CONTROL_OFFSET0x0204  /* DMA Control Register 
*/
+#define XUSB_DMA_DSAR_ADDR_OFFSET  0x0208  /* DMA source Address Reg */
+#define XUSB_DMA_DDAR_ADDR_OFFSET  0x020C  /* DMA destination Addr Reg */
+#define XUSB_DMA_LENGTH_OFFSET 0x0210  /* DMA Length Register */
+#define XUSB_DMA_STATUS_OFFSET 0x0214  /* DMA Status Register */
+
+/* Endpoint Configuration Space offsets */
+#define

[PATCH v5 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-09-10 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
Changes for v5:
- None
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- None
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..47b4e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,18 @@
+Xilinx USB2 device controller
+
+Required properties:
+- compatible   : Should be xlnx,usb2-device-4.00.a
+- reg  : Physical base address and size of the USB2
+ device registers map.
+- interrupts   : Should contain single irq line of USB2 device
+ controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = xlnx,usb2-device-4.00.a;
+interrupts = 0x0 0x39 0x1;
+reg = 0x42e0 0x1;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-07-22 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- None
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..47b4e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,18 @@
+Xilinx USB2 device controller
+
+Required properties:
+- compatible   : Should be "xlnx,usb2-device-4.00.a"
+- reg  : Physical base address and size of the USB2
+ device registers map.
+- interrupts   : Should contain single irq line of USB2 device
+ controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = "xlnx,usb2-device-4.00.a";
+interrupts = <0x0 0x39 0x1>;
+reg = <0x42e0 0x1>;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-07-22 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
Changes for v4:
- renamed xlnx,axi-usb2-device-4.00.a to xlnx,usb2-device-4.00.a
Changes for v3:
- None
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   18 ++
 1 files changed, 18 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..47b4e39
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,18 @@
+Xilinx USB2 device controller
+
+Required properties:
+- compatible   : Should be xlnx,usb2-device-4.00.a
+- reg  : Physical base address and size of the USB2
+ device registers map.
+- interrupts   : Should contain single irq line of USB2 device
+ controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = xlnx,usb2-device-4.00.a;
+interrupts = 0x0 0x39 0x1;
+reg = 0x42e0 0x1;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-04-03 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx axi udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta 
---
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..7c24fac
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,20 @@
+Xilinx AXI USB2 device controller
+
+Required properties:
+- compatible   : Should be "xlnx,axi-usb2-device-4.00.a"
+- reg  : Physical base address and size of the Axi USB2
+ device registers map.
+- interrupts   : Property with a value describing the interrupt
+ number.
+- interrupt-parent : Must be core interrupt controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = "xlnx,axi-usb2-device-4.00.a";
+interrupt-parent = <0x1>;
+interrupts = <0x0 0x39 0x1>;
+reg = <0x42e0 0x1>;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/2] usb: doc: udc-xilinx: Add devicetree bindings

2014-04-03 Thread Subbaraya Sundeep Bhatta
Add devicetree bindings for Xilinx axi udc driver.

Signed-off-by: Subbaraya Sundeep Bhatta sbha...@xilinx.com
---
Changes for v2:
- replaced xlnx,include-dma with xlnx,has-builtin-dma

 .../devicetree/bindings/usb/udc-xilinx.txt |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/udc-xilinx.txt

diff --git a/Documentation/devicetree/bindings/usb/udc-xilinx.txt 
b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
new file mode 100644
index 000..7c24fac
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/udc-xilinx.txt
@@ -0,0 +1,20 @@
+Xilinx AXI USB2 device controller
+
+Required properties:
+- compatible   : Should be xlnx,axi-usb2-device-4.00.a
+- reg  : Physical base address and size of the Axi USB2
+ device registers map.
+- interrupts   : Property with a value describing the interrupt
+ number.
+- interrupt-parent : Must be core interrupt controller
+- xlnx,has-builtin-dma : if DMA is included
+
+Example:
+   axi-usb2-device@42e0 {
+compatible = xlnx,axi-usb2-device-4.00.a;
+interrupt-parent = 0x1;
+interrupts = 0x0 0x39 0x1;
+reg = 0x42e0 0x1;
+xlnx,has-builtin-dma;
+};
+
-- 
1.7.4


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/