Device tree support for OMAP HS USB Host
Subsystems (7)
v2 cover Device tree support for OMAP HS USB Host
Hi,
This patchset adds device tree support for OMAP's High Speed USB Host subsystem. Board adaptation for Panda and Beagleboard is also provided.
Tested on Beagleboard.
Will not yet work on Pandaboard as PHY clock is not provided in device tree. We will need to address the PHY clock as per the discussion.
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg84525.html
v2:
- Addressed review comments, hopefully device tree parsing is more compliant and robust now.
- Added one new patch to fix omap-ehci module auto loading
The following changes since commit 286752ff5401f4b1675c4c33d13252a96e66bcb3:
USB: ehci-omap: Select NOP USB transceiver driver (2013-02-07 17:00:54 +0200)
are available in the git repository at:
git at github.com:rogerq/linux.git usb-next-usbhost16-dt
Roger Quadros (14):
usb: phy: nop: Add device tree support and binding information
USB: phy: nop: Defer probe if device needs VCC/RESET
mfd: omap-usb-tll: move configuration code to omap_tll_init()
mfd: omap-usb-tll: Add device tree support
USB: ehci-omap: Get platform resources by index rather than by name
USB: ohci-omap3: Get platform resources by index rather than by name
USB: ohci-omap3: Add device tree support and binding information
USB: ehci-omap: Add device tree support and binding information
mfd: omap-usb-host: Add device tree support and binding information
ARM: dts: OMAP4: Add HS USB Host IP nodes
ARM: dts: omap4-panda: Add USB Host support
ARM: dts: OMAP3: Add HS USB Host IP nodes
ARM: dts: omap3-beagle: Add USB Host support
USB: ehci-omap: Fix autoloading of module
.../devicetree/bindings/mfd/omap-usb-host.txt | 80 ++++++++ .../devicetree/bindings/mfd/omap-usb-tll.txt | 17 ++ .../devicetree/bindings/usb/omap-ehci.txt | 34 +++ .../devicetree/bindings/usb/omap3-ohci.txt | 17 ++ .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 +++ arch/arm/boot/dts/omap3-beagle.dts | 71 +++++++ arch/arm/boot/dts/omap3.dtsi | 31 +++ arch/arm/boot/dts/omap4-panda.dts | 55 +++++ arch/arm/boot/dts/omap4.dtsi | 30 +++ drivers/mfd/omap-usb-host.c | 167 +++++++++++++++- drivers/mfd/omap-usb-tll.c | 213 ++++++++++---------- drivers/mfd/omap-usb.h | 5 +- drivers/usb/host/ehci-omap.c | 46 ++++- drivers/usb/host/ohci-omap3.c | 24 ++- drivers/usb/otg/nop-usb-xceiv.c | 47 ++++- include/linux/usb/nop-usb-xceiv.h | 4 + 16 files changed, 743 insertions(+), 132 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt create mode 100644 Documentation/devicetree/bindings/usb/omap3-ohci.txt create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
Signature · 1 line
1.7.4.1
PATCH v2 1/14 usb: phy: nop: Add device tree support and binding information
The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree.
--- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 ++++++++++++++++++ drivers/usb/otg/nop-usb-xceiv.c | 36 +++++++++++++++---- 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +34 -0
@@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceiv + +Optional properties: +- clocks: phandle to the PHY clock. Use as per Documentation/devicetree + /bindings/clock/clock-bindings.txt + This property is required if clock-frequency is specified. + +- clock-names: Should be "main_clk" + +- clock-frequency: the clock frequency (in Hz) that the PHY clock must + be configured to. + +- vcc-supply: phandle to the regulator that provides RESET to the PHY. + +- reset-supply: phandle to the regulator that provides power to the PHY. + +Example: + + hsusb1_phy { + compatible = "usb-nop-xceiv"; + clock-frequency = <19200000>; + clocks = <&osc 0>; + clock-names = "main_clk"; + vcc-supply = <&hsusb1_vcc_regulator>; + reset-supply = <&hsusb1_reset_regulator>; + }; + +hsusb1_phy is a NOP USB PHY device that gets its clock from an oscillator +and expects that clock to be configured to 19.2MHz by the NOP PHY driver. +hsusb1_vcc_regulator provides power to the PHY and hsusb1_reset_regulator +controls RESET.
drivers/usb/otg/nop-usb-xceiv.c +28 -8
@@ -34,13 +34,15 @@#include <linux/slab.h> #include <linux/clk.h> #include <linux/regulator/consumer.h> +#include <linux/of.h> struct nop_usb_xceiv { -struct usb_phy phy; -struct device *dev; -struct clk *clk; -struct regulator *vcc; -struct regulator *reset; +struct usb_phy phy; +struct device *dev; +struct clk *clk; +struct regulator *vcc; +struct regulator *reset; +u32 clk_rate; };static struct platform_device *pd;
@@ -140,6 +142,7 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host)static int nop_usb_xceiv_probe (struct platform_device *pdev) { +struct device *dev = &pdev->dev;struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data;struct nop_usb_xceiv *nop;enum usb_phy_type type =USB_PHY_TYPE_USB2 ;
@@ -153,8 +156,17 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)if (!nop->phy.otg)return -ENOMEM ; -if (pdata) +if (dev->of_node) { +struct device_node *node = dev->of_node; +u32 clk_rate; + +if (!of_property_read_u32 (node,"clock-frequency" , &clk_rate)) + nop->clk_rate = clk_rate; + + }else if (pdata) { type = pdata->type; + nop->clk_rate = pdata->clk_rate; + } nop->clk =devm_clk_get (&pdev->dev,"main_clk" );if (IS_ERR (nop->clk)) {
@@ -162,8 +174,8 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev) PTR_ERR(nop->clk)); } -if (!IS_ERR (nop->clk) && pdata && pdata->clk_rate) { - err =clk_set_rate (nop->clk, pdata->clk_rate); +if (!IS_ERR (nop->clk) && nop->clk_rate) { + err =clk_set_rate (nop->clk, nop->clk_rate);if (err) {dev_err (&pdev->dev,"Error setting clock rate\n" );return err;
@@ -236,12 +248,20 @@ static int nop_usb_xceiv_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id nop_xceiv_dt_ids[] = { + { .compatible ="usb-nop-xceiv" }, + { } +}; + +MODULE_DEVICE_TABLE (of, nop_xceiv_dt_ids); +static struct platform_driver nop_usb_xceiv_driver = { .probe = nop_usb_xceiv_probe, .remove = nop_usb_xceiv_remove, .driver = { .name ="nop_usb_xceiv" , .owner =THIS_MODULE , + .of_match_table =of_match_ptr (nop_xceiv_dt_ids), }, };
Signature · 1 line
1.7.4.1
Re: [PATCH v2 01/14] usb: phy: nop: Add device tree support and binding information
Hello,
Quoted 17 lines · Roger Quadros
The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Felipe Balbi <[email protected]>--- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 ++++++++++++++++++ drivers/usb/otg/nop-usb-xceiv.c | 36 +++++++++++++++---- 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txtDocumentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +0
-0
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +4
-0@@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceiv
This might be better as "linux,usb-no-xceiv", given this is a Linux-specific 'device'.
Saying that, I'm not sure I understand why this device needs to be instantiated from devicetree. As I understand it from looking at the driver, it's purely a Linux implementation detail used in the case of autonomous PHYs, and not an actual piece of hardware or firmware system. I must admit to being unfamiliar with this area of hardware, have I misunderstood somethign here?
Can we not have drivers for autonomous PHYs initialise/register nop-usb-xceiv? That way we don't leak Linux implementation details to the outside world, and the dt can describe purely what's actually present in the system.
[...]
Thanks,
Mark.
Re: [PATCH v2 01/14] usb: phy: nop: Add device tree support and binding information
Quoted 28 lines · Mark Rutland
Hello,
Quoted 17 lines · Roger Quadros
The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Felipe Balbi <[email protected]>--- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 ++++++++++++++++++ drivers/usb/otg/nop-usb-xceiv.c | 36 +++++++++++++++---- 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txtDocumentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +0
-0Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +4
-0@@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceivThis might be better as "linux,usb-no-xceiv", given this is a Linux-specific 'device'.
Quoted 5 lines
Saying that, I'm not sure I understand why this device needs to be instantiated from devicetree. As I understand it from looking at the driver, it's purely a Linux implementation detail used in the case of autonomous PHYs, and not an actual piece of hardware or firmware system. I must admit to being unfamiliar with this area of hardware, have I misunderstood somethign here?
The PHY is a physical device and may need resources like power and clock to be functional. The only reason that driver is named NOP is that many USB controllers know how to talk to the standard PHYs and don't need any interface/management software.
The PHY driver you are looking at most likely doesn't have the recent changes I wrote to manage the PHY clock/reset/power. i.e. patches 3, 4 and 5 in the series
https://lkml.org/lkml/2013/1/28/275
Before this, the ehci-omap driver was trying to manage the PHY power and reset, which was wrong.
regards,
-roger
Re: [PATCH v2 01/14] usb: phy: nop: Add device tree support and binding information
Hi Roger,
Quoted 35 lines · Roger Quadros
Quoted 28 lines · Mark Rutland
Hello,
Quoted 17 lines · Roger Quadros
The PHY clock, clock rate, VCC regulator and RESET regulator can now be provided via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Felipe Balbi <[email protected]>--- .../devicetree/bindings/usb/usb-nop-xceiv.txt | 34 ++++++++++++++++++ drivers/usb/otg/nop-usb-xceiv.c | 36 +++++++++++++++---- 2 files changed, 62 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/usb-nop-xceiv.txtDocumentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +0
-0Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt line 4
Quoted 4 lines
Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt new file +4
-0@@ -0,0 +1,34 @@ +USB NOP PHY + +Required properties: +- compatible: should be usb-nop-xceivThis might be better as "linux,usb-no-xceiv", given this is a Linux-specific 'device'.
Quoted 5 lines
Saying that, I'm not sure I understand why this device needs to be instantiated from devicetree. As I understand it from looking at the driver, it's purely a Linux implementation detail used in the case of autonomous PHYs, and not an actual piece of hardware or firmware system. I must admit to being unfamiliar with this area of hardware, have I misunderstood somethign here?
Quoted 3 lines
The PHY is a physical device and may need resources like power and clock to be functional. The only reason that driver is named NOP is that many USB controllers know how to talk to the standard PHYs and don't need any interface/management software.
Ok. That makes sense. Apologies for the noise.
Quoted 7 lines
The PHY driver you are looking at most likely doesn't have the recent changes I wrote to manage the PHY clock/reset/power. i.e. patches 3, 4 and 5 in the series
https://lkml.org/lkml/2013/1/28/275Before this, the ehci-omap driver was trying to manage the PHY power and reset, which was wrong.
Yes. That makes a lot more sense now.
Thanks for the info!
Thanks,
Mark.
PATCH v2 2/14 USB: phy: nop: Defer probe if device needs VCC/RESET
In reply to Roger QuadrosAdd 2 flags, needs_vcc and needs_reset to platform data. If the flag is set and the regulator couldn't be found then we bail out with -EPROBE_DEFER.
For device tree boot we depend on presensce of vcc-supply/ reset-supply properties to decide if we should bail out with -EPROBE_DEFER or just continue in case the regulator can't be found.
This is required for proper functionality in cases where the regulator is needed but is probed later than the PHY device.
--- drivers/usb/otg/nop-usb-xceiv.c | 11 +++++++++++ include/linux/usb/nop-usb-xceiv.h | 4 ++++ 2 files changed, 15 insertions(+), 0 deletions(-)
drivers/usb/otg/nop-usb-xceiv.c +11 -0
@@ -43,6 +43,8 @@ struct nop_usb_xceiv {struct regulator *vcc;struct regulator *reset;u32 clk_rate; + unsigned int needs_vcc:1; + unsigned int needs_reset:1; };static struct platform_device *pd;
@@ -163,9 +165,14 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)if (!of_property_read_u32 (node,"clock-frequency" , &clk_rate)) nop->clk_rate = clk_rate; + nop->needs_vcc =of_property_read_bool (node,"vcc-supply" ); + nop->needs_reset =of_property_read_bool (node,"reset-supply" ); + }else if (pdata) { type = pdata->type; nop->clk_rate = pdata->clk_rate; + nop->needs_vcc = pdata->needs_vcc; + nop->needs_reset = pdata->needs_reset; } nop->clk =devm_clk_get (&pdev->dev,"main_clk" );
@@ -194,12 +201,16 @@ static int nop_usb_xceiv_probe(struct platform_device *pdev)if (IS_ERR (nop->vcc)) {dev_dbg (&pdev->dev,"Error getting vcc regulator: %ld\n" ,PTR_ERR (nop->vcc)); +if (nop->needs_vcc) +return -EPROBE_DEFER ; } nop->reset =devm_regulator_get (&pdev->dev,"reset" );if (IS_ERR (nop->reset)) {dev_dbg (&pdev->dev,"Error getting reset regulator: %ld\n" ,PTR_ERR (nop->reset)); +if (nop->needs_reset) +return -EPROBE_DEFER ; } nop->dev = &pdev->dev;
include/linux/usb/nop-usb-xceiv.h +4 -0
@@ -6,6 +6,10 @@struct nop_usb_xceiv_platform_data {enum usb_phy_type type;unsigned long clk_rate; + +/* if set fails with -EPROBE_DEFER if can't get regulator */ +unsigned int needs_vcc:1 ; +unsigned int needs_reset:1 ; };#if defined(CONFIG_NOP_USB_XCEIV ) || (defined(CONFIG_NOP_USB_XCEIV_MODULE ) && defined(MODULE ))
Signature · 1 line
1.7.4.1
PATCH v2 3/14 mfd: omap-usb-tll: move configuration code to omap_tll_init()
In reply to Roger QuadrosThis is because we want to get rid of platform_data usage from probe(). The only information we need is PORT_MODE, and this can be supplied to us by the user (i.e. omap-usb-host.c).
We also move channel clock management from runtime PM handlers into omap_tll_enable/disable().
--- drivers/mfd/omap-usb-host.c | 7 +- drivers/mfd/omap-usb-tll.c | 204 +++++++++++++++++++++---------------------- drivers/mfd/omap-usb.h | 5 +- 3 files changed, 107 insertions(+), 109 deletions(-)
drivers/mfd/omap-usb-host.c +5 -2
@@ -278,7 +278,7 @@ static int usbhs_runtime_resume(struct device *dev)dev_dbg (dev,"usbhs_runtime_resume\n" ); -omap_tll_enable (); +omap_tll_enable (pdata);if (!IS_ERR (omap->ehci_logic_fck))clk_enable (omap->ehci_logic_fck);
@@ -353,7 +353,7 @@ static int usbhs_runtime_suspend(struct device *dev)if (!IS_ERR (omap->ehci_logic_fck))clk_disable (omap->ehci_logic_fck); -omap_tll_disable (); +omap_tll_disable (pdata);return 0 ; }
@@ -499,6 +499,9 @@ static int usbhs_omap_probe(struct platform_device *pdev) omap->pdata = pdata; +/* Initialize the TLL subsystem */ +omap_tll_init (pdata); +pm_runtime_enable (dev);platform_set_drvdata (pdev, omap);
drivers/mfd/omap-usb-tll.c +99 -105
296 lines not on this page · raw message
drivers/mfd/omap-usb.h +3 -2
@@ -1,2 +1,3 @@ -extern int omap_tll_enable (void ); -extern int omap_tll_disable (void ); +extern int omap_tll_init (struct usbhs_omap_platform_data *pdata); +extern int omap_tll_enable (struct usbhs_omap_platform_data *pdata); +extern int omap_tll_disable (struct usbhs_omap_platform_data *pdata);
Signature · 1 line
1.7.4.1
PATCH v2 4/14 mfd: omap-usb-tll: Add device tree support
In reply to Roger QuadrosEnable this driver to probe in device tree boot.
--- .../devicetree/bindings/mfd/omap-usb-tll.txt | 17 +++++++++++++++++ drivers/mfd/omap-usb-tll.c | 9 +++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-tll.txt
Documentation/devicetree/bindings/mfd/omap-usb-tll.txt new file +17 -0
@@ -0,0 +1,17 @@ +OMAP HS USB Host TLL (Transceiver-Less Interface) + +Required properties: + +- compatible : should be "ti,usbhs-tll" +- reg : should contain one register range i.e. start and length +- interrupts : should contain the TLL module's interrupt +- ti,hwmod : must contain "usb_tll_hs" + +Example: + + usbhstll: usbhstll at 4a062000 { + compatible = "ti,usbhs-tll"; + reg = <0x4a062000 0x1000>; + interrupts = <78>; + ti,hwmods = "usb_tll_hs"; + };
drivers/mfd/omap-usb-tll.c +9 -0
@@ -28,6 +28,7 @@#include <linux/err.h> #include <linux/pm_runtime.h> #include <linux/platform_data/usb-omap.h> +#include <linux/of.h> #define USBTLL_DRIVER_NAME "usbhs_tll"
@@ -311,10 +312,18 @@ static int usbtll_omap_remove(struct platform_device *pdev)return 0 ; } +static const struct of_device_id usbtll_omap_dt_ids[] = { + { .compatible ="ti,usbhs-tll" }, + { } +}; + +MODULE_DEVICE_TABLE (of, usbtll_omap_dt_ids); +static struct platform_driver usbtll_omap_driver = { .driver = { .name = (char *)usbtll_driver_name, .owner =THIS_MODULE , + .of_match_table =of_match_ptr (usbtll_omap_dt_ids), }, .probe = usbtll_omap_probe, .remove = usbtll_omap_remove,
Signature · 1 line
1.7.4.1
PATCH v2 5/14 USB: ehci-omap: Get platform resources by index rather than by name
In reply to Roger QuadrosSince there is only one resource per type we don't really need to use resource name to obtain it. This also also makes it easier for device tree adaptation.
--- drivers/usb/host/ehci-omap.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-omap.c +3 -4
@@ -148,16 +148,15 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)return -ENODEV ; } - irq =platform_get_irq_byname (pdev,"ehci-irq" ); + irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (dev,"EHCI irq failed\n" );return -ENODEV ; } - res =platform_get_resource_byname (pdev, -IORESOURCE_MEM ,"ehci" ); + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); regs =devm_request_and_ioremap (dev, res); -if (!regs) { +if (IS_ERR (regs)) {dev_err (dev,"Resource request/ioremap failed\n" );return -EADDRNOTAVAIL ; }
Signature · 1 line
1.7.4.1
PATCH v2 6/14 USB: ohci-omap3: Get platform resources by index rather than by name
In reply to Roger QuadrosSince there is only one resource per type we don't really need to use resource name to obtain it. This also also makes it easier for device tree adaptation.
--- drivers/usb/host/ohci-omap3.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/usb/host/ohci-omap3.c +2 -3
@@ -141,14 +141,13 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev)return -ENODEV ; } - irq =platform_get_irq_byname (pdev,"ohci-irq" ); + irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (dev,"OHCI irq failed\n" );return -ENODEV ; } - res =platform_get_resource_byname (pdev, -IORESOURCE_MEM ,"ohci" ); + res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );if (!res) {dev_err (dev,"UHH OHCI get resource failed\n" );return -ENOMEM ;
Signature · 1 line
1.7.4.1
PATCH v2 7/14 USB: ohci-omap3: Add device tree support and binding information
In reply to Roger QuadrosAllows the OHCI controller found in OMAP3 and later chips to be specified via device tree.
--- .../devicetree/bindings/usb/omap3-ohci.txt | 17 +++++++++++++++++ drivers/usb/host/ohci-omap3.c | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap3-ohci.txt
Documentation/devicetree/bindings/usb/omap3-ohci.txt new file +17 -0
@@ -0,0 +1,17 @@ +OMAP HS USB OHCI controller (OMAP3 and later) + +Required properties: + +- compatible: should be "ti,ohci-omap3" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller +- interrupts: description of the interrupt line + +Example for OMAP4: + +usbhsohci: ohci at 4a064800 { + compatible = "ti,ohci-omap3", "usb-ohci"; + reg = <0x4a064800 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 76 0x4>; +};
drivers/usb/host/ohci-omap3.c +19 -0
@@ -31,6 +31,8 @@#include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <linux/of.h> +#include <linux/dma-mapping.h> /*-------------------------------------------------------------------------*/
@@ -112,6 +114,8 @@ static const struct hc_driver ohci_omap3_hc_driver = {/*-------------------------------------------------------------------------*/ +static u64 omap_ohci_dma_mask =DMA_BIT_MASK (32 ); +/* * configure so an HC device and id are always provided * always called with process context; sleeping is OK
@@ -159,6 +163,13 @@ static int ohci_hcd_omap3_probe(struct platform_device *pdev)return -ENOMEM ; } +/* +* Right now device-tree probed devices don't get dma_mask set. +* Since shared usb code relies on it, set it here for now. +* Once we have dma capability bindings this can go away. +*/ +if (!pdev->dev.dma_mask) + pdev->dev.dma_mask = &omap_ohci_dma_mask; hcd =usb_create_hcd (&ohci_omap3_hc_driver, dev,dev_name (dev));
@@ -228,12 +239,20 @@ static void ohci_hcd_omap3_shutdown(struct platform_device *pdev) hcd->driver->shutdown (hcd); } +static const struct of_device_id omap_ohci_dt_ids[] = { + { .compatible ="ti,ohci-omap3" }, + { } +}; + +MODULE_DEVICE_TABLE (of, omap_ohci_dt_ids); +static struct platform_driver ohci_hcd_omap3_driver = { .probe = ohci_hcd_omap3_probe, .remove = ohci_hcd_omap3_remove, .shutdown = ohci_hcd_omap3_shutdown, .driver = { .name ="ohci-omap3" , + .of_match_table =of_match_ptr (omap_ohci_dt_ids), }, };
Signature · 1 line
1.7.4.1
Re: [PATCH v2 07/14] USB: ohci-omap3: Add device tree support and binding information
Quoted 17 lines · Roger Quadros
Allows the OHCI controller found in OMAP3 and later chips to be specified via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Alan Stern <[email protected]>--- .../devicetree/bindings/usb/omap3-ohci.txt | 17 +++++++++++++++++ drivers/usb/host/ohci-omap3.c | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap3-ohci.txtDocumentation/devicetree/bindings/usb/omap3-ohci.txt new file +0
-0
Documentation/devicetree/bindings/usb/omap3-ohci.txt line 7
Quoted 7 lines
Documentation/devicetree/bindings/usb/omap3-ohci.txt new file +7
-0@@ -0,0 +1,17 @@ +OMAP HS USB OHCI controller (OMAP3 and later) + +Required properties: + +- compatible: should be "ti,ohci-omap3" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller
I'm not sure that needs to be documented as a required property. It's a standard property, and if it's defined for the parent node, you won't need it here.
Otherwise, this looks fine to me.
Thanks,
Mark.
Re: [PATCH v2 07/14] USB: ohci-omap3: Add device tree support and binding information
Quoted 21 lines · Mark Rutland
Quoted 20 lines · Roger Quadros
Allows the OHCI controller found in OMAP3 and later chips to be specified via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Alan Stern <[email protected]>--- .../devicetree/bindings/usb/omap3-ohci.txt | 17 +++++++++++++++++ drivers/usb/host/ohci-omap3.c | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap3-ohci.txtDocumentation/devicetree/bindings/usb/omap3-ohci.txt new file +3
-0@@ -0,0 +1,17 @@ +OMAP HS USB OHCI controller (OMAP3 and later) + +Required properties:
Quoted 8 lines
Documentation/devicetree/bindings/usb/omap3-ohci.txt line 7
Quoted 4 lines
Documentation/devicetree/bindings/usb/omap3-ohci.txt new file +4
-0+ +- compatible: should be "ti,ohci-omap3" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controllerI'm not sure that needs to be documented as a required property. It's a standard property, and if it's defined for the parent node, you won't need it here.
The last time I tried without 'interrupt-parent' it complained. Doesn't do it anymore. Maybe I did something wrong the last time. I'll remove it.
Quoted 2 lines
Otherwise, this looks fine to me.
Thanks. I'll add your reviewed-by tag after addressing the above comment.
cheers,
-roger
Re: [PATCH v2 07/14] USB: ohci-omap3: Add device tree support and binding information
Quoted 10 lines
Quoted 9 lines
Documentation/devicetree/bindings/usb/omap3-ohci.txt line 7
Quoted 5 lines
Documentation/devicetree/bindings/usb/omap3-ohci.txt new file +5
-0+Required properties: + +- compatible: should be "ti,ohci-omap3" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controllerI'm not sure that needs to be documented as a required property. It's a standard property, and if it's defined for the parent node, you won't need it here.
Quoted 7 lines
The last time I tried without 'interrupt-parent' it complained. Doesn't do it anymore. Maybe I did something wrong the last time. I'll remove it.
Quoted 2 lines
Otherwise, this looks fine to me.
Thanks. I'll add your reviewed-by tag after addressing the above comment.
Sure.
Thanks,
Mark.
PATCH v2 8/14 USB: ehci-omap: Add device tree support and binding information
In reply to Roger QuadrosAllows the OMAP EHCI controller to be specified via device tree.
--- .../devicetree/bindings/usb/omap-ehci.txt | 34 ++++++++++++++++++ drivers/usb/host/ehci-omap.c | 36 +++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txt
Documentation/devicetree/bindings/usb/omap-ehci.txt new file +34 -0
@@ -0,0 +1,34 @@ +OMAP HS USB EHCI controller + +This device is usually the child of the omap-usb-host +Documentation/devicetree/bindings/mfd/omap-usb-host.txt + +Required properties: + +- compatible: should be "ti,ehci-omap" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller +- interrupts: description of the interrupt line + +Optional properties: + +- phys: list of phandles to PHY nodes. + This property is required if at least one of the ports are in + PHY mode i.e. OMAP_EHCI_PORT_MODE_PHY + +To specify the port mode, see +Documentation/devicetree/bindings/mfd/omap-usb-host.txt + +Example for OMAP4: + +usbhsehci: ehci at 4a064c00 { + compatible = "ti,ehci-omap", "usb-ehci"; + reg = <0x4a064c00 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 77 0x4>; +}; + +&usbhsehci { + phys = <&hsusb1_phy 0 &hsusb3_phy>; +}; +
drivers/usb/host/ehci-omap.c +35 -1
@@ -48,6 +48,8 @@#include <linux/clk.h> #include <linux/usb.h> #include <linux/usb/hcd.h> +#include <linux/of.h> +#include <linux/dma-mapping.h> #include "ehci.h"
@@ -121,6 +123,8 @@ static const struct ehci_driver_overrides ehci_omap_overrides __initdata = { .extra_priv_size = sizeof(struct omap_hcd), }; +static u64 omap_ehci_dma_mask =DMA_BIT_MASK (32 ); +/** * ehci_hcd_omap_probe - initialize TI-based HCDs *
@@ -148,6 +152,17 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)return -ENODEV ; } +/* For DT boot, get platform data from parent. i.e. usbhshost */ +if (dev->of_node) { + pdata = dev->parent->platform_data; + dev->platform_data = pdata; + } + +if (!pdata) { +dev_err (dev,"Missing platform data\n" ); +return -ENODEV ; + } + irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (dev,"EHCI irq failed\n" );
@@ -161,6 +176,14 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)return -EADDRNOTAVAIL ; } +/* +* Right now device-tree probed devices don't get dma_mask set. +* Since shared usb code relies on it, set it here for now. +* Once we have dma capability bindings this can go away. +*/ +if (!pdev->dev.dma_mask) + pdev->dev.dma_mask = &omap_ehci_dma_mask; + hcd =usb_create_hcd (&ehci_omap_hc_driver, dev,dev_name (dev));if (!hcd) {
@@ -185,7 +208,10 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)continue ;/* get the PHY device */ - phy =devm_usb_get_phy_dev (dev, i); +if (dev->of_node) + phy =devm_usb_get_phy_by_phandle (dev,"phys" , i); +else + phy =devm_usb_get_phy_dev (dev, i);if (IS_ERR (phy) || !phy) { ret =IS_ERR (phy) ?PTR_ERR (phy) : -ENODEV ; dev_err(dev, "Can't get PHY device for port %d: %d\n",
@@ -275,6 +301,13 @@ static void ehci_hcd_omap_shutdown(struct platform_device *pdev) hcd->driver->shutdown (hcd); } +static const struct of_device_id omap_ehci_dt_ids[] = { + { .compatible ="ti,ehci-omap" }, + { } +}; + +MODULE_DEVICE_TABLE (of, omap_ehci_dt_ids); +static struct platform_driver ehci_hcd_omap_driver = { .probe = ehci_hcd_omap_probe, .remove = ehci_hcd_omap_remove,
@@ -283,6 +316,7 @@ static struct platform_driver ehci_hcd_omap_driver = {/*.resume = ehci_hcd_omap_resume, */ .driver = { .name = hcd_name, + .of_match_table = of_match_ptr(omap_ehci_dt_ids), } };
Signature · 1 line
1.7.4.1
Re: [PATCH v2 08/14] USB: ehci-omap: Add device tree support and binding information
Quoted 16 lines · Roger Quadros
Allows the OMAP EHCI controller to be specified via device tree.
Signed-off-by Roger Quadros <[email protected]>Acked-by Alan Stern <[email protected]>--- .../devicetree/bindings/usb/omap-ehci.txt | 34 ++++++++++++++++++ drivers/usb/host/ehci-omap.c | 36 +++++++++++++++++++- 2 files changed, 69 insertions(+), 1 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/omap-ehci.txtDocumentation/devicetree/bindings/usb/omap-ehci.txt new file +0
-0
Documentation/devicetree/bindings/usb/omap-ehci.txt line 10
Quoted 10 lines
Documentation/devicetree/bindings/usb/omap-ehci.txt new file +10
-0@@ -0,0 +1,34 @@ +OMAP HS USB EHCI controller + +This device is usually the child of the omap-usb-host +Documentation/devicetree/bindings/mfd/omap-usb-host.txt + +Required properties: + +- compatible: should be "ti,ehci-omap" +- reg: should contain one register range i.e. start and length +- interrupt-parent: phandle to the interrupt controller
Same comment as for ohci-omap3 here; I don't think it's necessary to document this as a required property.
Otherwise, looks good.
Thanks,
Mark.
PATCH v2 9/14 mfd: omap-usb-host: Add device tree support and binding information
In reply to Roger QuadrosAllows the OMAP HS USB host controller to be specified via device tree.
--- .../devicetree/bindings/mfd/omap-usb-host.txt | 80 ++++++++++ drivers/mfd/omap-usb-host.c | 160 +++++++++++++++++++- 2 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txt
Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file +80 -0
@@ -0,0 +1,80 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be "ti,usbhs-host" +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain "usb_host_hs" + +Optional properties: + +- num-ports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. A maximum of 3 ports are supported at the moment. + +- portN-mode: String specifying the port mode for port N, where N can be + from 1 to 3. If the port mode is not specified, that port is treated + as unused. When specified, it must be one of the following. + "ehci-phy", + "ehci-tll", + "ehci-hsic", + "ohci-phy-6pin-datse0", + "ohci-phy-6pin-dpdm", + "ohci-phy-3pin-datse0", + "ohci-phy-4pin-dpdm", + "ohci-tll-6pin-datse0", + "ohci-tll-6pin-dpdm", + "ohci-tll-3pin-datse0", + "ohci-tll-4pin-dpdm", + "ohci-tll-2pin-datse0", + "ohci-tll-2pin-dpdm", + +- single-ulpi-bypass: Must be present if the controller contains a single + ULPI bypass control bit. e.g. OMAP3 silicon <= ES2.1 + +Required properties if child node exists: + +- #address-cells: Must be 1 +- #size-cells: Must be 1 +- ranges: must be present + +Properties for children: + +The OMAP HS USB Host subsystem contains EHCI and OHCI controllers. +See Documentation/devicetree/bindings/usb/omap-ehci.txt and +omap3-ohci.txt + +Example for OMAP4: + +usbhshost: usbhshost@4a064000 { + compatible = "ti,usbhs-host"; + reg = <0x4a064000 0x800>; + ti,hwmods = "usb_host_hs"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + usbhsohci: ohci at 4a064800 { + compatible = "ti,ohci-omap3", "usb-ohci"; + reg = <0x4a064800 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 76 0x4>; + }; + + usbhsehci: ehci at 4a064c00 { + compatible = "ti,ehci-omap", "usb-ehci"; + reg = <0x4a064c00 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 77 0x4>; + }; +}; + +&usbhshost { + port1-mode = "ehci-phy"; + port2-mode = "ehci-tll"; + port3-mode = "ehci-phy"; +}; + +&usbhsehci { + phys = <&hsusb1_phy 0 &hsusb3_phy>; +};
drivers/mfd/omap-usb-host.c +154 -6
231 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Re: [PATCH v2 09/14] mfd: omap-usb-host: Add device tree support and binding information
Quoted 48 lines · Roger Quadros
Allows the OMAP HS USB host controller to be specified via device tree.
CC Samuel Ortiz <[email protected]>Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/mfd/omap-usb-host.txt | 80 ++++++++++ drivers/mfd/omap-usb-host.c | 160 +++++++++++++++++++- 2 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txtDocumentation/devicetree/bindings/mfd/omap-usb-host.txt new file +31
-0@@ -0,0 +1,80 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be "ti,usbhs-host" +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain "usb_host_hs" + +Optional properties: + +- num-ports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. A maximum of 3 ports are supported at the moment. + +- portN-mode: String specifying the port mode for port N, where N can be + from 1 to 3. If the port mode is not specified, that port is treated + as unused. When specified, it must be one of the following. + "ehci-phy", + "ehci-tll", + "ehci-hsic", + "ohci-phy-6pin-datse0", + "ohci-phy-6pin-dpdm", + "ohci-phy-3pin-datse0", + "ohci-phy-4pin-dpdm", + "ohci-tll-6pin-datse0", + "ohci-tll-6pin-dpdm", + "ohci-tll-3pin-datse0", + "ohci-tll-4pin-dpdm", + "ohci-tll-2pin-datse0", + "ohci-tll-2pin-dpdm", +
[...]
Quoted 29 lines
Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file +29
-0+/** + * Map 'enum usbhs_omap_port_mode' found in <linux/platform_data/usb-omap.h> + * to the device tree binding portN-mode found in + * 'Documentation/devicetree/bindings/mfd/omap-usb-host.txt' + */ +static const char *port_modes[] = { + [OMAP_USBHS_PORT_MODE_UNUSED] = "", + [OMAP_EHCI_PORT_MODE_PHY] = "ehci-phy", + [OMAP_EHCI_PORT_MODE_TLL] = "ehci-tll", + [OMAP_EHCI_PORT_MODE_HSIC] = "ehci-hsic", + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0] = "ohci-phy-6pin-datse0", + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM] = "ohci-phy-6pin-dpdm", + [OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0] = "ohci-phy-3pin-datse0", + [OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM] = "ohci-phy-4pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0] = "ohci-tll-6pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM] = "ohci-tll-6pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0] = "ohci-tll-3pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM] = "ohci-tll-4pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0] = "ohci-tll-2pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM] = "ohci-tll-2pin-dpdm", +}; + +/** + * omap_usbhs_get_dt_port_mode - Get the 'enum usbhs_omap_port_mode' + * from the port mode string. + * @mode: The port mode string, usually obtained from device tree. + * + * The function returns the 'enum usbhs_omap_port_mode' that matches the + * provided port mode string as per the port_modes table.
Documentation/devicetree/bindings/mfd/omap-usb-host.txt
Quoted 10 lines
Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file +10
-0+ * If no match is found it returns -ENODEV + */ +static const int omap_usbhs_get_dt_port_mode(const char *mode) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(port_modes); i++) { + if (!strcasecmp(mode, port_modes[i])) + return i; + }
Any reason for using strcasecmp rather than strcmp? The binding only specified lower case versions, and this allows people to write "oHcI-PhY-6PiN-DaTsE0" with impunity.
Otherwise, this looks fine to me.
Thanks,
Mark.
Re: [PATCH v2 09/14] mfd: omap-usb-host: Add device tree support and binding information
Quoted 87 lines · Mark Rutland
Quoted 48 lines · Roger Quadros
Allows the OMAP HS USB host controller to be specified via device tree.
CC Samuel Ortiz <[email protected]>Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/mfd/omap-usb-host.txt | 80 ++++++++++ drivers/mfd/omap-usb-host.c | 160 +++++++++++++++++++- 2 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/mfd/omap-usb-host.txtDocumentation/devicetree/bindings/mfd/omap-usb-host.txt new file +31
-0@@ -0,0 +1,80 @@ +OMAP HS USB Host + +Required properties: + +- compatible: should be "ti,usbhs-host" +- reg: should contain one register range i.e. start and length +- ti,hwmods: must contain "usb_host_hs" + +Optional properties: + +- num-ports: number of USB ports. Usually this is automatically detected + from the IP's revision register but can be overridden by specifying + this property. A maximum of 3 ports are supported at the moment. + +- portN-mode: String specifying the port mode for port N, where N can be + from 1 to 3. If the port mode is not specified, that port is treated + as unused. When specified, it must be one of the following. + "ehci-phy", + "ehci-tll", + "ehci-hsic", + "ohci-phy-6pin-datse0", + "ohci-phy-6pin-dpdm", + "ohci-phy-3pin-datse0", + "ohci-phy-4pin-dpdm", + "ohci-tll-6pin-datse0", + "ohci-tll-6pin-dpdm", + "ohci-tll-3pin-datse0", + "ohci-tll-4pin-dpdm", + "ohci-tll-2pin-datse0", + "ohci-tll-2pin-dpdm", +[...]
Quoted 35 lines
Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file +35
-0+/** + * Map 'enum usbhs_omap_port_mode' found in <linux/platform_data/usb-omap.h> + * to the device tree binding portN-mode found in + * 'Documentation/devicetree/bindings/mfd/omap-usb-host.txt' + */ +static const char *port_modes[] = { + [OMAP_USBHS_PORT_MODE_UNUSED] = "", + [OMAP_EHCI_PORT_MODE_PHY] = "ehci-phy", + [OMAP_EHCI_PORT_MODE_TLL] = "ehci-tll", + [OMAP_EHCI_PORT_MODE_HSIC] = "ehci-hsic", + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0] = "ohci-phy-6pin-datse0", + [OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM] = "ohci-phy-6pin-dpdm", + [OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0] = "ohci-phy-3pin-datse0", + [OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM] = "ohci-phy-4pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0] = "ohci-tll-6pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM] = "ohci-tll-6pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0] = "ohci-tll-3pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM] = "ohci-tll-4pin-dpdm", + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0] = "ohci-tll-2pin-datse0", + [OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM] = "ohci-tll-2pin-dpdm", +}; + +/** + * omap_usbhs_get_dt_port_mode - Get the 'enum usbhs_omap_port_mode' + * from the port mode string. + * @mode: The port mode string, usually obtained from device tree. + * + * The function returns the 'enum usbhs_omap_port_mode' that matches the + * provided port mode string as per the port_modes table. + * If no match is found it returns -ENODEV + */ +static const int omap_usbhs_get_dt_port_mode(const char *mode) +{ + int i; +
Quoted 8 lines
Documentation/devicetree/bindings/mfd/omap-usb-host.txt
Quoted 4 lines
Documentation/devicetree/bindings/mfd/omap-usb-host.txt new file +4
-0+ for (i = 0; i < ARRAY_SIZE(port_modes); i++) { + if (!strcasecmp(mode, port_modes[i])) + return i; + }Any reason for using strcasecmp rather than strcmp? The binding only specified lower case versions, and this allows people to write "oHcI-PhY-6PiN-DaTsE0" with impunity.
:). No specific reason. I'll change it to strcmp.
Quoted 2 lines
Otherwise, this looks fine to me.
Thanks.
cheers,
-roger
PATCH v2 10/14 ARM: dts: OMAP4: Add HS USB Host IP nodes
In reply to Roger QuadrosAdds device nodes for HS USB Host module, TLL module, OHCI and EHCI controllers.
--- arch/arm/boot/dts/omap4.dtsi | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4.dtsi +30 -0
@@ -529,5 +529,35 @@ ti,hwmods = "timer11"; ti,timer-pwm; }; + + usbhstll: usbhstll at 4a062000 { + compatible = "ti,usbhs-tll"; + reg = <0x4a062000 0x1000>; + interrupts = <0 78 0x4>; + ti,hwmods = "usb_tll_hs"; + }; + + usbhshost: usbhshost at 4a064000 { + compatible = "ti,usbhs-host"; + reg = <0x4a064000 0x800>; + ti,hwmods = "usb_host_hs"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + usbhsohci: ohci at 4a064800 { + compatible = "ti,ohci-omap3", "usb-ohci"; + reg = <0x4a064800 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 76 0x4>; + }; + + usbhsehci: ehci at 4a064c00 { + compatible = "ti,ehci-omap", "usb-ehci"; + reg = <0x4a064c00 0x400>; + interrupt-parent = <&gic>; + interrupts = <0 77 0x4>; + }; + }; }; };
Signature · 1 line
1.7.4.1
PATCH v2 11/14 ARM: dts: omap4-panda: Add USB Host support
In reply to Roger QuadrosProvide the RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device.
Also provide pin multiplexer information for the USB host pins.
--- arch/arm/boot/dts/omap4-panda.dts | 55 +++++++++++++++++++++++++++++++++++++ 1 files changed, 55 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +55 -0
@@ -57,6 +57,35 @@ "AFML", "Line In", "AFMR", "Line In"; }; + + /* HS USB Port 1 RESET */ + hsusb1_reset: hsusb1_reset_reg { + compatible = "regulator-fixed"; + regulator-name = "hsusb1_reset"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 30 0>; /* gpio_62 */ + startup-delay-us = <70000>; + enable-active-high; + }; + + /* HS USB Port 1 Power */ + hsusb1_power: hsusb1_power_reg { + compatible = "regulator-fixed"; + regulator-name = "hsusb1_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio1 1 0>; /* gpio_1 */ + startup-delay-us = <70000>; + enable-active-high; + }; + + /* HS USB Host PHY on PORT 1 */ + hsusb1_phy: hsusb1_phy { + compatible = "usb-nop-xceiv"; + reset-supply = <&hsusb1_reset>; + vcc-supply = <&hsusb1_power>; + }; }; &omap4_pmx_core {
@@ -67,6 +96,7 @@ &mcbsp1_pins &dss_hdmi_pins &tpd12s015_pins + &hsusbb1_pins >; twl6040_pins: pinmux_twl6040_pins {
@@ -110,6 +140,23 @@ 0x58 0x10b /* hdmi_hpd.gpio_63 INPUT PULLDOWN | MODE3 */ >; }; + + hsusbb1_pins: pinmux_hsusbb1_pins { + pinctrl-single,pins = < + 0x82 0x10C /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk INPUT | PULLDOWN */ + 0x84 0x4 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ + 0x86 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ + 0x88 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ + 0x8a 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ + 0x8c 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ + 0x8e 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ + 0x90 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ + 0x92 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ + 0x94 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ + 0x96 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ + 0x98 0x104 /* USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + >; + }; }; &i2c1 {
@@ -206,3 +253,11 @@ &twl_usb_comparator { usb-supply = <&vusb>; }; + +&usbhshost { + port1-mode = "ehci-phy"; +}; + +&usbhsehci { + phys = <&hsusb1_phy>; +};
Signature · 1 line
1.7.4.1
PATCH v2 12/14 ARM: dts: OMAP3: Add HS USB Host IP nodes
In reply to Roger QuadrosAdds device nodes for HS USB Host module, TLL module, OHCI and EHCI controllers.
--- arch/arm/boot/dts/omap3.dtsi | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3.dtsi +31 -0
@@ -397,5 +397,36 @@ ti,timer-alwon; ti,timer-secure; }; + + usbhstll: usbhstll at 48062000 { + compatible = "ti,usbhs-tll"; + reg = <0x48062000 0x1000>; + interrupts = <78>; + ti,hwmods = "usb_tll_hs"; + }; + + usbhshost: usbhshost at 48064000 { + compatible = "ti,usbhs-host"; + reg = <0x48064000 0x400>; + ti,hwmods = "usb_host_hs"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + usbhsohci: ohci at 48064400 { + compatible = "ti,ohci-omap3", "usb-ohci"; + reg = <0x48064400 0x400>; + interrupt-parent = <&intc>; + interrupts = <76>; + }; + + usbhsehci: ehci at 48064800 { + compatible = "ti,ehci-omap", "usb-ehci"; + reg = <0x48064800 0x400>; + interrupt-parent = <&intc>; + interrupts = <77>; + }; + }; + }; };
Signature · 1 line
1.7.4.1
PATCH v2 13/14 ARM: dts: omap3-beagle: Add USB Host support
In reply to Roger QuadrosProvide RESET and Power regulators for the USB PHY, the USB Host port mode and the PHY device.
Also provide pin multiplexer information for USB host pins.
--- arch/arm/boot/dts/omap3-beagle.dts | 71 ++++++++++++++++++++++++++++++++++++ 1 files changed, 71 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +71 -0
@@ -38,6 +38,57 @@ }; }; + /* HS USB Port 2 RESET */ + hsusb2_reset: hsusb2_reset_reg { + compatible = "regulator-fixed"; + regulator-name = "hsusb2_reset"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio5 19 0>; /* gpio_147 */ + startup-delay-us = <70000>; + enable-active-high; + }; + + /* HS USB Port 2 Power */ + hsusb2_power: hsusb2_power_reg { + compatible = "regulator-fixed"; + regulator-name = "hsusb2_vbus"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&twl_gpio 18 0>; /* GPIO LEDA */ + startup-delay-us = <70000>; + }; + + /* HS USB Host PHY on PORT 2 */ + hsusb2_phy: hsusb2_phy { + compatible = "usb-nop-xceiv"; + reset-supply = <&hsusb2_reset>; + vcc-supply = <&hsusb2_power>; + }; +}; + +&omap3_pmx_core { + pinctrl-names = "default"; + pinctrl-0 = < + &hsusbb2_pins + >; + + hsusbb2_pins: pinmux_hsusbb2_pins { + pinctrl-single,pins = < + 0x5c0 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */ + 0x5c2 0x3 /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */ + 0x5c4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */ + 0x5c6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */ + 0x5c8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */ + 0x5cA 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */ + 0x1a4 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */ + 0x1a6 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */ + 0x1a8 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */ + 0x1aa 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */ + 0x1ac 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */ + 0x1ae 0x10b /* USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */ + >; + }; }; &i2c1 {
@@ -65,3 +116,23 @@ &mmc3 { status = "disabled"; }; + +&usbhshost { + port2-mode = "ehci-phy"; +}; + +&usbhsehci { + phys = <0 &hsusb2_phy>; +}; + +&twl_gpio { + ti,use-leds; + /* pullups: BIT(1) */ + ti,pullups = <0x000002>; + /* + * pulldowns: + * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13) + * BIT(15), BIT(16), BIT(17) + */ + ti,pulldowns = <0x03a1c4>; +};
Signature · 1 line
1.7.4.1
PATCH v2 14/14 USB: ehci-omap: Fix autoloading of module
In reply to Roger QuadrosThe module alias should be "ehci-omap" and not "omap-ehci" to match the platform device name. The omap-ehci module should now autoload correctly.
--- drivers/usb/host/ehci-omap.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/usb/host/ehci-omap.c +2 -1
@@ -340,9 +340,10 @@ static void __exit ehci_omap_cleanup(void) }module_exit (ehci_omap_cleanup); -MODULE_ALIAS ("platform:omap-ehci" ); +MODULE_ALIAS ("platform:ehci-omap" );MODULE_AUTHOR ("Texas Instruments, Inc." );MODULE_AUTHOR ("Felipe Balbi <[email protected]>" ); +MODULE_AUTHOR ("Roger Quadros <[email protected]" );MODULE_DESCRIPTION (DRIVER_DESC );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.4.1
Re: [PATCH v2 14/14] USB: ehci-omap: Fix autoloading of module
Quoted 5 lines · Roger Quadros
The module alias should be "ehci-omap" and not "omap-ehci" to match the platform device name. The omap-ehci module should now autoload correctly.
Signed-off-by Roger Quadros <[email protected]>
Quoted 21 lines
--- drivers/usb/host/ehci-omap.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/usb/host/ehci-omap.c +2
-1@@ -340,9 +340,10 @@ static void __exit ehci_omap_cleanup(void) }module_exit (ehci_omap_cleanup); -MODULE_ALIAS ("platform:omap-ehci" ); +MODULE_ALIAS ("platform:ehci-omap" );MODULE_AUTHOR ("Texas Instruments, Inc." );MODULE_AUTHOR ("Felipe Balbi <[email protected]>" ); +MODULE_AUTHOR ("Roger Quadros <[email protected]" );MODULE_DESCRIPTION (DRIVER_DESC );MODULE_LICENSE ("GPL" );