All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Linux OMAP Mailing List <linux-omap@vger.kernel.org>,
	Linux ARM Kernel Mailing List
	<linux-arm-kernel@lists.infradead.org>, Hema HK <hemahk@ti.com>,
	Kevin Hilman <khilman@deeprootsystems.com>,
	"Cousson, Benoit" <b-cousson@ti.com>,
	Paul Walmsley <paul@pwsan.com>, Felipe Balbi <balbi@ti.com>
Subject: [patch-v2.6.39 3/7] OMAP2430: hwmod data: Add USBOTG
Date: Thu, 17 Feb 2011 14:41:02 +0200	[thread overview]
Message-ID: <1297946466-9565-4-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1297946466-9565-1-git-send-email-balbi@ti.com>

From: Hema HK <hemahk@ti.com>

OMAP2430 hwmod data structures are populated with base address, L3 and L4
interface clocks, IRQs and sysconfig register details.

As per OMAP USBOTG specification, need to configure the USBOTG
to smart idle/standby or no idle/standby during data transfer and
force idle/standby when not in use to support retention and off-mode.
By setting HWMOD_SWSUP_SIDLE and HWMOD_SWSUP_MSTANDBY flags, framework
will take care of configuring to no idle/standby when module is enabled
and force idle/standby when suspended.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   98 ++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..76bbf8a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -89,6 +89,16 @@ static struct omap_hwmod omap2430_uart3_hwmod;
 static struct omap_hwmod omap2430_i2c1_hwmod;
 static struct omap_hwmod omap2430_i2c2_hwmod;
 
+static struct omap_hwmod omap2430_usbhsotg_hwmod;
+
+/* l3_core -> usbhsotg  interface */
+static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
+	.master		= &omap2430_usbhsotg_hwmod,
+	.slave		= &omap2430_l3_main_hwmod,
+	.clk		= "core_l3_ck",
+	.user		= OCP_USER_MPU,
+};
+
 /* I2C IP block address space length (in bytes) */
 #define OMAP2_I2C_AS_LEN		128
 
@@ -189,6 +199,35 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/*
+* usbhsotg interface data
+*/
+static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
+	{
+		.pa_start	= OMAP243X_HS_BASE,
+		.pa_end		= OMAP243X_HS_BASE + SZ_4K - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/*  l4_core ->usbhsotg  interface */
+static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
+	.master		= &omap2430_l4_core_hwmod,
+	.slave		= &omap2430_usbhsotg_hwmod,
+	.clk		= "usb_l4_ick",
+	.addr		= omap2430_usbhsotg_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2430_usbhsotg_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = {
+	&omap2430_usbhsotg__l3,
+};
+
+static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = {
+	&omap2430_l4_core__usbhsotg,
+};
+
 /* Slave interfaces on the L4_CORE interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
 	&omap2430_l3_main__l4_core,
@@ -919,6 +958,62 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
 	.flags		= HWMOD_NO_IDLEST,
 };
 
+/*
+ * usbhsotg
+ */
+static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
+	.rev_offs	= 0x0400,
+	.sysc_offs	= 0x0404,
+	.syss_offs	= 0x0408,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
+			  SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+			  SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+			  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class usbotg_class = {
+	.name = "usbotg",
+	.sysc = &omap2430_usbhsotg_sysc,
+};
+
+/* usb_otg_hs */
+static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
+
+	{ .name = "mc", .irq = 92 },
+	{ .name = "dma", .irq = 93 },
+};
+
+static struct omap_hwmod omap2430_usbhsotg_hwmod = {
+	.name		= "usb_otg_hs",
+	.mpu_irqs	= omap2430_usbhsotg_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs),
+	.main_clk	= "usbhs_ick",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP2430_EN_USBHS_MASK,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
+		},
+	},
+	.masters	= omap2430_usbhsotg_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2430_usbhsotg_masters),
+	.slaves		= omap2430_usbhsotg_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_usbhsotg_slaves),
+	.class		= &usbotg_class,
+	/*
+	 * Erratum ID: i479  idle_req / idle_ack mechanism potentially
+	 * broken when autoidle is enabled
+	 * workaround is to disable the autoidle bit at module level.
+	 */
+	.flags		= HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
+				| HWMOD_SWSUP_MSTANDBY,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
 static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 	&omap2430_l3_main_hwmod,
 	&omap2430_l4_core_hwmod,
