* [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs @ 2011-09-30 5:41 Keshava Munegowda 2011-09-30 7:15 ` Paul Walmsley 0 siblings, 1 reply; 8+ messages in thread From: Keshava Munegowda @ 2011-09-30 5:41 UTC (permalink / raw) To: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, paul Cc: Keshava Munegowda, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs The hwmod structure of usb_host_hs and usb_tll are retrieved and registered with omap device Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> --- arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- 1 files changed, 34 insertions(+), 66 deletions(-) diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index 89ae298..771dc78 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c @@ -28,51 +28,28 @@ #include <mach/hardware.h> #include <mach/irqs.h> #include <plat/usb.h> +#include <plat/omap_device.h> #include "mux.h" #ifdef CONFIG_MFD_OMAP_USB_HOST -#define OMAP_USBHS_DEVICE "usbhs-omap" - -static struct resource usbhs_resources[] = { - { - .name = "uhh", - .flags = IORESOURCE_MEM, - }, - { - .name = "tll", - .flags = IORESOURCE_MEM, - }, - { - .name = "ehci", - .flags = IORESOURCE_MEM, - }, - { - .name = "ehci-irq", - .flags = IORESOURCE_IRQ, - }, - { - .name = "ohci", - .flags = IORESOURCE_MEM, - }, - { - .name = "ohci-irq", - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device usbhs_device = { - .name = OMAP_USBHS_DEVICE, - .id = 0, - .num_resources = ARRAY_SIZE(usbhs_resources), - .resource = usbhs_resources, -}; +#define OMAP_USBHS_DEVICE "usbhs_omap" +#define USBHS_UHH_HWMODNAME "usb_host_hs" +#define USBHS_TLL_HWMODNAME "usb_tll_hs" static struct usbhs_omap_platform_data usbhs_data; static struct ehci_hcd_omap_platform_data ehci_data; static struct ohci_hcd_omap_platform_data ohci_data; +static struct omap_device_pm_latency omap_uhhtll_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + }, +}; + /* MUX settings for EHCI pins */ /* * setup_ehci_io_mux - initialize IO pad mux for USBHOST @@ -508,7 +485,10 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) void __init usbhs_init(const struct usbhs_omap_board_data *pdata) { - int i; + struct omap_hwmod *oh[2]; + struct omap_device *od; + int bus_id = -1; + int i; for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { usbhs_data.port_mode[i] = pdata->port_mode[i]; @@ -523,44 +503,34 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) usbhs_data.ohci_data = &ohci_data; if (cpu_is_omap34xx()) { - usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE; - usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1; - usbhs_resources[1].start = OMAP34XX_USBTLL_BASE; - usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1; - usbhs_resources[2].start = OMAP34XX_EHCI_BASE; - usbhs_resources[2].end = OMAP34XX_EHCI_BASE + SZ_1K - 1; - usbhs_resources[3].start = INT_34XX_EHCI_IRQ; - usbhs_resources[4].start = OMAP34XX_OHCI_BASE; - usbhs_resources[4].end = OMAP34XX_OHCI_BASE + SZ_1K - 1; - usbhs_resources[5].start = INT_34XX_OHCI_IRQ; setup_ehci_io_mux(pdata->port_mode); setup_ohci_io_mux(pdata->port_mode); } else if (cpu_is_omap44xx()) { - usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE; - usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1; - usbhs_resources[1].start = OMAP44XX_USBTLL_BASE; - usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1; - usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE; - usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1; - usbhs_resources[3].start = OMAP44XX_IRQ_EHCI; - usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE; - usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1; - usbhs_resources[5].start = OMAP44XX_IRQ_OHCI; setup_4430ehci_io_mux(pdata->port_mode); setup_4430ohci_io_mux(pdata->port_mode); } - if (platform_device_add_data(&usbhs_device, - &usbhs_data, sizeof(usbhs_data)) < 0) { - printk(KERN_ERR "USBHS platform_device_add_data failed\n"); - goto init_end; + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); + if (!oh[0]) { + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); + return; } - if (platform_device_register(&usbhs_device) < 0) - printk(KERN_ERR "USBHS platform_device_register failed\n"); + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); + if (!oh[1]) { + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); + return; + } -init_end: - return; + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, + (void *)&usbhs_data, sizeof(usbhs_data), + omap_uhhtll_latency, + ARRAY_SIZE(omap_uhhtll_latency), false); + if (IS_ERR(od)) { + pr_err("Could not build hwmod devices %s,%s\n", + USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); + return; + } } #else @@ -570,5 +540,3 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) } #endif - - -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 5:41 [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs Keshava Munegowda @ 2011-09-30 7:15 ` Paul Walmsley 2011-09-30 7:34 ` Felipe Balbi 0 siblings, 1 reply; 8+ messages in thread From: Paul Walmsley @ 2011-09-30 7:15 UTC (permalink / raw) To: Keshava Munegowda Cc: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs Hi On Fri, 30 Sep 2011, Keshava Munegowda wrote: > The hwmod structure of usb_host_hs and usb_tll are > retrieved and registered with omap device > > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> > Reviewed-by: Partha Basak <parthab@india.ti.com> > --- > arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- > 1 files changed, 34 insertions(+), 66 deletions(-) > > diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c > index 89ae298..771dc78 100644 > --- a/arch/arm/mach-omap2/usb-host.c > +++ b/arch/arm/mach-omap2/usb-host.c > @@ -28,51 +28,28 @@ > + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); > + if (!oh[0]) { > + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); > + return; > } > > - if (platform_device_register(&usbhs_device) < 0) > - printk(KERN_ERR "USBHS platform_device_register failed\n"); > + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); > + if (!oh[1]) { > + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); > + return; > + } > > -init_end: > - return; > + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, > + (void *)&usbhs_data, sizeof(usbhs_data), > + omap_uhhtll_latency, > + ARRAY_SIZE(omap_uhhtll_latency), false); Usually there's something wrong with omap_devices that contain multiple hwmods. Is there some reason why there isn't a separate driver for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the TLL handling looks logically distinct? - Paul ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 7:15 ` Paul Walmsley @ 2011-09-30 7:34 ` Felipe Balbi 2011-09-30 9:15 ` Munegowda, Keshava 0 siblings, 1 reply; 8+ messages in thread From: Felipe Balbi @ 2011-09-30 7:34 UTC (permalink / raw) To: Paul Walmsley Cc: Keshava Munegowda, linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs [-- Attachment #1: Type: text/plain, Size: 1867 bytes --] Hi, On Fri, Sep 30, 2011 at 01:15:55AM -0600, Paul Walmsley wrote: > > The hwmod structure of usb_host_hs and usb_tll are > > retrieved and registered with omap device > > > > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> > > Reviewed-by: Partha Basak <parthab@india.ti.com> > > --- > > arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- > > 1 files changed, 34 insertions(+), 66 deletions(-) > > > > diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c > > index 89ae298..771dc78 100644 > > --- a/arch/arm/mach-omap2/usb-host.c > > +++ b/arch/arm/mach-omap2/usb-host.c > > @@ -28,51 +28,28 @@ > > > + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); > > + if (!oh[0]) { > > + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); > > + return; > > } > > > > - if (platform_device_register(&usbhs_device) < 0) > > - printk(KERN_ERR "USBHS platform_device_register failed\n"); > > + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); > > + if (!oh[1]) { > > + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); > > + return; > > + } > > > > -init_end: > > - return; > > + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, > > + (void *)&usbhs_data, sizeof(usbhs_data), > > + omap_uhhtll_latency, > > + ARRAY_SIZE(omap_uhhtll_latency), false); > > Usually there's something wrong with omap_devices that contain > multiple hwmods. Is there some reason why there isn't a separate driver > for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the > TLL handling looks logically distinct? Yes, I have the same feeling. To my understanding, USB Host Subsystem on OMAP is composed of the Transceiver-less link (TLL) and USB Host (UHH). Aparently, they could be handled by separate drivers. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 7:34 ` Felipe Balbi @ 2011-09-30 9:15 ` Munegowda, Keshava 2011-09-30 9:19 ` Felipe Balbi 0 siblings, 1 reply; 8+ messages in thread From: Munegowda, Keshava @ 2011-09-30 9:15 UTC (permalink / raw) To: balbi Cc: Paul Walmsley, linux-usb, linux-omap, linux-kernel, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs On Fri, Sep 30, 2011 at 1:04 PM, Felipe Balbi <balbi@ti.com> wrote: > Hi, > > On Fri, Sep 30, 2011 at 01:15:55AM -0600, Paul Walmsley wrote: >> > The hwmod structure of usb_host_hs and usb_tll are >> > retrieved and registered with omap device >> > >> > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> >> > Reviewed-by: Partha Basak <parthab@india.ti.com> >> > --- >> > arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- >> > 1 files changed, 34 insertions(+), 66 deletions(-) >> > >> > diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c >> > index 89ae298..771dc78 100644 >> > --- a/arch/arm/mach-omap2/usb-host.c >> > +++ b/arch/arm/mach-omap2/usb-host.c >> > @@ -28,51 +28,28 @@ >> >> > + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); >> > + if (!oh[0]) { >> > + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); >> > + return; >> > } >> > >> > - if (platform_device_register(&usbhs_device) < 0) >> > - printk(KERN_ERR "USBHS platform_device_register failed\n"); >> > + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); >> > + if (!oh[1]) { >> > + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); >> > + return; >> > + } >> > >> > -init_end: >> > - return; >> > + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, >> > + (void *)&usbhs_data, sizeof(usbhs_data), >> > + omap_uhhtll_latency, >> > + ARRAY_SIZE(omap_uhhtll_latency), false); >> >> Usually there's something wrong with omap_devices that contain >> multiple hwmods. Is there some reason why there isn't a separate driver >> for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the >> TLL handling looks logically distinct? > > Yes, I have the same feeling. To my understanding, USB Host Subsystem on > OMAP is composed of the Transceiver-less link (TLL) and USB Host (UHH). > Aparently, they could be handled by separate drivers. > > -- > balbi yes, it can be as two separate drivers for uhh and tll; But i don't think driver can be used effectively. Now ehci and ohci gets the clocks , config reg and port settings through usb host which is sufficient. If you make them as two different drivers; then ehci and ohci has to interact with both the drivers separately. which will be an unnecessary complications. I feel not divided this driver into two regards keshava ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 9:15 ` Munegowda, Keshava @ 2011-09-30 9:19 ` Felipe Balbi 2011-09-30 9:26 ` Munegowda, Keshava 0 siblings, 1 reply; 8+ messages in thread From: Felipe Balbi @ 2011-09-30 9:19 UTC (permalink / raw) To: Munegowda, Keshava Cc: balbi, Paul Walmsley, linux-usb, linux-omap, linux-kernel, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs [-- Attachment #1: Type: text/plain, Size: 2903 bytes --] Hi, On Fri, Sep 30, 2011 at 02:45:32PM +0530, Munegowda, Keshava wrote: > On Fri, Sep 30, 2011 at 1:04 PM, Felipe Balbi <balbi@ti.com> wrote: > > Hi, > > > > On Fri, Sep 30, 2011 at 01:15:55AM -0600, Paul Walmsley wrote: > >> > The hwmod structure of usb_host_hs and usb_tll are > >> > retrieved and registered with omap device > >> > > >> > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> > >> > Reviewed-by: Partha Basak <parthab@india.ti.com> > >> > --- > >> > arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- > >> > 1 files changed, 34 insertions(+), 66 deletions(-) > >> > > >> > diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c > >> > index 89ae298..771dc78 100644 > >> > --- a/arch/arm/mach-omap2/usb-host.c > >> > +++ b/arch/arm/mach-omap2/usb-host.c > >> > @@ -28,51 +28,28 @@ > >> > >> > + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); > >> > + if (!oh[0]) { > >> > + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); > >> > + return; > >> > } > >> > > >> > - if (platform_device_register(&usbhs_device) < 0) > >> > - printk(KERN_ERR "USBHS platform_device_register failed\n"); > >> > + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); > >> > + if (!oh[1]) { > >> > + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); > >> > + return; > >> > + } > >> > > >> > -init_end: > >> > - return; > >> > + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, > >> > + (void *)&usbhs_data, sizeof(usbhs_data), > >> > + omap_uhhtll_latency, > >> > + ARRAY_SIZE(omap_uhhtll_latency), false); > >> > >> Usually there's something wrong with omap_devices that contain > >> multiple hwmods. Is there some reason why there isn't a separate driver > >> for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the > >> TLL handling looks logically distinct? > > > > Yes, I have the same feeling. To my understanding, USB Host Subsystem on > > OMAP is composed of the Transceiver-less link (TLL) and USB Host (UHH). > > Aparently, they could be handled by separate drivers. > > > > -- > > balbi > > yes, it can be as two separate drivers for uhh and tll; But i don't > think driver can be used effectively. > Now ehci and ohci gets the clocks , config reg and port settings > through usb host which is sufficient. > If you make them as two different drivers; then ehci and ohci has to > interact with both the drivers separately. > which will be an unnecessary complications. I feel not divided this > driver into two Come again, EHCI/OHCI need clocks from UHH and TLL ?? If that's the case, then there's really no easy way to handle this as a device can have only one parent. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 9:19 ` Felipe Balbi @ 2011-09-30 9:26 ` Munegowda, Keshava 2011-09-30 9:32 ` Felipe Balbi 0 siblings, 1 reply; 8+ messages in thread From: Munegowda, Keshava @ 2011-09-30 9:26 UTC (permalink / raw) To: balbi Cc: Paul Walmsley, linux-usb, linux-omap, linux-kernel, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs On Fri, Sep 30, 2011 at 2:49 PM, Felipe Balbi <balbi@ti.com> wrote: > Hi, > > On Fri, Sep 30, 2011 at 02:45:32PM +0530, Munegowda, Keshava wrote: >> On Fri, Sep 30, 2011 at 1:04 PM, Felipe Balbi <balbi@ti.com> wrote: >> > Hi, >> > >> > On Fri, Sep 30, 2011 at 01:15:55AM -0600, Paul Walmsley wrote: >> >> > The hwmod structure of usb_host_hs and usb_tll are >> >> > retrieved and registered with omap device >> >> > >> >> > Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> >> >> > Reviewed-by: Partha Basak <parthab@india.ti.com> >> >> > --- >> >> > arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- >> >> > 1 files changed, 34 insertions(+), 66 deletions(-) >> >> > >> >> > diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c >> >> > index 89ae298..771dc78 100644 >> >> > --- a/arch/arm/mach-omap2/usb-host.c >> >> > +++ b/arch/arm/mach-omap2/usb-host.c >> >> > @@ -28,51 +28,28 @@ >> >> >> >> > + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); >> >> > + if (!oh[0]) { >> >> > + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); >> >> > + return; >> >> > } >> >> > >> >> > - if (platform_device_register(&usbhs_device) < 0) >> >> > - printk(KERN_ERR "USBHS platform_device_register failed\n"); >> >> > + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); >> >> > + if (!oh[1]) { >> >> > + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); >> >> > + return; >> >> > + } >> >> > >> >> > -init_end: >> >> > - return; >> >> > + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, >> >> > + (void *)&usbhs_data, sizeof(usbhs_data), >> >> > + omap_uhhtll_latency, >> >> > + ARRAY_SIZE(omap_uhhtll_latency), false); >> >> >> >> Usually there's something wrong with omap_devices that contain >> >> multiple hwmods. Is there some reason why there isn't a separate driver >> >> for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the >> >> TLL handling looks logically distinct? >> > >> > Yes, I have the same feeling. To my understanding, USB Host Subsystem on >> > OMAP is composed of the Transceiver-less link (TLL) and USB Host (UHH). >> > Aparently, they could be handled by separate drivers. >> > >> > -- >> > balbi >> >> yes, it can be as two separate drivers for uhh and tll; But i don't >> think driver can be used effectively. >> Now ehci and ohci gets the clocks , config reg and port settings >> through usb host which is sufficient. >> If you make them as two different drivers; then ehci and ohci has to >> interact with both the drivers separately. >> which will be an unnecessary complications. I feel not divided this >> driver into two > > Come again, EHCI/OHCI need clocks from UHH and TLL ?? If that's the > case, then there's really no easy way to handle this as a device can > have only one parent. yes, if you are using ehci phy mode ( port modes of UHH_HOSTCONFIG register) then uhh functional ( omap3: interface clocks too) is sufficient; if you are using ehci in tll mode , then you need tll functional clock too. regards keshava ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-30 9:26 ` Munegowda, Keshava @ 2011-09-30 9:32 ` Felipe Balbi 0 siblings, 0 replies; 8+ messages in thread From: Felipe Balbi @ 2011-09-30 9:32 UTC (permalink / raw) To: Munegowda, Keshava Cc: balbi, Paul Walmsley, linux-usb, linux-omap, linux-kernel, khilman, b-cousson, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs [-- Attachment #1: Type: text/plain, Size: 2255 bytes --] Hi, On Fri, Sep 30, 2011 at 02:56:40PM +0530, Munegowda, Keshava wrote: > >> >> Usually there's something wrong with omap_devices that contain > >> >> multiple hwmods. Is there some reason why there isn't a separate driver > >> >> for the TLL? Judging by a brief look at drivers/mfd/omap_usb_host.c, the > >> >> TLL handling looks logically distinct? > >> > > >> > Yes, I have the same feeling. To my understanding, USB Host Subsystem on > >> > OMAP is composed of the Transceiver-less link (TLL) and USB Host (UHH). > >> > Aparently, they could be handled by separate drivers. > >> > > >> > -- > >> > balbi > >> > >> yes, it can be as two separate drivers for uhh and tll; But i don't > >> think driver can be used effectively. > >> Now ehci and ohci gets the clocks , config reg and port settings > >> through usb host which is sufficient. > >> If you make them as two different drivers; then ehci and ohci has to > >> interact with both the drivers separately. > >> which will be an unnecessary complications. I feel not divided this > >> driver into two > > > > Come again, EHCI/OHCI need clocks from UHH and TLL ?? If that's the > > case, then there's really no easy way to handle this as a device can > > have only one parent. > > yes, if you are using ehci phy mode ( port modes of UHH_HOSTCONFIG register) > then uhh functional ( omap3: interface clocks too) is sufficient; > if you are using ehci in tll mode , then you need tll functional clock too. But those clocks are fed into UHH and TLL respectively, not EHCI/OHCI, right ? IOW, EHCI/OHCI only need those clocks to be stable in order for it to work. I'm trying to think of a way to decouple that but nothing comes to mind right now... Ideally, calling pm_runtime_get_sync() on EHCI/OHCI would make all clocks enabled and the only way I see for that to happen is to make TLL parent of UHH which is parent of EHCI/OHCI, but I'm not sure that makes a lot of sense. Paul, do you have any tip which we could use ? What we need is to be able to call pm_runtime_get_sync() or ehci-omap.c and that should enable UHH clocks and if (port->mode == TLL) enable TLL clocks. We still want to split UHH and TLL into separate drivers. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 490 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 0/5 v12] mfd: omap: usb: Runtime PM support for EHCI and OHCI drivers
@ 2011-09-29 14:24 Keshava Munegowda
2011-09-29 14:24 ` [PATCH 1/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap4 Keshava Munegowda
0 siblings, 1 reply; 8+ messages in thread
From: Keshava Munegowda @ 2011-09-29 14:24 UTC (permalink / raw)
To: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson,
paul
Cc: Keshava Munegowda, gadiyar, sameo, parthab, tony, johnstul,
vishwanath.bs, Keshava Munegowda
From: Keshava Munegowda <Keshava_mgowda@ti.com>
The Hwmod structures and Runtime PM features are implemented
For EHCI and OHCI drivers of OMAP3 and OMAP4.
The global suspend/resume of EHCI and OHCI
is validated on OMAP3430 sdp board with these patches.
TODO:
- Adding mux-information to Hwmods.
- Aggressive Clock Management around USB bus suspend/resume.
- Remote Wakeup support implementation using IO-ring Wakeup
on EHCI/OHCI pads via PRCM IRQ chain handler.
In version 12:
- The ehci, ohci and usb_host_hs hwmods combined as a single hwmod
usb_host_hs.
- for omap3
the usbhost_ick and and usbtll_ick clocks are changed as interface
clocks. The usbtll_fck, usbhost_48m_fck clocks are changed as main
clocks and the 120mhz functional clock is changed to optional clock
- the usbhs mfd driver enable/disable this optional clock in
runtime_resume and runtime_suspend callbacks of pm_runtime_get_sync
and pm_runtime_put_sync APIs.
Benoit Cousson (1):
arm: omap: usb: ehci and ohci hwmod structures for omap4
Keshava Munegowda (4):
arm: omap: usb: ehci and ohci hwmod structures for omap3
arm: omap: usb: register hwmods of usbhs
arm: omap: usb: device name change for the clk names of usbhs
mfd: omap: usb: Runtime PM support
arch/arm/mach-omap2/clock3xxx_data.c | 26 +-
arch/arm/mach-omap2/clock44xx_data.c | 10 +-
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 195 ++++++++
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 171 +++++++-
arch/arm/mach-omap2/usb-host.c | 100 ++---
arch/arm/plat-omap/include/plat/usb.h | 3 -
drivers/mfd/omap-usb-host.c | 748 +++++++++++-----------------
drivers/usb/host/ehci-omap.c | 17 +-
drivers/usb/host/ohci-omap3.c | 18 +-
9 files changed, 727 insertions(+), 561 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap4 2011-09-29 14:24 [PATCH 0/5 v12] mfd: omap: usb: Runtime PM support for EHCI and OHCI drivers Keshava Munegowda @ 2011-09-29 14:24 ` Keshava Munegowda 2011-09-29 14:24 ` [PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3 Keshava Munegowda 0 siblings, 1 reply; 8+ messages in thread From: Keshava Munegowda @ 2011-09-29 14:24 UTC (permalink / raw) To: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, paul Cc: Keshava Munegowda, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs From: Benoit Cousson <b-cousson@ti.com> Following 2 hwmod structures are added 1. usb_host_hs The hwmod of usbhs with uhh, ehci and ohci base addresses functional clock and ehci, ohci irqs 2. usb_tll_hs hwmod of usbhs with the TLL base address and irq. Signed-off-by: Benoit Cousson <b-cousson@ti.com> - rebased to kernel version 3.0 Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 171 +++++++++++++++++++++++++++- 1 files changed, 170 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 6201422..5e6e3c6 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -68,6 +68,8 @@ static struct omap_hwmod omap44xx_mmc2_hwmod; static struct omap_hwmod omap44xx_mpu_hwmod; static struct omap_hwmod omap44xx_mpu_private_hwmod; static struct omap_hwmod omap44xx_usb_otg_hs_hwmod; +static struct omap_hwmod omap44xx_usb_host_hs_hwmod; +static struct omap_hwmod omap44xx_usb_tll_hs_hwmod; /* * Interconnects omap_hwmod structures @@ -5336,6 +5338,170 @@ static struct omap_hwmod omap44xx_wd_timer3_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), }; +/* + * 'usb_host_hs' class + * high-speed multi-port usb host controller + */ +static struct omap_hwmod_ocp_if omap44xx_usb_host_hs__l3_main_2 = { + .master = &omap44xx_usb_host_hs_hwmod, + .slave = &omap44xx_l3_main_2_hwmod, + .clk = "l3_div_ck", + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +static struct omap_hwmod_class_sysconfig omap44xx_usb_host_hs_sysc = { + .rev_offs = 0x0000, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO | + MSTANDBY_SMART | MSTANDBY_SMART_WKUP), + .sysc_fields = &omap_hwmod_sysc_type2, +}; + +static struct omap_hwmod_class omap44xx_usb_host_hs_hwmod_class = { + .name = "usb_host_hs", + .sysc = &omap44xx_usb_host_hs_sysc, +}; + +static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_masters[] = { + &omap44xx_usb_host_hs__l3_main_2, +}; + +static struct omap_hwmod_addr_space omap44xx_usb_host_hs_addrs[] = { + { + .name = "uhh", + .pa_start = 0x4a064000, + .pa_end = 0x4a0647ff, + .flags = ADDR_TYPE_RT + }, + { + .name = "ohci", + .pa_start = 0x4a064800, + .pa_end = 0x4a064bff, + }, + { + .name = "ehci", + .pa_start = 0x4a064c00, + .pa_end = 0x4a064fff, + }, + {} +}; + +static struct omap_hwmod_irq_info omap44xx_usb_host_hs_irqs[] = { + { .name = "ohci-irq", .irq = 76 + OMAP44XX_IRQ_GIC_START }, + { .name = "ehci-irq", .irq = 77 + OMAP44XX_IRQ_GIC_START }, + { .irq = -1 } +}; + +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_host_hs = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_usb_host_hs_hwmod, + .clk = "l4_div_ck", + .addr = omap44xx_usb_host_hs_addrs, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +static struct omap_hwmod_ocp_if *omap44xx_usb_host_hs_slaves[] = { + &omap44xx_l4_cfg__usb_host_hs, +}; + +static struct omap_hwmod omap44xx_usb_host_hs_hwmod = { + .name = "usb_host_hs", + .class = &omap44xx_usb_host_hs_hwmod_class, + .clkdm_name = "l3_init_clkdm", + .main_clk = "usb_host_hs_fck", + .prcm = { + .omap4 = { + .clkctrl_offs = OMAP4_CM_L3INIT_USB_HOST_CLKCTRL_OFFSET, + .context_offs = OMAP4_RM_L3INIT_USB_HOST_CONTEXT_OFFSET, + .modulemode = MODULEMODE_SWCTRL, + }, + }, + .mpu_irqs = omap44xx_usb_host_hs_irqs, + .slaves = omap44xx_usb_host_hs_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_slaves), + .masters = omap44xx_usb_host_hs_masters, + .masters_cnt = ARRAY_SIZE(omap44xx_usb_host_hs_masters), +/* + * The usbhs controller prevents the enter omap to low power mode + * if other than FORCE IDLE and FORCE STANDBY are used. + */ + .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), +}; + +/* + * 'usb_tll_hs' class + * usb_tll_hs module is the adapter on the usb_host_hs ports + */ +static struct omap_hwmod_class_sysconfig omap44xx_usb_tll_hs_sysc = { + .rev_offs = 0x0000, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, + .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE | + SYSC_HAS_SOFTRESET | SYSC_HAS_ENAWAKEUP | + SYSC_HAS_CLOCKACTIVITY), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_fields = &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap44xx_usb_tll_hs_hwmod_class = { + .name = "usb_tll_hs", + .sysc = &omap44xx_usb_tll_hs_sysc, +}; + +static struct omap_hwmod_irq_info omap44xx_usb_tll_hs_irqs[] = { + { .name = "tll-irq", .irq = 78 + OMAP44XX_IRQ_GIC_START }, + { .irq = -1 } +}; + +static struct omap_hwmod_addr_space omap44xx_usb_tll_hs_addrs[] = { + { + .name = "tll", + .pa_start = 0x4a062000, + .pa_end = 0x4a063fff, + .flags = ADDR_TYPE_RT + }, + {} +}; + +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_tll_hs = { + .master = &omap44xx_l4_cfg_hwmod, + .slave = &omap44xx_usb_tll_hs_hwmod, + .clk = "l4_div_ck", + .addr = omap44xx_usb_tll_hs_addrs, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +static struct omap_hwmod_ocp_if *omap44xx_usb_tll_hs_slaves[] = { + &omap44xx_l4_cfg__usb_tll_hs, +}; + +static struct omap_hwmod omap44xx_usb_tll_hs_hwmod = { + .name = "usb_tll_hs", + .class = &omap44xx_usb_tll_hs_hwmod_class, + .clkdm_name = "l3_init_clkdm", + .main_clk = "usb_tll_hs_ick", + .prcm = { + .omap4 = { + .clkctrl_offs = OMAP4_CM_L3INIT_USB_TLL_CLKCTRL_OFFSET, + .context_offs = OMAP4_RM_L3INIT_USB_TLL_CONTEXT_OFFSET, + .modulemode = MODULEMODE_HWCTRL, + }, + }, + .mpu_irqs = omap44xx_usb_tll_hs_irqs, + .slaves = omap44xx_usb_tll_hs_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_usb_tll_hs_slaves), +/* + * The usbhs controller prevents the enter omap to low power mode + * if other than FORCE IDLE for TLL mode too. + */ + .flags = HWMOD_SWSUP_SIDLE, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), +}; + static __initdata struct omap_hwmod *omap44xx_hwmods[] = { /* dmm class */ @@ -5475,13 +5641,16 @@ static __initdata struct omap_hwmod *omap44xx_hwmods[] = { &omap44xx_uart3_hwmod, &omap44xx_uart4_hwmod, + /* usb host class */ + &omap44xx_usb_host_hs_hwmod, + &omap44xx_usb_tll_hs_hwmod, + /* usb_otg_hs class */ &omap44xx_usb_otg_hs_hwmod, /* wd_timer class */ &omap44xx_wd_timer2_hwmod, &omap44xx_wd_timer3_hwmod, - NULL, }; -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3 2011-09-29 14:24 ` [PATCH 1/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap4 Keshava Munegowda @ 2011-09-29 14:24 ` Keshava Munegowda 2011-09-29 14:24 ` [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs Keshava Munegowda 0 siblings, 1 reply; 8+ messages in thread From: Keshava Munegowda @ 2011-09-29 14:24 UTC (permalink / raw) To: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, paul Cc: Keshava Munegowda, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs Following 2 hwmod structures are added 1. usb_host_hs The hwmod of usbhs with uhh, ehci and ohci base addresses functional clock and ehci, ohci irqs 2. usb_tll_hs hwmod of usbhs with the TLL base address and irq. Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> --- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 195 ++++++++++++++++++++++++++++ 1 files changed, 195 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 59fdb9f..bc17493 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -84,6 +84,8 @@ static struct omap_hwmod omap3xxx_mcbsp4_hwmod; static struct omap_hwmod omap3xxx_mcbsp5_hwmod; static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; +static struct omap_hwmod omap34xx_usb_host_hs_hwmod; +static struct omap_hwmod omap34xx_usb_tll_hs_hwmod; /* L3 -> L4_CORE interface */ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { @@ -3196,6 +3198,194 @@ static struct omap_hwmod omap3xxx_mmc3_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), }; +/* + * 'usb_host_hs' class + * high-speed multi-port usb host controller + */ +static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__l3_main_2 = { + .master = &omap34xx_usb_host_hs_hwmod, + .slave = &omap3xxx_l3_main_hwmod, + .clk = "core_l3_ick", + .user = OCP_USER_MPU, +}; + +static struct omap_hwmod_class_sysconfig omap34xx_usb_host_hs_sysc = { + .rev_offs = 0x0000, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, + .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_SIDLEMODE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), + .sysc_fields = &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap34xx_usb_host_hs_hwmod_class = { + .name = "usb_host_hs", + .sysc = &omap34xx_usb_host_hs_sysc, +}; + +static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_masters[] = { + &omap34xx_usb_host_hs__l3_main_2, +}; + +static struct omap_hwmod_addr_space omap34xx_usb_host_hs_addrs[] = { + { + .name = "uhh", + .pa_start = 0x48064000, + .pa_end = 0x480643ff, + .flags = ADDR_TYPE_RT + }, + { + .name = "ohci", + .pa_start = 0x48064400, + .pa_end = 0x480647ff, + }, + { + .name = "ehci", + .pa_start = 0x48064800, + .pa_end = 0x48064cff, + }, + {} +}; + +static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_host_hs = { + .master = &omap3xxx_l4_core_hwmod, + .slave = &omap34xx_usb_host_hs_hwmod, + .clk = "l4_ick", + .addr = omap34xx_usb_host_hs_addrs, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +static struct omap_hwmod_ocp_if omap34xx_usb_host_hs__ick = { + .clk = "usbhost_ick", + .user = OCP_USER_MPU, + .flags = OCPIF_SWSUP_IDLE, +}; + +static struct omap_hwmod_ocp_if *omap34xx_usb_host_hs_slaves[] = { + &omap34xx_l4_cfg__usb_host_hs, + &omap34xx_usb_host_hs__ick, +}; + +static struct omap_hwmod_opt_clk omap34xx_usb_host_hs_opt_clks[] = { + { .role = "usbhost_fck2", .clk = "usbhost_120m_fck", }, +}; + +static struct omap_hwmod_irq_info omap34xx_usb_host_hs_irqs[] = { + { .name = "ohci-irq", .irq = 76 }, + { .name = "ehci-irq", .irq = 77 }, + { .irq = -1 } +}; + +static struct omap_hwmod omap34xx_usb_host_hs_hwmod = { + .name = "usb_host_hs", + .class = &omap34xx_usb_host_hs_hwmod_class, + .clkdm_name = "l3_init_clkdm", + .mpu_irqs = omap34xx_usb_host_hs_irqs, + .main_clk = "usbhost_48m_fck", + .prcm = { + .omap2 = { + .module_offs = OMAP3430ES2_USBHOST_MOD, + .prcm_reg_id = 1, + .module_bit = OMAP3430ES2_EN_USBHOST1_SHIFT, + .idlest_reg_id = 1, + .idlest_idle_bit = OMAP3430ES2_ST_USBHOST_IDLE_SHIFT, + .idlest_stdby_bit = OMAP3430ES2_ST_USBHOST_STDBY_SHIFT, + }, + }, + .opt_clks = omap34xx_usb_host_hs_opt_clks, + .opt_clks_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_opt_clks), + .slaves = omap34xx_usb_host_hs_slaves, + .slaves_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_slaves), + .masters = omap34xx_usb_host_hs_masters, + .masters_cnt = ARRAY_SIZE(omap34xx_usb_host_hs_masters), +/* + * The usbhs controller prevents the enter omap to low power mode + * if other than FORCE IDLE and FORCE STANDBY are used. + */ + .flags = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* + * 'usb_tll_hs' class + * usb_tll_hs module is the adapter on the usb_host_hs ports + */ +static struct omap_hwmod_class_sysconfig omap34xx_usb_tll_hs_sysc = { + .rev_offs = 0x0000, + .sysc_offs = 0x0010, + .syss_offs = 0x0014, + .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_SIDLEMODE | + SYSC_HAS_SOFTRESET | SYSC_HAS_ENAWAKEUP | + SYSC_HAS_CLOCKACTIVITY), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_fields = &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap34xx_usb_tll_hs_hwmod_class = { + .name = "usb_tll_hs", + .sysc = &omap34xx_usb_tll_hs_sysc, +}; + +static struct omap_hwmod_irq_info omap34xx_usb_tll_hs_irqs[] = { + { .name = "tll-irq", .irq = 78 }, + { .irq = -1 } +}; + +static struct omap_hwmod_addr_space omap34xx_usb_tll_hs_addrs[] = { + { + .name = "tll", + .pa_start = 0x48062000, + .pa_end = 0x48062fff, + .flags = ADDR_TYPE_RT + }, + {} +}; + +static struct omap_hwmod_ocp_if omap34xx_f_cfg__usb_tll_hs = { + .clk = "usbtll_ick", + .user = OCP_USER_MPU, + .flags = OCPIF_SWSUP_IDLE, +}; + +static struct omap_hwmod_ocp_if omap34xx_l4_cfg__usb_tll_hs = { + .master = &omap3xxx_l4_core_hwmod, + .slave = &omap34xx_usb_tll_hs_hwmod, + .clk = "l4_ick", + .addr = omap34xx_usb_tll_hs_addrs, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +static struct omap_hwmod_ocp_if *omap34xx_usb_tll_hs_slaves[] = { + &omap34xx_l4_cfg__usb_tll_hs, + &omap34xx_f_cfg__usb_tll_hs, +}; + +static struct omap_hwmod omap34xx_usb_tll_hs_hwmod = { + .name = "usb_tll_hs", + .class = &omap34xx_usb_tll_hs_hwmod_class, + .clkdm_name = "l3_init_clkdm", + .mpu_irqs = omap34xx_usb_tll_hs_irqs, + .main_clk = "usbtll_fck", + .prcm = { + .omap2 = { + .module_offs = CORE_MOD, + .prcm_reg_id = 3, + .module_bit = OMAP3430ES2_EN_USBTLL_SHIFT, + .idlest_reg_id = 3, + .idlest_idle_bit = OMAP3430ES2_ST_USBTLL_SHIFT, + }, + }, + .slaves = omap34xx_usb_tll_hs_slaves, + .slaves_cnt = ARRAY_SIZE(omap34xx_usb_tll_hs_slaves), +/* + * The usbhs controller prevents the enter omap to low power mode + * if other than FORCE IDLE for TLL mode too. + */ + .flags = HWMOD_SWSUP_SIDLE, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_l3_main_hwmod, &omap3xxx_l4_core_hwmod, @@ -3225,6 +3415,11 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = { &omap3xxx_uart2_hwmod, &omap3xxx_uart3_hwmod, &omap3xxx_uart4_hwmod, + + /* usb host class */ + &omap34xx_usb_host_hs_hwmod, + &omap34xx_usb_tll_hs_hwmod, + /* dss class */ &omap3430es1_dss_core_hwmod, &omap3xxx_dss_core_hwmod, -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs 2011-09-29 14:24 ` [PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3 Keshava Munegowda @ 2011-09-29 14:24 ` Keshava Munegowda 0 siblings, 0 replies; 8+ messages in thread From: Keshava Munegowda @ 2011-09-29 14:24 UTC (permalink / raw) To: linux-usb, linux-omap, linux-kernel, balbi, khilman, b-cousson, paul Cc: Keshava Munegowda, gadiyar, sameo, parthab, tony, johnstul, vishwanath.bs The hwmod structure of usb_host_hs and usb_tll are retrieved and registered with omap device Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com> Reviewed-by: Partha Basak <parthab@india.ti.com> --- arch/arm/mach-omap2/usb-host.c | 100 ++++++++++++++-------------------------- 1 files changed, 34 insertions(+), 66 deletions(-) diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c index 89ae298..771dc78 100644 --- a/arch/arm/mach-omap2/usb-host.c +++ b/arch/arm/mach-omap2/usb-host.c @@ -28,51 +28,28 @@ #include <mach/hardware.h> #include <mach/irqs.h> #include <plat/usb.h> +#include <plat/omap_device.h> #include "mux.h" #ifdef CONFIG_MFD_OMAP_USB_HOST -#define OMAP_USBHS_DEVICE "usbhs-omap" - -static struct resource usbhs_resources[] = { - { - .name = "uhh", - .flags = IORESOURCE_MEM, - }, - { - .name = "tll", - .flags = IORESOURCE_MEM, - }, - { - .name = "ehci", - .flags = IORESOURCE_MEM, - }, - { - .name = "ehci-irq", - .flags = IORESOURCE_IRQ, - }, - { - .name = "ohci", - .flags = IORESOURCE_MEM, - }, - { - .name = "ohci-irq", - .flags = IORESOURCE_IRQ, - } -}; - -static struct platform_device usbhs_device = { - .name = OMAP_USBHS_DEVICE, - .id = 0, - .num_resources = ARRAY_SIZE(usbhs_resources), - .resource = usbhs_resources, -}; +#define OMAP_USBHS_DEVICE "usbhs_omap" +#define USBHS_UHH_HWMODNAME "usb_host_hs" +#define USBHS_TLL_HWMODNAME "usb_tll_hs" static struct usbhs_omap_platform_data usbhs_data; static struct ehci_hcd_omap_platform_data ehci_data; static struct ohci_hcd_omap_platform_data ohci_data; +static struct omap_device_pm_latency omap_uhhtll_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + }, +}; + /* MUX settings for EHCI pins */ /* * setup_ehci_io_mux - initialize IO pad mux for USBHOST @@ -508,7 +485,10 @@ static void setup_4430ohci_io_mux(const enum usbhs_omap_port_mode *port_mode) void __init usbhs_init(const struct usbhs_omap_board_data *pdata) { - int i; + struct omap_hwmod *oh[2]; + struct omap_device *od; + int bus_id = -1; + int i; for (i = 0; i < OMAP3_HS_USB_PORTS; i++) { usbhs_data.port_mode[i] = pdata->port_mode[i]; @@ -523,44 +503,34 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) usbhs_data.ohci_data = &ohci_data; if (cpu_is_omap34xx()) { - usbhs_resources[0].start = OMAP34XX_UHH_CONFIG_BASE; - usbhs_resources[0].end = OMAP34XX_UHH_CONFIG_BASE + SZ_1K - 1; - usbhs_resources[1].start = OMAP34XX_USBTLL_BASE; - usbhs_resources[1].end = OMAP34XX_USBTLL_BASE + SZ_4K - 1; - usbhs_resources[2].start = OMAP34XX_EHCI_BASE; - usbhs_resources[2].end = OMAP34XX_EHCI_BASE + SZ_1K - 1; - usbhs_resources[3].start = INT_34XX_EHCI_IRQ; - usbhs_resources[4].start = OMAP34XX_OHCI_BASE; - usbhs_resources[4].end = OMAP34XX_OHCI_BASE + SZ_1K - 1; - usbhs_resources[5].start = INT_34XX_OHCI_IRQ; setup_ehci_io_mux(pdata->port_mode); setup_ohci_io_mux(pdata->port_mode); } else if (cpu_is_omap44xx()) { - usbhs_resources[0].start = OMAP44XX_UHH_CONFIG_BASE; - usbhs_resources[0].end = OMAP44XX_UHH_CONFIG_BASE + SZ_1K - 1; - usbhs_resources[1].start = OMAP44XX_USBTLL_BASE; - usbhs_resources[1].end = OMAP44XX_USBTLL_BASE + SZ_4K - 1; - usbhs_resources[2].start = OMAP44XX_HSUSB_EHCI_BASE; - usbhs_resources[2].end = OMAP44XX_HSUSB_EHCI_BASE + SZ_1K - 1; - usbhs_resources[3].start = OMAP44XX_IRQ_EHCI; - usbhs_resources[4].start = OMAP44XX_HSUSB_OHCI_BASE; - usbhs_resources[4].end = OMAP44XX_HSUSB_OHCI_BASE + SZ_1K - 1; - usbhs_resources[5].start = OMAP44XX_IRQ_OHCI; setup_4430ehci_io_mux(pdata->port_mode); setup_4430ohci_io_mux(pdata->port_mode); } - if (platform_device_add_data(&usbhs_device, - &usbhs_data, sizeof(usbhs_data)) < 0) { - printk(KERN_ERR "USBHS platform_device_add_data failed\n"); - goto init_end; + oh[0] = omap_hwmod_lookup(USBHS_UHH_HWMODNAME); + if (!oh[0]) { + pr_err("Could not look up %s\n", USBHS_UHH_HWMODNAME); + return; } - if (platform_device_register(&usbhs_device) < 0) - printk(KERN_ERR "USBHS platform_device_register failed\n"); + oh[1] = omap_hwmod_lookup(USBHS_TLL_HWMODNAME); + if (!oh[1]) { + pr_err("Could not look up %s\n", USBHS_TLL_HWMODNAME); + return; + } -init_end: - return; + od = omap_device_build_ss(OMAP_USBHS_DEVICE, bus_id, oh, 2, + (void *)&usbhs_data, sizeof(usbhs_data), + omap_uhhtll_latency, + ARRAY_SIZE(omap_uhhtll_latency), false); + if (IS_ERR(od)) { + pr_err("Could not build hwmod devices %s,%s\n", + USBHS_UHH_HWMODNAME, USBHS_TLL_HWMODNAME); + return; + } } #else @@ -570,5 +540,3 @@ void __init usbhs_init(const struct usbhs_omap_board_data *pdata) } #endif - - -- 1.6.0.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-09-30 9:32 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-09-30 5:41 [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs Keshava Munegowda 2011-09-30 7:15 ` Paul Walmsley 2011-09-30 7:34 ` Felipe Balbi 2011-09-30 9:15 ` Munegowda, Keshava 2011-09-30 9:19 ` Felipe Balbi 2011-09-30 9:26 ` Munegowda, Keshava 2011-09-30 9:32 ` Felipe Balbi -- strict thread matches above, loose matches on Subject: below -- 2011-09-29 14:24 [PATCH 0/5 v12] mfd: omap: usb: Runtime PM support for EHCI and OHCI drivers Keshava Munegowda 2011-09-29 14:24 ` [PATCH 1/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap4 Keshava Munegowda 2011-09-29 14:24 ` [PATCH 2/5 v12] arm: omap: usb: ehci and ohci hwmod structures for omap3 Keshava Munegowda 2011-09-29 14:24 ` [PATCH 3/5 v12] arm: omap: usb: register hwmods of usbhs Keshava Munegowda
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox