Device tree support for OMAP USB Host
Subsystems (6)
cover Device tree support for OMAP USB Host
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
Tested on OMAP4 Panda ES Rev B1.
This patchset depends on the following series
http://www.mail-archive.com/[email protected]/msg80691.html
cheers,
-roger
---
Keshava Munegowda (1):
ARM: OMAP4: USB: Add pin mux configuration for panda board
Roger Quadros (3):
ARM: OMAP: usb-host: Device tree support for USB Host ARM/dts: omap4-panda: Add USB Host support
regulator: fixed: Properly use input_supply parameter from device
tree
.../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ .../bindings/regulator/fixed-regulator.txt | 6 +- arch/arm/boot/dts/omap4-panda.dts | 54 +++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 5 ++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ drivers/regulator/fixed.c | 6 +- 8 files changed, 200 insertions(+), 5 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txt
Signature · 1 line
1.7.4.1
A message that is not in the archive (sent off-list or not yet received): 1352991396-19589-1-git-send-email-rogerq-l0cyMroinI0@public.gmane.org
PATCH 1/4 ARM: OMAP: usb-host: Device tree support for USB Host
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
--- .../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ 4 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txt
Documentation/devicetree/bindings/arm/omap/usb-host.txt new file +60 -0
@@ -0,0 +1,60 @@ +* usb-host - OMAP USB Host Subsystem + +The OMAP USB host subsystem consists of the following modules +1) USBTLL (Tranceiverless interface) +2) USBHOST (Host Controller module) which includes both EHCI and OHCI controllers + +THe USB Host subsystem can be connected to the external world using 3 PORTs that could +be configured in various modes like UTMI+ for external PHY, ULPI transceiverless link (TLL), +Serial TLL, High-speed interchip (HSIC), etc. + +Required proprties: +- compatible: Must be "ti,usb-host"; +- num_ports: Number of physical ports available + +Optional properties: +- 1 child node for each available port. These child nodes are usually supplied by the + board support device tree as they are specific to how the ports are wired on the board + + - mode: Integer specifying the mode in which the port is used + * OMAP_USBHS_PORT_MODE_UNUSED = 0, + * OMAP_EHCI_PORT_MODE_PHY = 1, + * OMAP_EHCI_PORT_MODE_TLL = 2, + * OMAP_EHCI_PORT_MODE_HSIC = 3, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 = 4, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM = 5, + * OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0 = 6, + * OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM = 7, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 = 8, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM = 9, + * OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0 = 10, + * OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM = 11, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0 = 12, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM = 13, + - clk: Name of the clock that needs to be active when using the port + - clkrate: Frequency at which the above clk needs to be run at + + +Example: + +/* In the OMAP Core tree */ +usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <3>; +}; + +/* In the Board tree */ +&usbhost { + port@0 { + mode = <1>; + clk = "auxclk3_ck"; + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; +
arch/arm/mach-omap2/board-generic.c +1 -0
@@ -40,6 +40,7 @@ static void __init omap_generic_init(void)omap_sdrc_init (NULL ,NULL );of_platform_populate (NULL , omap_dt_match_table,NULL ,NULL ); +usbhost_init_of (); }#ifdef CONFIG_SOC_OMAP2420
arch/arm/mach-omap2/common.h +2 -0
@@ -339,5 +339,7 @@ extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,struct omap2_hsmmc_info ;extern int omap4_twl6030_hsmmc_init (struct omap2_hsmmc_info *controllers); +void __init usbhost_init_of (void ); +#endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */
arch/arm/mach-omap2/usb-host.c +71 -0
80 lines not on this page · raw message
Signature · 6 lines
1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/4] ARM: OMAP: usb-host: Device tree support for USB Host
Hi Roger,
Quoted 89 lines · Roger Quadros
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ 4 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txtDocumentation/devicetree/bindings/arm/omap/usb-host.txt new file +60
-0@@ -0,0 +1,60 @@ +* usb-host - OMAP USB Host Subsystem + +The OMAP USB host subsystem consists of the following modules +1) USBTLL (Tranceiverless interface) +2) USBHOST (Host Controller module) which includes both EHCI and OHCI controllers + +THe USB Host subsystem can be connected to the external world using 3 PORTs that could +be configured in various modes like UTMI+ for external PHY, ULPI transceiverless link (TLL), +Serial TLL, High-speed interchip (HSIC), etc. + +Required proprties: +- compatible: Must be "ti,usb-host"; +- num_ports: Number of physical ports available + +Optional properties: +- 1 child node for each available port. These child nodes are usually supplied by the + board support device tree as they are specific to how the ports are wired on the board + + - mode: Integer specifying the mode in which the port is used + * OMAP_USBHS_PORT_MODE_UNUSED = 0, + * OMAP_EHCI_PORT_MODE_PHY = 1, + * OMAP_EHCI_PORT_MODE_TLL = 2, + * OMAP_EHCI_PORT_MODE_HSIC = 3, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 = 4, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM = 5, + * OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0 = 6, + * OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM = 7, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 = 8, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM = 9, + * OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0 = 10, + * OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM = 11, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0 = 12, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM = 13, + - clk: Name of the clock that needs to be active when using the port + - clkrate: Frequency at which the above clk needs to be run at + + +Example: + +/* In the OMAP Core tree */ +usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <3>; +}; + +/* In the Board tree */ +&usbhost { + port@0 { + mode = <1>; + clk = "auxclk3_ck"; + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; +arch/arm/mach-omap2/board-generic.c +0
-0
arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 43
Quoted 4 lines
arch/arm/mach-omap2/board-generic.c +1
-0@@ -40,6 +40,7 @@ static void __init omap_generic_init(void)omap_sdrc_init (NULL ,NULL );of_platform_populate (NULL , omap_dt_match_table,NULL ,NULL ); +usbhost_init_of ();
You should never have to add that kind of hacks in generic board file. Why do you need that during board init?
In theory, the of_platform_populate will create all the devices, and during the driver probe you will create the sub nodes.
This way of initializing early from DT node is done only for critical ARM/OMAP infrastructure stuff like GIC, L2 controller... It should not be required for USB, that is not even a mandatory IP to use the OMAP.
Regards,
Benoit
Quoted 102 lines
arch/arm/mach-omap2/board-generic.c +0
-0}#ifdef CONFIG_SOC_OMAP2420 arch/arm/mach-omap2/common.h +2
-0@@ -339,5 +339,7 @@ extern void omap_sdrc_init(struct omap_sdrc_params *sdrc_cs0,struct omap2_hsmmc_info ;extern int omap4_twl6030_hsmmc_init (struct omap2_hsmmc_info *controllers); +void __init usbhost_init_of (void ); +#endif /* __ASSEMBLER__ */ #endif /* __ARCH_ARM_MACH_OMAP2PLUS_COMMON_H */ arch/arm/mach-omap2/usb-host.c +71
-0@@ -22,6 +22,8 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/dma-mapping.h> +#include <linux/of.h> +#include <linux/of_gpio.h> #include <asm/io.h> @@ -556,3 +558,72 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) }#endif + +static struct usbhs_omap_board_data bdata; + +#define USBHS_NODE "usb-host" + +/** +* usbhost_init_of - initialize USB Host subsystem from device tree +* +* Scans the device tree for required information and populates +* platform data for the OMAP USB High Speed Host subsystem +*/ +void __init usbhost_init_of (void ) +{ +int r; +struct device_node *node, *child; +int num_ports; +int i; + + node =of_find_node_by_name (NULL ,USBHS_NODE ); +if (!node) { +pr_err ("%s could not find OF node : %s\n" , + __func__,USBHS_NODE ); +return ; + } + + r =of_property_read_u32 (node,"num_ports" , &num_ports); +if (r) { +pr_err ("%s num_ports not specified in OF node %s\n" , + __func__,USBHS_NODE ); + } + + r =of_property_read_bool (node,"phy_reset" ); + bdata.phy_reset = r; + + i =0 ; +for_each_child_of_node (node, child) { +int mode; +const char *clk_name; +u32 clk_rate; + + r =of_property_read_u32 (child,"mode" , &mode); +if (r) { +pr_err ("%s mode not specified in OF node %s port %d\n" , + __func__,USBHS_NODE , i); + bdata.port_mode[i] =OMAP_USBHS_PORT_MODE_UNUSED ; + }else { + bdata.port_mode[i] = mode; + } + + r =of_get_named_gpio (child,"reset_gpio" ,0 ); +if (gpio_is_valid (r)) + bdata.reset_gpio_port[i] = r; +else + bdata.reset_gpio_port[i] = -EINVAL ; + + clk_name =of_get_property (child,"clk" ,NULL ); +if (clk_name) + bdata.clk[i] = clk_name; + + r =of_property_read_u32 (child,"clkrate" , &clk_rate); +if (!r) + bdata.clkrate[i] = clk_rate; + + i++; + } + +usbhs_init (&bdata); +} +
Re: [PATCH 1/4] ARM: OMAP: usb-host: Device tree support for USB Host
Hi Benoit,
Quoted 94 lines · Benoit Cousson
Hi Roger,
Quoted 91 lines · Roger Quadros
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ 4 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txtDocumentation/devicetree/bindings/arm/omap/usb-host.txt new file +60
-0@@ -0,0 +1,60 @@ +* usb-host - OMAP USB Host Subsystem + +The OMAP USB host subsystem consists of the following modules +1) USBTLL (Tranceiverless interface) +2) USBHOST (Host Controller module) which includes both EHCI and OHCI controllers + +THe USB Host subsystem can be connected to the external world using 3 PORTs that could +be configured in various modes like UTMI+ for external PHY, ULPI transceiverless link (TLL), +Serial TLL, High-speed interchip (HSIC), etc. + +Required proprties: +- compatible: Must be "ti,usb-host"; +- num_ports: Number of physical ports available + +Optional properties: +- 1 child node for each available port. These child nodes are usually supplied by the + board support device tree as they are specific to how the ports are wired on the board + + - mode: Integer specifying the mode in which the port is used + * OMAP_USBHS_PORT_MODE_UNUSED = 0, + * OMAP_EHCI_PORT_MODE_PHY = 1, + * OMAP_EHCI_PORT_MODE_TLL = 2, + * OMAP_EHCI_PORT_MODE_HSIC = 3, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 = 4, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM = 5, + * OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0 = 6, + * OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM = 7, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 = 8, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM = 9, + * OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0 = 10, + * OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM = 11, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0 = 12, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM = 13, + - clk: Name of the clock that needs to be active when using the port + - clkrate: Frequency at which the above clk needs to be run at + + +Example: + +/* In the OMAP Core tree */ +usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <3>; +}; + +/* In the Board tree */ +&usbhost { + port@0 { + mode = <1>; + clk = "auxclk3_ck"; + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; +arch/arm/mach-omap2/board-generic.c +0
-0@@ -40,6 +40,7 @@ static void __init omap_generic_init(void)omap_sdrc_init (NULL ,NULL );
Quoted 9 lines
arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 43
Quoted 2 lines
arch/arm/mach-omap2/board-generic.c +1
-0of_platform_populate (NULL , omap_dt_match_table,NULL ,NULL ); +usbhost_init_of ();You should never have to add that kind of hacks in generic board file. Why do you need that during board init?
In theory, the
of_platform_populatewill create all the devices, and during the driver probe you will create the sub nodes.
OK. I was thinking of this as a temporary fix till the USB host drivers support OF nodes natively. Maybe I should work on fixing up the host drivers instead.
But I'm not sure how the PM runtime calls map to omap_device/hwmod framework when device tree boot is used. I can see that the device tree node can specify "ti,hwmods = " parameter. Just can't seem to figure out how all this adds up :P
cheers,
-roger
Re: [PATCH 1/4] ARM: OMAP: usb-host: Device tree support for USB Host
Quoted 103 lines · Roger Quadros
Hi Benoit,
Quoted 100 lines · Benoit Cousson
Hi Roger,
Quoted 89 lines · Roger Quadros
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ 4 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txtDocumentation/devicetree/bindings/arm/omap/usb-host.txt new file +60
-0@@ -0,0 +1,60 @@ +* usb-host - OMAP USB Host Subsystem + +The OMAP USB host subsystem consists of the following modules +1) USBTLL (Tranceiverless interface) +2) USBHOST (Host Controller module) which includes both EHCI and OHCI controllers + +THe USB Host subsystem can be connected to the external world using 3 PORTs that could +be configured in various modes like UTMI+ for external PHY, ULPI transceiverless link (TLL), +Serial TLL, High-speed interchip (HSIC), etc. + +Required proprties: +- compatible: Must be "ti,usb-host"; +- num_ports: Number of physical ports available + +Optional properties: +- 1 child node for each available port. These child nodes are usually supplied by the + board support device tree as they are specific to how the ports are wired on the board + + - mode: Integer specifying the mode in which the port is used + * OMAP_USBHS_PORT_MODE_UNUSED = 0, + * OMAP_EHCI_PORT_MODE_PHY = 1, + * OMAP_EHCI_PORT_MODE_TLL = 2, + * OMAP_EHCI_PORT_MODE_HSIC = 3, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 = 4, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM = 5, + * OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0 = 6, + * OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM = 7, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 = 8, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM = 9, + * OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0 = 10, + * OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM = 11, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0 = 12, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM = 13, + - clk: Name of the clock that needs to be active when using the port + - clkrate: Frequency at which the above clk needs to be run at + + +Example: + +/* In the OMAP Core tree */ +usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <3>; +}; + +/* In the Board tree */ +&usbhost { + port@0 { + mode = <1>; + clk = "auxclk3_ck"; + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; +arch/arm/mach-omap2/board-generic.c +0
-0arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 43
Quoted 4 lines
arch/arm/mach-omap2/board-generic.c +1
-0@@ -40,6 +40,7 @@ static void __init omap_generic_init(void)omap_sdrc_init (NULL ,NULL );of_platform_populate (NULL , omap_dt_match_table,NULL ,NULL ); +usbhost_init_of ();You should never have to add that kind of hacks in generic board file. Why do you need that during board init?
Quoted 7 lines
Quoted 3 lines
In theory, the
of_platform_populatewill create all the devices, and during the driver probe you will create the sub nodes.OK. I was thinking of this as a temporary fix till the USB host drivers support OF nodes natively. Maybe I should work on fixing up the host drivers instead.
Well, yeah, that's clearly better.
Quoted 4 lines
But I'm not sure how the PM runtime calls map to omap_device/hwmod framework when device tree boot is used. I can see that the device tree node can specify "ti,hwmods = " parameter. Just can't seem to figure out how all this adds up :P
It is done auto-magically in the omap_device code. As soon as you add the "ti,hwmods: attribute, an omap_device will be created instead of a regular platform_device. A custom PM domain is added to handle the pm_runtime callback for OMAP IPs. And every omap_device belongs to that PM domain.
Regards,
Benoit
Re: [PATCH 1/4] ARM: OMAP: usb-host: Device tree support for USB Host
Quoted 119 lines · Benoit Cousson
Quoted 103 lines · Roger Quadros
Hi Benoit,
Quoted 100 lines · Benoit Cousson
Hi Roger,
Quoted 89 lines · Roger Quadros
Provides a means for the OMAP USB host subsystem to be initialized from Device tree. This is a first step for device tree migration where we specify only the board specific stuff. Things like I/O address space and interrupts are not yet specified in the device tree but can be done as a next step.
This patch will allow boards to be booted with our without device tree and have USB host functional.
Signed-off-by Roger Quadros <[email protected]>--- .../devicetree/bindings/arm/omap/usb-host.txt | 60 +++++++++++++++++ arch/arm/mach-omap2/board-generic.c | 1 + arch/arm/mach-omap2/common.h | 2 + arch/arm/mach-omap2/usb-host.c | 71 ++++++++++++++++++++ 4 files changed, 134 insertions(+), 0 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/omap/usb-host.txtDocumentation/devicetree/bindings/arm/omap/usb-host.txt new file +60
-0@@ -0,0 +1,60 @@ +* usb-host - OMAP USB Host Subsystem + +The OMAP USB host subsystem consists of the following modules +1) USBTLL (Tranceiverless interface) +2) USBHOST (Host Controller module) which includes both EHCI and OHCI controllers + +THe USB Host subsystem can be connected to the external world using 3 PORTs that could +be configured in various modes like UTMI+ for external PHY, ULPI transceiverless link (TLL), +Serial TLL, High-speed interchip (HSIC), etc. + +Required proprties: +- compatible: Must be "ti,usb-host"; +- num_ports: Number of physical ports available + +Optional properties: +- 1 child node for each available port. These child nodes are usually supplied by the + board support device tree as they are specific to how the ports are wired on the board + + - mode: Integer specifying the mode in which the port is used + * OMAP_USBHS_PORT_MODE_UNUSED = 0, + * OMAP_EHCI_PORT_MODE_PHY = 1, + * OMAP_EHCI_PORT_MODE_TLL = 2, + * OMAP_EHCI_PORT_MODE_HSIC = 3, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0 = 4, + * OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM = 5, + * OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0 = 6, + * OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM = 7, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0 = 8, + * OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM = 9, + * OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0 = 10, + * OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM = 11, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0 = 12, + * OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM = 13, + - clk: Name of the clock that needs to be active when using the port + - clkrate: Frequency at which the above clk needs to be run at + + +Example: + +/* In the OMAP Core tree */ +usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <3>; +}; + +/* In the Board tree */ +&usbhost { + port@0 { + mode = <1>; + clk = "auxclk3_ck"; + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; +arch/arm/mach-omap2/board-generic.c +0
-0arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 43
Quoted 4 lines
arch/arm/mach-omap2/board-generic.c +1
-0@@ -40,6 +40,7 @@ static void __init omap_generic_init(void)omap_sdrc_init (NULL ,NULL );of_platform_populate (NULL , omap_dt_match_table,NULL ,NULL ); +usbhost_init_of ();You should never have to add that kind of hacks in generic board file. Why do you need that during board init?
Quoted 7 lines
Quoted 3 lines
In theory, the
of_platform_populatewill create all the devices, and during the driver probe you will create the sub nodes.OK. I was thinking of this as a temporary fix till the USB host drivers support OF nodes natively. Maybe I should work on fixing up the host drivers instead.
Well, yeah, that's clearly better.
Quoted 4 lines
But I'm not sure how the PM runtime calls map to omap_device/hwmod framework when device tree boot is used. I can see that the device tree node can specify "ti,hwmods = " parameter. Just can't seem to figure out how all this adds up :P
Quoted 6 lines
It is done auto-magically in the
omap_devicecode. As soon as you add the "ti,hwmods: attribute, anomap_devicewill be created instead of a regularplatform_device. A custom PM domain is added to handle thepm_runtimecallback for OMAP IPs. And everyomap_devicebelongs to that PM domain.
Thanks. Just figured out it happens through BUS_NOTIFY_ADD_DEVICE -> _omap_device_notifier_call() - > omap_device_build_from_dt()
cheers,
-roger
PATCH 3/4 ARM/dts: omap4-panda: Add USB Host support
In reply to a message not in the archiveGet USB Host working. On Panda, two GPIOs are used, one for HUB/PHY reset and other for Hub power. We model them as fixed regulators. The regulator for RESET is made to depend on regulator for Hub power so that the Hub power is enabled by the regulator framework before RESET is removed.
Tested on Panda ES B1.
--- arch/arm/boot/dts/omap4-panda.dts | 36 ++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/omap4.dtsi | 5 +++++ 2 files changed, 41 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +36 -0
@@ -57,6 +57,27 @@ "AFML", "Line In", "AFMR", "Line In"; }; + + hubpower: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "vhub0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio1 1 0>; /* gpio 1 : HUB Power */ + startup-delay-us = <70000>; + enable-active-high; + }; + + hubreset: fixedregulator@1 { + compatible = "regulator-fixed"; + regulator-name = "hsusb0"; /* tag to associate with PORT 1 */ + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio2 30 0>; /* gpio 62 : HUB & PHY Reset */ + startup-delay-us = <70000>; + enable-active-high; + vin-supply = "vhub0"; /* Makes regulator f/w enable power before reset */ + }; }; &omap4_pmx_core {
@@ -136,6 +157,21 @@ }; }; + +&usbhost { + port@0 { + mode = <1>; /* PHY mode */ + clk = "auxclk3_ck"; /* PHY clock on FREF_CLK3_OUT */ + clkrate = <19200000>; + }; + port@1 { + mode = <0>; + }; + port@2 { + mode = <0>; + }; +}; + /include/ "twl6030.dtsi" &i2c2 {
arch/arm/boot/dts/omap4.dtsi +5 -0
@@ -438,5 +438,10 @@ ranges; ti,hwmods = "ocp2scp_usb_phy"; }; + + usbhost: usb-host { + compatible = "ti,usb-host"; + num_ports = <2>; + }; }; };
Signature · 6 lines
1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/4 regulator: fixed: Properly use input_supply parameter from device tree
In reply to a message not in the archiveThe device tree node will provide the input supply name as a string. Use that to populate the supply_name parameter of the regulator descriptor.
Also correct the documentation to reflect the same.
--- .../bindings/regulator/fixed-regulator.txt | 6 +++--- drivers/regulator/fixed.c | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/regulator/fixed-regulator.txt +3 -3
@@ -7,10 +7,10 @@ Optional properties: - gpio: gpio to use for enable control - startup-delay-us: startup time in microseconds - enable-active-high: Polarity of GPIO is Active high -If this property is missing, the default assumed is Active low. + If this property is missing, the default assumed is Active low. - gpio-open-drain: GPIO is open drain type. If this property is missing then default assumption is false. --vin-supply: Input supply name. +- vin-supply: Input supply name. Any property defined as part of the core regulator binding, defined in regulator.txt, can also be used.
@@ -30,5 +30,5 @@ Example: enable-active-high; regulator-boot-on; gpio-open-drain; - vin-supply = <&parent_reg>; + vin-supply = "input-supply-name"; };
drivers/regulator/fixed.c +4 -2
@@ -53,6 +53,7 @@ of_get_fixed_voltage_config(struct device *dev)struct device_node *np = dev->of_node;const __be32 *delay;struct regulator_init_data *init_data; +const char *vin_name; config =devm_kzalloc (dev,sizeof (struct fixed_voltage_config ),GFP_KERNEL );
@@ -102,8 +103,9 @@ of_get_fixed_voltage_config(struct device *dev)if (of_find_property (np,"gpio-open-drain" ,NULL )) config->gpio_is_open_drain = true; -if (of_find_property (np,"vin-supply" ,NULL )) - config->input_supply ="vin" ; + vin_name =of_get_property (np,"vin-supply" ,NULL ); +if (vin_name) + config->input_supply = vin_name;return config; }
Signature · 6 lines
1.7.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1352991396-19589-5-git-send-email-rogerq-l0cyMroinI0@public.gmane.org
Re: [PATCH 4/4] regulator: fixed: Properly use input_supply parameter from device tree
Quoted 12 lines · Roger Quadros
The device tree node will provide the input supply name as a string. Use that to populate the
supply_nameparameter of the regulator descriptor.Also correct the documentation to reflect the same.
Signed-off-by Roger Quadros <[email protected]>CC Laxman Dewangan <[email protected]>CC Mark Brown <broonie-yzvPICuk2AATkU/[email protected]>---
regulator-boot-on;
gpio-open-drain;
Documentation/devicetree/bindings/regulator/fixed-regulator.txt Example: · line 33
Quoted 2 lines
Documentation/devicetree/bindings/regulator/fixed-regulator.txt +1
-1- vin-supply = <&parent_reg>; + vin-supply = "input-supply-name";
This is not correct as per the regulator binding. It says
- <name>-supply: phandle to the parent supply/regulator node
So we need to pass the phandle rather than string.
Just for curiosity, why do you want this change? What is the issue are you facing.
This change will creates regression on many platform.
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH 4/4] regulator: fixed: Properly use input_supply parameter from device tree
Quoted 16 lines · Laxman Dewangan
Quoted 12 lines · Roger Quadros
The device tree node will provide the input supply name as a string. Use that to populate the
supply_nameparameter of the regulator descriptor.Also correct the documentation to reflect the same.
Signed-off-by Roger Quadros <[email protected]>CC Laxman Dewangan <[email protected]>CC Mark Brown <broonie-yzvPICuk2AATkU/[email protected]>---
regulator-boot-on; gpio-open-drain;Documentation/devicetree/bindings/regulator/fixed-regulator.txt Example: · line 33
Quoted 2 lines
Documentation/devicetree/bindings/regulator/fixed-regulator.txt +1
-1- vin-supply = <&parent_reg>; + vin-supply = "input-supply-name";
Quoted 5 lines
This is not correct as per the regulator binding. It says
- <name>-supply: phandle to the parent supply/regulator nodeSo we need to pass the phandle rather than string.
If you see of_get_fixed_voltage_config() in drivers/regulator/fixed.c, all it does (without my patch) is
if (of_find_property(np, "vin-supply", NULL)) config->input_supply = "vin";
How is this supposed to work? How does phandle supplied in vin-supply map to config->input_supply?
This config->input_supply is a string which is used in reg_fixed_voltage_probe() like below
if (config->input_supply) {
drvdata->desc.supply_name = kstrdup(config->input_supply,
GFP_KERNEL);So I don't understand how supplying phandle would work. Maybe I missed something?
Quoted 3 lines
Just for curiosity, why do you want this change? What is the issue are you facing.
Because I could not understood how the original approach would work. But if you can explain how it works maybe my patch is redundant.
Quoted 2 lines
This change will creates regression on many platform.
Did you test your platform on 3.7-rc5?
regards,
-roger
Quoted 16 lines
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 4/4] regulator: fixed: Properly use input_supply parameter from device tree
Quoted 2 lines · Roger Quadros
How is this supposed to work? How does phandle supplied in vin-supply map to
config->input_supply?
You should provide a separate property to name the supply, or just pick a fixed name in the fixed voltage driver.
PATCH 2/4 ARM: OMAP4: USB: Add pin mux configuration for panda board
In reply to Roger QuadrosFrom: Keshava Munegowda <[email protected]>
The port1 of omap4 panda board is used in ULPI PHY mode. The pin mux of usbhs (usbb1) port 1 is configured accordingly.
--- arch/arm/boot/dts/omap4-panda.dts | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap4-panda.dts +18 -0
@@ -65,6 +65,7 @@ &twl6040_pins &mcpdm_pins &mcbsp1_pins + &usbb1_pins /* port 0 of omap usb host port pin mux configuration */ >; twl6040_pins: pinmux_twl6040_pins {
@@ -92,6 +93,23 @@ 0xc4 0x100 /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT | MODE0 */ >; }; + + usbb1_pins: pinmux_usbb1_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 {
Signature · 1 line
1.7.4.1