@@ -941,6 +1036,9 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2430_dma_system_hwmod,
+
+	/* usbotg class*/
+	&omap2430_usbhsotg_hwmod,
 	NULL,
 };
 
-- 
1.7.4.rc2


WARNING: multiple messages have this Message-ID (diff)
From: balbi@ti.com (Felipe Balbi)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch-v2.6.39 3/7] OMAP2430: hwmod data: Add USBOTG
Date: Thu, 17 Feb 2011 14:41:02 +0200	[thread overview]
Message-ID: <1297946466-9565-4-git-send-email-balbi@ti.com> (raw)
In-Reply-To: <1297946466-9565-1-git-send-email-balbi@ti.com>

From: Hema HK <hemahk@ti.com>

OMAP2430 hwmod data structures are populated with base address, L3 and L4
interface clocks, IRQs and sysconfig register details.

As per OMAP USBOTG specification, need to configure the USBOTG
to smart idle/standby or no idle/standby during data transfer and
force idle/standby when not in use to support retention and off-mode.
By setting HWMOD_SWSUP_SIDLE and HWMOD_SWSUP_MSTANDBY flags, framework
will take care of configuring to no idle/standby when module is enabled
and force idle/standby when suspended.

Signed-off-by: Hema HK <hemahk@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Cousson, Benoit <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   98 ++++++++++++++++++++++++++++
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index 8ecfbcd..76bbf8a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -89,6 +89,16 @@ static struct omap_hwmod omap2430_uart3_hwmod;
 static struct omap_hwmod omap2430_i2c1_hwmod;
 static struct omap_hwmod omap2430_i2c2_hwmod;
 
+static struct omap_hwmod omap2430_usbhsotg_hwmod;
+
+/* l3_core -> usbhsotg  interface */
+static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = {
+	.master		= &omap2430_usbhsotg_hwmod,
+	.slave		= &omap2430_l3_main_hwmod,
+	.clk		= "core_l3_ck",
+	.user		= OCP_USER_MPU,
+};
+
 /* I2C IP block address space length (in bytes) */
 #define OMAP2_I2C_AS_LEN		128
 
@@ -189,6 +199,35 @@ static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = {
 	.user		= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
+/*
+* usbhsotg interface data
+*/
+static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = {
+	{
+		.pa_start	= OMAP243X_HS_BASE,
+		.pa_end		= OMAP243X_HS_BASE + SZ_4K - 1,
+		.flags		= ADDR_TYPE_RT
+	},
+};
+
+/*  l4_core ->usbhsotg  interface */
+static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = {
+	.master		= &omap2430_l4_core_hwmod,
+	.slave		= &omap2430_usbhsotg_hwmod,
+	.clk		= "usb_l4_ick",
+	.addr		= omap2430_usbhsotg_addrs,
+	.addr_cnt	= ARRAY_SIZE(omap2430_usbhsotg_addrs),
+	.user		= OCP_USER_MPU,
+};
+
+static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = {
+	&omap2430_usbhsotg__l3,
+};
+
+static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = {
+	&omap2430_l4_core__usbhsotg,
+};
+
 /* Slave interfaces on the L4_CORE interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
 	&omap2430_l3_main__l4_core,
@@ -919,6 +958,62 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {
 	.flags		= HWMOD_NO_IDLEST,
 };
 
+/*
+ * usbhsotg
+ */
+static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = {
+	.rev_offs	= 0x0400,
+	.sysc_offs	= 0x0404,
+	.syss_offs	= 0x0408,
+	.sysc_flags	= (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE|
+			  SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET |
+			  SYSC_HAS_AUTOIDLE),
+	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+			  MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART),
+	.sysc_fields	= &omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class usbotg_class = {
+	.name = "usbotg",
+	.sysc = &omap2430_usbhsotg_sysc,
+};
+
+/* usb_otg_hs */
+static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = {
+
+	{ .name = "mc", .irq = 92 },
+	{ .name = "dma", .irq = 93 },
+};
+
+static struct omap_hwmod omap2430_usbhsotg_hwmod = {
+	.name		= "usb_otg_hs",
+	.mpu_irqs	= omap2430_usbhsotg_mpu_irqs,
+	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs),
+	.main_clk	= "usbhs_ick",
+	.prcm		= {
+		.omap2 = {
+			.prcm_reg_id = 1,
+			.module_bit = OMAP2430_EN_USBHS_MASK,
+			.module_offs = CORE_MOD,
+			.idlest_reg_id = 1,
+			.idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT,
+		},
+	},
+	.masters	= omap2430_usbhsotg_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2430_usbhsotg_masters),
+	.slaves		= omap2430_usbhsotg_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_usbhsotg_slaves),
+	.class		= &usbotg_class,
+	/*
+	 * Erratum ID: i479  idle_req / idle_ack mechanism potentially
+	 * broken when autoidle is enabled
+	 * workaround is to disable the autoidle bit at module level.
+	 */
+	.flags		= HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE
+				| HWMOD_SWSUP_MSTANDBY,
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
 static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 	&omap2430_l3_main_hwmod,
 	&omap2430_l4_core_hwmod,
@@ -941,6 +1036,9 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 
 	/* dma_system class*/
 	&omap2430_dma_system_hwmod,
+
+	/* usbotg class*/
+	&omap2430_usbhsotg_hwmod,
 	NULL,
 };
 
-- 
1.7.4.rc2

  parent reply	other threads:[~2011-02-17 12:41 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 12:40 [patch-v2.6.39 0/7] Patches for next merge window Felipe Balbi
2011-02-17 12:40 ` Felipe Balbi
2011-02-17 12:41 ` [patch-v2.6.39 1/7] arm: omap4: usb: explicitly configure MUSB pads Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi
2011-02-17 12:41 ` [patch-v2.6.39 2/7] arm: omap4: 4430sdp: drop ehci support Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi
2011-02-17 12:41 ` Felipe Balbi [this message]
2011-02-17 12:41   ` [patch-v2.6.39 3/7] OMAP2430: hwmod data: Add USBOTG Felipe Balbi
2011-02-17 12:41 ` [patch-v2.6.39 4/7] OMAP3xxx: " Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi
2011-02-17 12:41 ` [patch-v2.6.39 5/7] AM35xx: " Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi
2011-02-18 11:29   ` Premi, Sanjeev
2011-02-18 11:29     ` Premi, Sanjeev
2011-02-18 13:07     ` Hema Kalliguddi
2011-02-18 13:07       ` Hema Kalliguddi
2011-02-18 13:31       ` Premi, Sanjeev
2011-02-18 13:31         ` Premi, Sanjeev
2011-02-17 12:41 ` [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi
2011-02-17 13:43   ` Cousson, Benoit
2011-02-17 13:43     ` Cousson, Benoit
2011-02-17 14:07     ` Hema Kalliguddi
2011-02-17 14:07       ` Hema Kalliguddi
2011-02-17 15:15     ` Felipe Balbi
2011-02-17 15:15       ` Felipe Balbi
2011-02-17 15:18       ` Felipe Balbi
2011-02-17 15:18         ` Felipe Balbi
2011-02-17 15:21         ` Cousson, Benoit
2011-02-17 15:21           ` Cousson, Benoit
2011-02-17 15:26           ` Felipe Balbi
2011-02-17 15:26             ` Felipe Balbi
2011-02-17 15:54             ` Cousson, Benoit
2011-02-17 15:54               ` Cousson, Benoit
2011-02-17 16:20               ` Tony Lindgren
2011-02-17 16:20                 ` Tony Lindgren
2011-02-17 16:22                 ` Felipe Balbi
2011-02-17 16:22                   ` Felipe Balbi
2011-02-17 16:59                   ` Tony Lindgren
2011-02-17 16:59                     ` Tony Lindgren
2011-02-17 17:14                     ` Cousson, Benoit
2011-02-17 17:14                       ` Cousson, Benoit
2011-02-17 17:17                       ` Felipe Balbi
2011-02-17 17:17                         ` Felipe Balbi
2011-02-17 17:17                       ` Felipe Balbi
2011-02-17 17:17                         ` Felipe Balbi
2011-02-17 17:24                         ` Cousson, Benoit
2011-02-17 17:24                           ` Cousson, Benoit
2011-02-17 17:37                           ` Felipe Balbi
2011-02-17 17:37                             ` Felipe Balbi
2011-02-17 17:46                             ` Cousson, Benoit
2011-02-17 17:46                               ` Cousson, Benoit
2011-02-17 17:52                               ` Felipe Balbi
2011-02-17 17:52                                 ` Felipe Balbi
2011-02-17 18:01                                 ` Felipe Balbi
2011-02-17 18:01                                   ` Felipe Balbi
2011-02-17 18:18                               ` Tony Lindgren
2011-02-17 18:18                                 ` Tony Lindgren
2011-02-17 19:08                                 ` Felipe Balbi
2011-02-17 19:08                                   ` Felipe Balbi
2011-02-17 21:16                                   ` Tony Lindgren
2011-02-17 21:16                                     ` Tony Lindgren
2011-02-18 14:11                                 ` Cousson, Benoit
2011-02-18 14:11                                   ` Cousson, Benoit
2011-02-18 15:41                                   ` Felipe Balbi
2011-02-18 15:41                                     ` Felipe Balbi
2011-02-18 15:55                                     ` Cousson, Benoit
2011-02-18 15:55                                       ` Cousson, Benoit
2011-02-18 16:50                                     ` Cousson, Benoit
2011-02-18 16:50                                       ` Cousson, Benoit
2011-02-21 18:22                                       ` Tony Lindgren
2011-02-21 18:22                                         ` Tony Lindgren
2011-02-21 21:36                                         ` Cousson, Benoit
2011-02-21 21:36                                           ` Cousson, Benoit
2011-02-21 22:08                                           ` Tony Lindgren
2011-02-21 22:08                                             ` Tony Lindgren
2011-02-21 22:53                                             ` Cousson, Benoit
2011-02-21 22:53                                               ` Cousson, Benoit
2011-02-21 23:09                                               ` Tony Lindgren
2011-02-21 23:09                                                 ` Tony Lindgren
2011-02-21 23:28                                               ` Russell King - ARM Linux
2011-02-21 23:28                                                 ` Russell King - ARM Linux
2011-02-22 18:27                                               ` Paul Walmsley
2011-02-22 18:27                                                 ` Paul Walmsley
2011-02-17 16:21             ` Tony Lindgren
2011-02-17 16:21               ` Tony Lindgren
2011-02-17 16:31               ` Felipe Balbi
2011-02-17 16:31                 ` Felipe Balbi
2011-02-17 12:41 ` [patch-v2.6.39 7/7] OMAP2+: musb: hwmod adaptation for musb registration Felipe Balbi
2011-02-17 12:41   ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1297946466-9565-4-git-send-email-balbi@ti.com \
    --to=balbi@ti.com \
    --cc=b-cousson@ti.com \
    --cc=hemahk@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=paul@pwsan.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.