Skip to contentSkip to conversation

OMAP: CM, hwmod, omap_device fixes and updates

PATCH In review Kevin Hilman 6 participants 28 messages Jun 24, 2010 – Jul 2, 2010

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v2 cover OMAP: CM, hwmod, omap_device fixes and updates

This is a series of fixes & updates mostly to hwmod and omap_device that are required for the on-going hwmod conversions and runtime PM conversion of drivers.

While some of these are fixes, they are not urgent for 2.6.35 and can wait until the next merge window.

This series applies on top of the runtime PM series just posted and is also available as the pm-wip/hwmods branch of my linux-omap-pm git tree:

git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm.git

This has been tested with various hwmod & runtime PM conversions (UART, MMC, dmtimer) on OMAP2, OMAP3 and OMAP4.

Kevin

Benoit Cousson (2):
OMAP: hwmod: Fix the missing braces OMAP2&3: hwmod: Remove _hwmod prefix in name string

Kevin Hilman (10):
OMAP24xx: CM: fix mask used for checking IDLEST status
OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE OMAP2/3: hwmod: L3 and L4 CORE/PER/WKUP hwmods don't have IDLEST
OMAP: hwmod: add non-locking versions of enable and idle functions
OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME
OMAP: omap_device: ensure hwmod tracks attached omap_device pointer
OMAP: create omap_devices for MPU, DSP, L3
OMAP: hwmod data: add class for IVA hwmods
OMAP2&3: hwmod: Replace l3 -> l3_main
OMAP3: hwmod data: add data for OMAP3 IVA2

Rajendra Nayak (1):
OMAP4: hwmod: Enable omap_device build for OMAP4

 arch/arm/mach-omap2/cm.c                     |    6 +-
 arch/arm/mach-omap2/devices.c                |    2 +
 arch/arm/mach-omap2/io.c                     |   58 ++++++++++++++++-
 arch/arm/mach-omap2/omap_hwmod.c             |   47 ++++++++++----
 arch/arm/mach-omap2/omap_hwmod_2420_data.c   |   49 +++++++-------
 arch/arm/mach-omap2/omap_hwmod_2430_data.c   |   49 +++++++-------
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c   |   92 ++++++++++++++++++--------
 arch/arm/mach-omap2/omap_hwmod_common_data.c |    3 +
 arch/arm/mach-omap2/omap_hwmod_common_data.h |    1 +
 arch/arm/plat-omap/Makefile                  |    1 +
 arch/arm/plat-omap/include/plat/common.h     |    4 +
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 +
 arch/arm/plat-omap/omap_device.c             |    8 ++-
 13 files changed, 228 insertions(+), 94 deletions(-)
#1 lore raw

PATCH v2 1/13 OMAP24xx: CM: fix mask used for checking IDLEST status

On OMAP24xx, the polarity for the IDLEST bits is opposite of OMAP3. The mask used to check this was using the bit position instead of the bit mask.

This patch fixes the problem by using the bit mask instead of the bit field.

---
 arch/arm/mach-omap2/cm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/cm.c +3 -3
index 2d83565..721c3b6 100644
@@ -50,15 +50,15 @@ int omap2_cm_wait_module_ready(s16 prcm_mod, u8 idlest_id, u8 idlest_shift)
 
 	cm_idlest_reg = cm_idlest_offs[idlest_id - 1];
 
+	mask = 1 << idlest_shift;
+
 	if (cpu_is_omap24xx())
-		ena = idlest_shift;
+		ena = mask;
 	else if (cpu_is_omap34xx())
 		ena = 0;
 	else
 		BUG();
 
-	mask = 1 << idlest_shift;
-
 	/* XXX should be OMAP2 CM */
 	omap_test_timeout(((cm_read_mod_reg(prcm_mod, cm_idlest_reg) & mask) == ena),
 			  MAX_MODULE_READY_TIME, i);
Signature · 1 line
1.7.0.2
#2 lore raw

PATCH v2 2/13 OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE

In reply to Kevin Hilman

If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is currently way to idle it since omap_hwmod_idle() requires the hwmod to be in the enabled state.

This patch adds a check to omap_hwmod_idle() so if the hwmod was has the INIT_NO_IDLE flag, calling omap_hwmod_idle() will still succeed.

---
 arch/arm/mach-omap2/omap_hwmod.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +10 -1
index 95c9a5f..ac75407 100644
@@ -938,7 +938,13 @@ static int _enable(struct omap_hwmod *oh)
  */
 static int _idle(struct omap_hwmod *oh)
 {
-	if (oh->_state != _HWMOD_STATE_ENABLED) {
+	/*
+	 * To idle, hwmod must be enabled, EXCEPT if hwmod was
+	 * initialized using the INIT_NO_IDLE flag.  In this case it
+	 * will not yet be enabled so we have to allow it to be idled.
+	 */
+	if ((oh->_state != _HWMOD_STATE_ENABLED) &&
+	    !(oh->flags & HWMOD_INIT_NO_IDLE)) {
 		WARN(1, "omap_hwmod: %s: idle state can only be entered from "
 		     "enabled state\n", oh->name);
 		return -EINVAL;
@@ -953,6 +959,9 @@ static int _idle(struct omap_hwmod *oh)
 
 	oh->_state = _HWMOD_STATE_IDLE;
 
+	/* Clear init flag which should only affect first call to idle */
+	oh->flags &= ~HWMOD_INIT_NO_IDLE;
+
 	return 0;
 }
 
Signature · 1 line
1.7.0.2
#3 lore raw

PATCH v2 3/13 OMAP2/3: hwmod: L3 and L4 CORE/PER/WKUP hwmods don't have IDLEST

In reply to Kevin Hilman

Since these hwmods do not have IDLEST, set the HWMOD_NO_IDLEST flag, otherwise _enable() will fail due to failing _wait_target_ready().

---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |    9 ++++++---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |    9 ++++++---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   12 ++++++++----
 3 files changed, 20 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +6 -3
index e5530c5..a8b57a6 100644
@@ -65,7 +65,8 @@ static struct omap_hwmod omap2420_l3_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2420_l3_masters),
 	.slaves		= omap2420_l3_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2420_l3_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 static struct omap_hwmod omap2420_l4_wkup_hwmod;
@@ -95,7 +96,8 @@ static struct omap_hwmod omap2420_l4_core_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2420_l4_core_masters),
 	.slaves		= omap2420_l4_core_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2420_l4_core_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Slave interfaces on the L4_WKUP interconnect */
@@ -115,7 +117,8 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2420_l4_wkup_masters),
 	.slaves		= omap2420_l4_wkup_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2420_l4_wkup_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Master interfaces on the MPU device */
arch/arm/mach-omap2/omap_hwmod_2430_data.c +6 -3
index 0852d95..8b1f74b 100644
@@ -65,7 +65,8 @@ static struct omap_hwmod omap2430_l3_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2430_l3_masters),
 	.slaves		= omap2430_l3_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2430_l3_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 static struct omap_hwmod omap2430_l4_wkup_hwmod;
@@ -97,7 +98,8 @@ static struct omap_hwmod omap2430_l4_core_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2430_l4_core_masters),
 	.slaves		= omap2430_l4_core_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2430_l4_core_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Slave interfaces on the L4_WKUP interconnect */
@@ -117,7 +119,8 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap2430_l4_wkup_masters),
 	.slaves		= omap2430_l4_wkup_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap2430_l4_wkup_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Master interfaces on the MPU device */
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +8 -4
index 39b0c0e..e288b20 100644
@@ -76,7 +76,8 @@ static struct omap_hwmod omap3xxx_l3_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l3_masters),
 	.slaves		= omap3xxx_l3_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_l3_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 static struct omap_hwmod omap3xxx_l4_wkup_hwmod;
@@ -106,7 +107,8 @@ static struct omap_hwmod omap3xxx_l4_core_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_core_masters),
 	.slaves		= omap3xxx_l4_core_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_l4_core_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Slave interfaces on the L4_PER interconnect */
@@ -126,7 +128,8 @@ static struct omap_hwmod omap3xxx_l4_per_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_per_masters),
 	.slaves		= omap3xxx_l4_per_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_l4_per_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Slave interfaces on the L4_WKUP interconnect */
@@ -146,7 +149,8 @@ static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_wkup_masters),
 	.slaves		= omap3xxx_l4_wkup_slaves,
 	.slaves_cnt	= ARRAY_SIZE(omap3xxx_l4_wkup_slaves),
-	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
+	.flags		= HWMOD_NO_IDLEST,
 };
 
 /* Master interfaces on the MPU device */
Signature · 1 line
1.7.0.2
#4 lore raw

PATCH v2 4/13 OMAP: hwmod: Fix the missing braces

In reply to Kevin Hilman

From: Benoit Cousson <[email protected]>

As reported by Sergei, a couple of braces were missing after the WARM removal patch.

[07/22] OMAP: hwmod: Replace WARN by pr_warning if clock lookup failed

https://patchwork.kernel.org/patch/100756/

---
 arch/arm/mach-omap2/omap_hwmod.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +6 -3
index ac75407..3d11523 100644
@@ -409,10 +409,11 @@ static int _init_main_clk(struct omap_hwmod *oh)
 		return 0;
 
 	oh->_clk = omap_clk_get_by_name(oh->main_clk);
-	if (!oh->_clk)
+	if (!oh->_clk) {
 		pr_warning("omap_hwmod: %s: cannot clk_get main_clk %s\n",
 			   oh->name, oh->main_clk);
 		return -EINVAL;
+	}
 
 	if (!oh->_clk->clkdm)
 		pr_warning("omap_hwmod: %s: missing clockdomain for %s.\n",
@@ -444,10 +445,11 @@ static int _init_interface_clks(struct omap_hwmod *oh)
 			continue;
 
 		c = omap_clk_get_by_name(os->clk);
-		if (!c)
+		if (!c) {
 			pr_warning("omap_hwmod: %s: cannot clk_get interface_clk %s\n",
 				   oh->name, os->clk);
 			ret = -EINVAL;
+		}
 		os->_clk = c;
 	}
 
@@ -470,10 +472,11 @@ static int _init_opt_clks(struct omap_hwmod *oh)
 
 	for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
 		c = omap_clk_get_by_name(oc->clk);
-		if (!c)
+		if (!c) {
 			pr_warning("omap_hwmod: %s: cannot clk_get opt_clk %s\n",
 				   oh->name, oc->clk);
 			ret = -EINVAL;
+		}
 		oc->_clk = c;
 	}
 
Signature · 1 line
1.7.0.2
maintainer
#5 lore raw

Re: [PATCH v2 04/13] OMAP: hwmod: Fix the missing braces

Hi,

Quoted 5 lines · Kevin Hilman

From: Benoit Cousson <[email protected]>

As reported by Sergei, a couple of braces were missing after the WARM removal patch.

Quoted 8 lines

[07/22] OMAP: hwmod: Replace WARN by pr_warning if clock lookup failed

https://patchwork.kernel.org/patch/100756/

This one has already been sent to Tony as part of the -rc series, so I've dropped this one.

- Paul

#6 lore raw

PATCH v2 5/13 OMAP2&3: hwmod: Remove _hwmod prefix in name string

In reply to Kevin Hilman

From: Benoit Cousson <[email protected]>

In the lastest OMAP4 hwmod data file, the _hwmod was removed in order to save some memory space and because it does not bring a lot.
Align OMAP2420, 2430 and 3430 data files with the same convention.

---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |    6 +++---
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |    6 +++---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |    8 ++++----
 3 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +3 -3
index a8b57a6..646386c 100644
@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {
 
 /* L3 */
 static struct omap_hwmod omap2420_l3_hwmod = {
-	.name		= "l3_hwmod",
+	.name		= "l3_main",
 	.class		= &l3_hwmod_class,
 	.masters	= omap2420_l3_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2420_l3_masters),
@@ -90,7 +90,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = {
 
 /* L4 CORE */
 static struct omap_hwmod omap2420_l4_core_hwmod = {
-	.name		= "l4_core_hwmod",
+	.name		= "l4_core",
 	.class		= &l4_hwmod_class,
 	.masters	= omap2420_l4_core_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2420_l4_core_masters),
@@ -111,7 +111,7 @@ static struct omap_hwmod_ocp_if *omap2420_l4_wkup_masters[] = {
 
 /* L4 WKUP */
 static struct omap_hwmod omap2420_l4_wkup_hwmod = {
-	.name		= "l4_wkup_hwmod",
+	.name		= "l4_wkup",
 	.class		= &l4_hwmod_class,
 	.masters	= omap2420_l4_wkup_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2420_l4_wkup_masters),
arch/arm/mach-omap2/omap_hwmod_2430_data.c +3 -3
index 8b1f74b..b2100cf 100644
@@ -59,7 +59,7 @@ static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {
 
 /* L3 */
 static struct omap_hwmod omap2430_l3_hwmod = {
-	.name		= "l3_hwmod",
+	.name		= "l3_main",
 	.class		= &l3_hwmod_class,
 	.masters	= omap2430_l3_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2430_l3_masters),
@@ -92,7 +92,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_core_masters[] = {
 
 /* L4 CORE */
 static struct omap_hwmod omap2430_l4_core_hwmod = {
-	.name		= "l4_core_hwmod",
+	.name		= "l4_core",
 	.class		= &l4_hwmod_class,
 	.masters	= omap2430_l4_core_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2430_l4_core_masters),
@@ -113,7 +113,7 @@ static struct omap_hwmod_ocp_if *omap2430_l4_wkup_masters[] = {
 
 /* L4 WKUP */
 static struct omap_hwmod omap2430_l4_wkup_hwmod = {
-	.name		= "l4_wkup_hwmod",
+	.name		= "l4_wkup",
 	.class		= &l4_hwmod_class,
 	.masters	= omap2430_l4_wkup_masters,
 	.masters_cnt	= ARRAY_SIZE(omap2430_l4_wkup_masters),
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +4 -4
index e288b20..ec6a5f8 100644
@@ -70,7 +70,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l3_masters[] = {
 
 /* L3 */
 static struct omap_hwmod omap3xxx_l3_hwmod = {
-	.name		= "l3_hwmod",
+	.name		= "l3_main",
 	.class		= &l3_hwmod_class,
 	.masters	= omap3xxx_l3_masters,
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l3_masters),
@@ -101,7 +101,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_masters[] = {
 
 /* L4 CORE */
 static struct omap_hwmod omap3xxx_l4_core_hwmod = {
-	.name		= "l4_core_hwmod",
+	.name		= "l4_core",
 	.class		= &l4_hwmod_class,
 	.masters	= omap3xxx_l4_core_masters,
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_core_masters),
@@ -122,7 +122,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_per_masters[] = {
 
 /* L4 PER */
 static struct omap_hwmod omap3xxx_l4_per_hwmod = {
-	.name		= "l4_per_hwmod",
+	.name		= "l4_per",
 	.class		= &l4_hwmod_class,
 	.masters	= omap3xxx_l4_per_masters,
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_per_masters),
@@ -143,7 +143,7 @@ static struct omap_hwmod_ocp_if *omap3xxx_l4_wkup_masters[] = {
 
 /* L4 WKUP */
 static struct omap_hwmod omap3xxx_l4_wkup_hwmod = {
-	.name		= "l4_wkup_hwmod",
+	.name		= "l4_wkup",
 	.class		= &l4_hwmod_class,
 	.masters	= omap3xxx_l4_wkup_masters,
 	.masters_cnt	= ARRAY_SIZE(omap3xxx_l4_wkup_masters),
Signature · 1 line
1.7.0.2
#7 lore raw

PATCH v2 6/13 OMAP: hwmod: add non-locking versions of enable and idle functions

In reply to Kevin Hilman

Some hwmods may need to be idled/enabled in atomic context, so non-locking versions of these functions are required.

Most users should not need these and usage of theses should be controlled to understand why access is being done in atomic context. For this reason, the non-locking functions are only exposed at the hwmod level and not at the omap-device level.

The use-case that led to the need for the non-locking versions is hwmods that are enabled/idled from within the core idle/suspend path. Since interrupts are already disabled here, the mutex-based locking in hwmod can sleep and will cause potential deadlocks.

---
 arch/arm/mach-omap2/omap_hwmod.c             |   19 ++++++++++---------
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    2 ++
 2 files changed, 12 insertions(+), 9 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +10 -9
index 3d11523..fa11139 100644
@@ -886,7 +886,7 @@ static int _reset(struct omap_hwmod *oh)
 }
 
 /**
- * _enable - enable an omap_hwmod
+ * _omap_hwmod_enable - enable an omap_hwmod
  * @oh: struct omap_hwmod *
  *
  * Enables an omap_hwmod @oh such that the MPU can access the hwmod's
@@ -894,7 +894,7 @@ static int _reset(struct omap_hwmod *oh)
  * Returns -EINVAL if the hwmod is in the wrong state or passes along
  * the return value of _wait_target_ready().
  */
-static int _enable(struct omap_hwmod *oh)
+int _omap_hwmod_enable(struct omap_hwmod *oh)
 {
 	int r;
 
@@ -939,7 +939,7 @@ static int _enable(struct omap_hwmod *oh)
  * no further work.  Returns -EINVAL if the hwmod is in the wrong
  * state or returns 0.
  */
-static int _idle(struct omap_hwmod *oh)
+int _omap_hwmod_idle(struct omap_hwmod *oh)
 {
 	/*
 	 * To idle, hwmod must be enabled, EXCEPT if hwmod was
@@ -1038,7 +1038,7 @@ static int _setup(struct omap_hwmod *oh)
 
 	oh->_state = _HWMOD_STATE_INITIALIZED;
 
-	r = _enable(oh);
+	r = _omap_hwmod_enable(oh);
 	if (r) {
 		pr_warning("omap_hwmod: %s: cannot be enabled (%d)\n",
 			   oh->name, oh->_state);
@@ -1050,7 +1050,7 @@ static int _setup(struct omap_hwmod *oh)
 		 * XXX Do the OCP_SYSCONFIG bits need to be
 		 * reprogrammed after a reset?  If not, then this can
 		 * be removed.  If they do, then probably the
-		 * _enable() function should be split to avoid the
+		 * _omap_hwmod_enable() function should be split to avoid the
 		 * rewrite of the OCP_SYSCONFIG register.
 		 */
 		if (oh->class->sysc) {
@@ -1060,7 +1060,7 @@ static int _setup(struct omap_hwmod *oh)
 	}
 
 	if (!(oh->flags & HWMOD_INIT_NO_IDLE))
-		_idle(oh);
+		_omap_hwmod_idle(oh);
 
 	return 0;
 }
@@ -1301,12 +1301,13 @@ int omap_hwmod_enable(struct omap_hwmod *oh)
 		return -EINVAL;
 
 	mutex_lock(&omap_hwmod_mutex);
-	r = _enable(oh);
+	r = _omap_hwmod_enable(oh);
 	mutex_unlock(&omap_hwmod_mutex);
 
 	return r;
 }
 
+
 /**
  * omap_hwmod_idle - idle an omap_hwmod
  * @oh: struct omap_hwmod *
@@ -1320,7 +1321,7 @@ int omap_hwmod_idle(struct omap_hwmod *oh)
 		return -EINVAL;
 
 	mutex_lock(&omap_hwmod_mutex);
-	_idle(oh);
+	_omap_hwmod_idle(oh);
 	mutex_unlock(&omap_hwmod_mutex);
 
 	return 0;
@@ -1422,7 +1423,7 @@ int omap_hwmod_reset(struct omap_hwmod *oh)
 	mutex_lock(&omap_hwmod_mutex);
 	r = _reset(oh);
 	if (!r)
-		r = _enable(oh);
+		r = _omap_hwmod_enable(oh);
 	mutex_unlock(&omap_hwmod_mutex);
 
 	return r;
arch/arm/plat-omap/include/plat/omap_hwmod.h +2 -0
index 0eccc09..253f6e5 100644
@@ -486,7 +486,9 @@ int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh));
 int omap_hwmod_late_init(void);
 
 int omap_hwmod_enable(struct omap_hwmod *oh);
+int _omap_hwmod_enable(struct omap_hwmod *oh);
 int omap_hwmod_idle(struct omap_hwmod *oh);
+int _omap_hwmod_idle(struct omap_hwmod *oh);
 int omap_hwmod_shutdown(struct omap_hwmod *oh);
 
 int omap_hwmod_enable_clocks(struct omap_hwmod *oh);
Signature · 1 line
1.7.0.2
#8 lore raw

PATCH v2 7/13 OMAP: hwmod: don't auto-disable hwmod when !CONFIG_PM_RUNTIME

In reply to Kevin Hilman

When runtime PM is disabled, the pm_runtime_idle() and _enable() functions will be effectively noops and will not result in enable and idle calls at the hwmod level.

In order for drivers to still work when runtime PM is disabled, ensure that all hwmods are left in an enabled state so that even without runtime PM management, they will still work.

---
 arch/arm/mach-omap2/omap_hwmod.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod.c +8 -0
index fa11139..e57d9c5 100644
@@ -1059,6 +1059,14 @@ static int _setup(struct omap_hwmod *oh)
 		}
 	}
 
+#ifndef CONFIG_PM_RUNTIME
+	/*
+	 * If runtime PM is not enabled, leave the device enabled
+	 * since runtime PM will not be dynamically managing the device.
+	 */
+	oh->flags |= HWMOD_INIT_NO_IDLE;
+#endif
+
 	if (!(oh->flags & HWMOD_INIT_NO_IDLE))
 		_omap_hwmod_idle(oh);
 
Signature · 1 line
1.7.0.2
#9 lore raw

PATCH v2 8/13 OMAP4: hwmod: Enable omap_device build for OMAP4

In reply to Kevin Hilman

From: Rajendra Nayak <[email protected]>

Enable omap_device layer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.

---
 arch/arm/plat-omap/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-omap/Makefile +1 -0
index 98f0191..9405831 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
 # omap_device support (OMAP2+ only at the moment)
 obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
 obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
 
 obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
 obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o
Signature · 1 line
1.7.0.2
#10 lore raw

Re: [PATCH v2 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4

Kevin,

Quoted 18 lines · Kevin Hilman

From: Rajendra Nayak<[email protected]>

Enable omap_device layer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.

---
  arch/arm/plat-omap/Makefile |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-omap/Makefile +0 -0
index 98f0191..9405831 100644

arch/arm/plat-omap/Makefile obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o · line 21

Quoted 7 lines
arch/arm/plat-omap/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
  # omap_device support (OMAP2+ only at the moment)
  obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
  obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
 
  obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
  obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o

You need as well to enable omap_hwmod.c build otherwise it cannot build on OMAP4.

arch/arm/mach-omap2/Makefile +0 -0
@@ -15,7 +15,7 @@ clock-common                          = clock.o clock_common_data.o \
 
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common) 

$(hwmod-common)
obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common)
$(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) +obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common)

obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o

Benoit

#11 lore raw

Re: [PATCH v2 08/13] OMAP4: hwmod: Enable omap_device build for OMAP4

Quoted 24 lines · Benoit
Quoted 23 lines · Kevin Hilman

From: Rajendra Nayak<[email protected]>

Enable omap_device layer support for OMAP4, so that drivers can use them to enable/idle/shutdown devices.

---
  arch/arm/plat-omap/Makefile |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/plat-omap/Makefile +1 -0
index 98f0191..9405831 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o
  # omap_device support (OMAP2+ only at the moment)
  obj-$(CONFIG_ARCH_OMAP2) += omap_device.o
  obj-$(CONFIG_ARCH_OMAP3) += omap_device.o
+obj-$(CONFIG_ARCH_OMAP4) += omap_device.o
 
Quoted 5 lines

arch/arm/plat-omap/Makefile obj-$(CONFIG_ARCH_OMAP16XX) += ocpi.o · line 21

Quoted 2 lines
arch/arm/plat-omap/Makefile +0 -0
  obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o
  obj-$(CONFIG_OMAP_IOMMU) += iommu.o iovmm.o

You need as well to enable omap_hwmod.c build otherwise it cannot build on OMAP4.

Doh, sorry. Pushed an updated pm-wip/hwmods with this folded into $SUBJECT patch.

Kevin

Quoted 18 lines
(quoted diff) +0 -0

b/arch/arm/mach-omap2/Makefile index 8ed47ea..5de06c3 100644

arch/arm/mach-omap2/Makefile +1 -1
@@ -15,7 +15,7 @@ clock-common                          = clock.o
 clock_common_data.o \
 
 obj-$(CONFIG_ARCH_OMAP2) += $(omap-2-3-common) $(prcm-common)
 $(hwmod-common)
 obj-$(CONFIG_ARCH_OMAP3) += $(omap-2-3-common) $(prcm-common)
 $(hwmod-common)
-obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common)
+obj-$(CONFIG_ARCH_OMAP4) += $(prcm-common) $(hwmod-common)

obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o

Benoit

#12 lore raw

PATCH v2 9/13 OMAP: omap_device: ensure hwmod tracks attached omap_device pointer

In reply to Kevin Hilman

The omap_hwmod struct has a field to track the omap_device that is attached to it, but it was not being assigned. Fix by assigning omap_device pointer when omap_device is built.

---
 arch/arm/plat-omap/omap_device.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
arch/arm/plat-omap/omap_device.c +6 -2
index f899603..6614cba 100644
@@ -359,8 +359,8 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	struct omap_device *od;
 	char *pdev_name2;
 	struct resource *res = NULL;
-	int res_count;
-	struct omap_hwmod **hwmods;
+	int i, res_count;
+	struct omap_hwmod *oh, **hwmods;
 
 	if (!ohs || oh_cnt == 0 || !pdev_name)
 		return ERR_PTR(-EINVAL);
@@ -416,6 +416,10 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	else
 		ret = omap_device_register(od);
 
+	/* each hwmod has a pointer to its attached omap_device */
+	for (i = 0, oh = hwmods[0]; i < oh_cnt; i++, oh++)
+		oh->od = od;
+
 	if (ret)
 		goto odbs_exit4;
 
Signature · 1 line
1.7.0.2
maintainer
#13 lore raw

Re: [PATCH v2 09/13] OMAP: omap_device: ensure hwmod tracks attached omap_device pointer

Hi,

Quoted 6 lines · Kevin Hilman

The omap_hwmod struct has a field to track the omap_device that is attached to it, but it was not being assigned. Fix by assigning omap_device pointer when omap_device is built.

Just FYI, this patch has been converted to use an array index instead of pointer arithmetic - edited patch below.

- Paul

OMAP: omap_device: ensure hwmod tracks attached omap_device pointer

From: Kevin Hilman <[email protected]>

The omap_hwmod struct has a field to track the omap_device that is attached to it, but it was not being assigned. Fix by assigning omap_device pointer when omap_device is built.

[[email protected]: use an array index rather than pointer arithmetic]
---
 arch/arm/plat-omap/omap_device.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/plat-omap/omap_device.c +4 -1
index f899603..f9dec0d 100644
@@ -359,7 +359,7 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	struct omap_device *od;
 	char *pdev_name2;
 	struct resource *res = NULL;
-	int res_count;
+	int i, res_count;
 	struct omap_hwmod **hwmods;
 
 	if (!ohs || oh_cnt == 0 || !pdev_name)
@@ -416,6 +416,9 @@ struct omap_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
 	else
 		ret = omap_device_register(od);
 
+	for (i = 0; i < oh_cnt; i++)
+		hwmods[i]->od = od;
+
 	if (ret)
 		goto odbs_exit4;
 
#14 lore raw

PATCH v2 10/13 OMAP: create omap_devices for MPU, DSP, L3

In reply to Kevin Hilman

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

So that these primary devices are available for early PM initialization, they are created as early platform_devices.

---
 arch/arm/mach-omap2/devices.c            |    2 +
 arch/arm/mach-omap2/io.c                 |   58 +++++++++++++++++++++++++++++-
 arch/arm/plat-omap/include/plat/common.h |    4 ++
 3 files changed, 63 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +2 -0
index 03e6c9e..62920ac 100644
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -29,6 +30,7 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 
arch/arm/mach-omap2/io.c +57 -1

76 lines not on this page · raw message

arch/arm/plat-omap/include/plat/common.h +4 -0
index d265018..9cdd9cd 100644
@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *);
 	}							\
 })
 
+struct device *omap_get_mpuss_device(void);
+struct device *omap_get_dsp_device(void);
+struct device *omap_get_l3_device(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
Signature · 1 line
1.7.0.2
#15 lore raw

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 88 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Kevin Hilman
Sent: Friday, June 25, 2010 5:15 AM
To: [email protected]
Cc: [email protected]
Subject: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

So that these primary devices are available for early PM initialization, they are created as early platform_devices.

---
 arch/arm/mach-omap2/devices.c            |    2 +
 arch/arm/mach-omap2/io.c                 |   58
+++++++++++++++++++++++++++++-
 arch/arm/plat-omap/include/plat/common.h |    4 ++
 3 files changed, 63 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/devices.c +2 -0
index 03e6c9e..62920ac 100644
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -29,6 +30,7 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 
arch/arm/mach-omap2/io.c +27 -1
index 3cfb425..407498d 100644
@@ -45,7 +45,7 @@
 
 #include <plat/clockdomain.h>
 #include "clockdomains.h"
-#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
 
 /*
  * The machine specific code may provide the extra mapping besides the
@@ -313,6 +313,61 @@ static int __init _omap2_init_reprogram_sdrc(void)
 	return v;
 }
 
+static struct omap_device_pm_latency *pm_lats;
+
+static struct device *mpu_dev;
+static struct device *dsp_dev;
+static struct device *l3_dev;
+
+struct device *omap_get_mpuss_device(void)
+{
+	WARN_ON_ONCE(!mpu_dev);
+	return mpu_dev;
+}
+
+struct device *omap_get_dsp_device(void)
+{
+	WARN_ON_ONCE(!dsp_dev);
+	return dsp_dev;
+}
+
+struct device *omap_get_l3_device(void)
+{
+	WARN_ON_ONCE(!l3_dev);
+	return l3_dev;
+}
+
+/* static int _init_omap_device(struct omap_hwmod *oh, void *user) */
+static int _init_omap_device(char *name, struct device **new_dev)

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 351

Quoted 10 lines
arch/arm/mach-omap2/io.c +10 -0
+{
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+
+	oh = omap_hwmod_lookup(name);
+	if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
+		 __func__, name))
+		return -ENODEV;
+
+	od = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, true);

[Tarun Kanti DebBarma]
I am new to hwmod and just trying to catch up. In omap_device_build(...) we anyway pass (oh) and so why also pass (oh->name)? If so we can reduce a parameter.

Quoted 52 lines
arch/arm/mach-omap2/io.c +20 -0
+	if (WARN(IS_ERR(od), "%s: could not build omap_device for %s\n",
+		 __func__, name))
+		return -ENODEV;
+
+	*new_dev = &od->pdev.dev;
+
+	return 0;
+}
+
+/*
+ * Build omap_devices for processors and bus.
+ */
+static void omap_init_processor_devices(void)
+{
+	_init_omap_device("mpu", &mpu_dev);
+	_init_omap_device("iva", &dsp_dev);
+	_init_omap_device("l3_main", &l3_dev);
+}
+
 void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 				 struct omap_sdrc_params *sdrc_cs1)
 {
@@ -342,6 +397,7 @@ void __init omap2_init_common_hw(struct
 omap_sdrc_params *sdrc_cs0,
 	omap_serial_early_init();
 	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
 		omap_hwmod_late_init();
+	omap_init_processor_devices();
 	omap_pm_if_init();
 	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
arch/arm/mach-omap2/io.c +0 -0
 		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
arch/arm/plat- renamed from arch/arm/plat-omap/include/plat/common.h +0 -0

omap/include/plat/common.h
index d265018..9cdd9cd 100644

arch/arm/plat-omap/include/plat/common.h +4 -1
@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *);
 	}							\
 })
 
+struct device *omap_get_mpuss_device(void);
+struct device *omap_get_dsp_device(void);
+struct device *omap_get_l3_device(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
--

1.7.0.2

--
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

#16 lore raw

Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

In reply to Kevin Hilman
Quoted 7 lines · Kevin Hilman

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

So that these primary devices are available for early PM initialization, they are created as early platform_devices.

I've reworked this patch so that it is no longer using early devices, updated version below.

This requires delaying some other PM init as well (OMAP PM layer, OPP layer etc.) so a common_pm_init() function was created and initialized as a device_initcall().

My pm-hwmods branch has been updated with this version, and the PM branch now has corresponding changes to the SR/voltage layers to initialize them as device_initcalls as well.

Kevin

Quoted 1 line

From 5180e0c52509fcf30ad92503b817326856231efb Mon Sep 17 00:00:00 2001

From: Kevin Hilman <[email protected]>
Date: Mon, 21 Jun 2010 10:53:13 -0700
Subject: [PATCH] OMAP: create omap_devices for MPU, DSP, L3

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

Also, move these common PM init functions into a common_pm_init call that is called as a device_initcall(). The PM init is done at this level to ensure that the driver core is initialized before initialized.

---
 arch/arm/mach-omap2/devices.c            |    2 +
 arch/arm/mach-omap2/io.c                 |   67 +++++++++++++++++++++++++++++-
 arch/arm/plat-omap/include/plat/common.h |    4 ++
 3 files changed, 71 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/devices.c +2 -0
index 03e6c9e..62920ac 100644
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -29,6 +30,7 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 
arch/arm/mach-omap2/io.c +65 -2

85 lines not on this page · raw message

arch/arm/plat-omap/include/plat/common.h +4 -0
index d265018..9cdd9cd 100644
@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *);
 	}							\
 })
 
+struct device *omap_get_mpuss_device(void);
+struct device *omap_get_dsp_device(void);
+struct device *omap_get_l3_device(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
Signature · 1 line
1.7.1
#17 lore raw

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 147 lines
Quoted 147 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Tuesday, June 29, 2010 11:00 PM
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 7 lines · Kevin Hilman

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

So that these primary devices are available for early PM initialization, they are created as early platform_devices.

I've reworked this patch so that it is no longer using early devices, updated version below.

This requires delaying some other PM init as well (OMAP PM layer, OPP layer etc.) so a common_pm_init() function was created and initialized as a device_initcall().

My pm-hwmods branch has been updated with this version, and the PM branch now has corresponding changes to the SR/voltage layers to initialize them as device_initcalls as well.

Kevin

From 5180e0c52509fcf30ad92503b817326856231efb Mon Sep 17 00:00:00 2001
From: Kevin Hilman <[email protected]>
Date: Mon, 21 Jun 2010 10:53:13 -0700
Subject: [PATCH] OMAP: create omap_devices for MPU, DSP, L3

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

Also, move these common PM init functions into a common_pm_init call that is called as a device_initcall(). The PM init is done at this level to ensure that the driver core is initialized before initialized.

---

arch/arm/mach-omap2/devices.c            |    2 +
arch/arm/mach-omap2/io.c                 |   67 +++++++++++++++++++++++++++++-
arch/arm/plat-omap/include/plat/common.h |    4 ++
3 files changed, 71 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/devices.c +2 -0
index 03e6c9e..62920ac 100644
@@ -15,6 +15,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/err.h>
 
 #include <mach/hardware.h>
 #include <mach/irqs.h>
@@ -29,6 +30,7 @@
 #include <mach/gpio.h>
 #include <plat/mmc.h>
 #include <plat/dma.h>
+#include <plat/omap_device.h>
 
 #include "mux.h"
 
arch/arm/mach-omap2/io.c +56 -1
index 3cfb425..f406fac 100644
@@ -45,7 +45,7 @@
 
 #include <plat/clockdomain.h>
 #include "clockdomains.h"
-#include <plat/omap_hwmod.h>
+#include <plat/omap_device.h>
 
 /*
 * The machine specific code may provide the extra mapping besides the
@@ -313,6 +313,70 @@ static int __init _omap2_init_reprogram_sdrc(void)
 	return v;
 }
 
+static struct omap_device_pm_latency *pm_lats;
+
+static struct device *mpu_dev;
+static struct device *dsp_dev;
+static struct device *l3_dev;
+
+struct device *omap_get_mpuss_device(void)
+{
+	WARN_ON_ONCE(!mpu_dev);
+	return mpu_dev;
+}
+
+struct device *omap_get_dsp_device(void)
+{
+	WARN_ON_ONCE(!dsp_dev);
+	return dsp_dev;
+}
+
+struct device *omap_get_l3_device(void)
+{
+	WARN_ON_ONCE(!l3_dev);
+	return l3_dev;
+}
+
+/* static int _init_omap_device(struct omap_hwmod *oh, void *user) */
+static int _init_omap_device(char *name, struct device **new_dev)
+{
+	struct omap_hwmod *oh;
+	struct omap_device *od;
+
+	oh = omap_hwmod_lookup(name);
+	if (WARN(!oh, "%s: could not find omap_hwmod for %s\n",
+		 __func__, name))
+		return -ENODEV;
+
+	od = omap_device_build(oh->name, 0, oh, NULL, 0, pm_lats, 0, false);
+	if (WARN(IS_ERR(od), "%s: could not build omap_device for %s\n",
+		 __func__, name))
+		return -ENODEV;
+
+	*new_dev = &od->pdev.dev;
+
+	return 0;
+}
+
+/*
+ * Build omap_devices for processors and bus.
+ */
+static void omap_init_processor_devices(void)
+{
+	_init_omap_device("mpu", &mpu_dev);
+	_init_omap_device("iva", &dsp_dev);
+	_init_omap_device("l3_main", &l3_dev);
+}
+
Quoted 8 lines

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 378

Quoted 8 lines
arch/arm/mach-omap2/io.c +8 -0
+static int __init omap_common_pm_init(void)
+{
+	omap_init_processor_devices();
+	omap_pm_if_init();
+
+	return 0;
+}
+device_initcall(omap_common_pm_init);

Kevin,

But I guess opp layer is still getting initialized before this. Esp if the board files are initializing the opp structures. Or do you have a patch to fix it in some other branch ?

Regards,
Thara

Quoted 32 lines
Quoted 32 lines
arch/arm/mach-omap2/io.c +1 -1
+
 void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 				 struct omap_sdrc_params *sdrc_cs1)
 {
@@ -342,7 +406,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 	omap_serial_early_init();
 	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
 		omap_hwmod_late_init();
-	omap_pm_if_init();
 	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
 		_omap2_init_reprogram_sdrc();
arch/arm/plat-omap/include/plat/common.h +4 -1
index d265018..9cdd9cd 100644
@@ -87,4 +87,8 @@ void omap2_set_globals_uart(struct omap_globals *);
 	}							\
 })
 
+struct device *omap_get_mpuss_device(void);
+struct device *omap_get_dsp_device(void);
+struct device *omap_get_l3_device(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
--

1.7.1

--
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

#18 lore raw

Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

"Gopinath, Thara" <[email protected]> writes:

[...]

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
arch/arm/mach-omap2/io.c +5 -0
+static int __init omap_common_pm_init(void)
+{
+	omap_init_processor_devices();
+	omap_pm_if_init();
+
Quoted 9 lines
Quoted 3 lines

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 378

Quoted 3 lines
arch/arm/mach-omap2/io.c +3 -0
+	return 0;
+}
+device_initcall(omap_common_pm_init);

But I guess opp layer is still getting initialized before this. Esp if the board files are initializing the opp structures. Or do you have a patch to fix it in some other branch ?

The common OPP init will be done in this function as well (see current PM branch.) Board files no longer do OPP init (by default) as it is handled by common code. Only boards that add OPPs need to call the init function, and we'll have to figure out way to handle that late.

Kevin

#19 lore raw

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 28 lines
Quoted 28 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, July 01, 2010 2:09 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

"Gopinath, Thara" <[email protected]> writes:

[...]

Quoted 14 lines
Quoted 8 lines

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 378

Quoted 8 lines
arch/arm/mach-omap2/io.c +8 -0
+static int __init omap_common_pm_init(void)
+{
+	omap_init_processor_devices();
+	omap_pm_if_init();
+
+	return 0;
+}
+device_initcall(omap_common_pm_init);

But I guess opp layer is still getting initialized before this. Esp if the board files are initializing the opp structures. Or do you have a patch to fix it in some other branch ?

Quoted 4 lines
Quoted 4 lines

The common OPP init will be done in this function as well (see current PM branch.) Board files no longer do OPP init (by default) as it is handled by common code. Only boards that add OPPs need to call the init function, and we'll have to figure out way to handle that late.

Yes you are correct. The common OPP init is done in this function. One other thing I am a bit worried about is the order of initializations. The order should be
Opp layer
Voltage layer
Smartreflex device layer.

Presently all three layers are device_initcalls. The sequence is maintained due to the way these drivers are compiled in. We need to make them work independent of the way the drivers are compiled. One way is to have the omap_common_pm_init call into the inits of all these layers sequentially and
remove the separate init calls. Any other suggestion anyone?

Kevin, by the way your latest pm-sr branch with the above changes works. I tested it yesterday.

Regards
Thara

#20 lore raw

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 48 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Gopinath, Thara
Sent: Thursday, July 01, 2010 9:35 AM
To: Kevin Hilman
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 26 lines
Quoted 26 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, July 01, 2010 2:09 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

"Gopinath, Thara" <[email protected]> writes:

[...]

Quoted 14 lines
Quoted 8 lines

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 378

Quoted 8 lines
arch/arm/mach-omap2/io.c +8 -0
+static int __init omap_common_pm_init(void)
+{
+	omap_init_processor_devices();
+	omap_pm_if_init();
+
+	return 0;
+}
+device_initcall(omap_common_pm_init);

But I guess opp layer is still getting initialized before this. Esp if the board files are initializing the opp structures. Or do you have a patch to fix it in some other branch ?

Quoted 4 lines
Quoted 4 lines

The common OPP init will be done in this function as well (see current PM branch.) Board files no longer do OPP init (by default) as it is handled by common code. Only boards that add OPPs need to call the init function, and we'll have to figure out way to handle that late.

Yes you are correct. The common OPP init is done in this function. One other thing I am a bit worried about is the order of initializations. The order should be
Opp layer
Voltage layer
Smartreflex device layer.

Quoted 7 lines

Presently all three layers are device_initcalls. The sequence is maintained due to the way these drivers are compiled in. We need to make them work independent of the way the drivers are compiled. One way is to have the omap_common_pm_init call into the inits of all these layers sequentially and
remove the separate init calls. Any other suggestion anyone?

Grouping the initcalls is good idea but with this you can never be able to build any of these as loadable modules.
This is valid only if any of above you plan to build as loadable module

Quoted 9 lines

Kevin, by the way your latest pm-sr branch with the above changes works. I tested it yesterday.

Regards
Thara
--
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

#21 lore raw

RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 64 lines
Quoted 64 lines

-----Original Message-----
From: Shilimkar, Santosh
Sent: Thursday, July 01, 2010 9:46 AM
To: Gopinath, Thara; Kevin Hilman
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 55 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Gopinath, Thara
Sent: Thursday, July 01, 2010 9:35 AM
To: Kevin Hilman
Cc: [email protected]; [email protected]
Subject: RE: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Quoted 26 lines
Quoted 26 lines

-----Original Message-----
From: Kevin Hilman [mailto:[email protected]]
Sent: Thursday, July 01, 2010 2:09 AM
To: Gopinath, Thara
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

"Gopinath, Thara" <[email protected]> writes:

[...]

Quoted 14 lines
Quoted 8 lines

arch/arm/mach-omap2/io.c static int __init _omap2_init_reprogram_sdrc(void) · line 378

Quoted 8 lines
arch/arm/mach-omap2/io.c +8 -0
+static int __init omap_common_pm_init(void)
+{
+	omap_init_processor_devices();
+	omap_pm_if_init();
+
+	return 0;
+}
+device_initcall(omap_common_pm_init);

But I guess opp layer is still getting initialized before this. Esp if the board files are initializing the opp structures. Or do you have a patch to fix it in some other branch ?

Quoted 4 lines
Quoted 4 lines

The common OPP init will be done in this function as well (see current PM branch.) Board files no longer do OPP init (by default) as it is handled by common code. Only boards that add OPPs need to call the init function, and we'll have to figure out way to handle that late.

Yes you are correct. The common OPP init is done in this function. One other thing I am a bit worried about is the order of initializations. The order should be
Opp layer
Voltage layer
Smartreflex device layer.

Presently all three layers are device_initcalls. The sequence is maintained due to the way these drivers are compiled in. We need to make them work independent of the way the drivers are compiled. One way is to have the omap_common_pm_init call into the inits of all these layers sequentially and
remove the separate init calls. Any other suggestion anyone?

Quoted 3 lines
Quoted 3 lines

Grouping the initcalls is good idea but with this you can never be able to build any of these as loadable modules.
This is valid only if any of above you plan to build as loadable module

I do not think we need to build voltage, opp and smartreflex as modules. I would consider them as system critical layers and should be part of the basic kernel. Do you see a use case where these layers need to be modules? Also all these layers are stand alone libraries. Not registered with any bus or anything. So we will have to do some work if we need to load them as modules.

Regards
Thara

maintainer
#22 lore raw

Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

In reply to Kevin Hilman

Hi,

Quoted 13 lines · Kevin Hilman
Quoted 7 lines · Kevin Hilman

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

So that these primary devices are available for early PM initialization, they are created as early platform_devices.

I've reworked this patch so that it is no longer using early devices, updated version below.

Quoted 7 lines

This requires delaying some other PM init as well (OMAP PM layer, OPP layer etc.) so a common_pm_init() function was created and initialized as a device_initcall().

My pm-hwmods branch has been updated with this version, and the PM branch now has corresponding changes to the SR/voltage layers to initialize them as device_initcalls as well.

Thanks for these changes, this seems better than the early_platform_device approach. I've made a few more changes:

- the newly-created functions have been moved to a new file, mach-omap2/pm.c. I'm not convinced that this file is the right place for these functions either, but it didn't make sense to me to create these functions in mach-omap2/io.c;

- the functions have been renamed to start with "omap2" to indicate that they are OMAP2+-only functions;

- sparse warnings have been resolved.

Revised patch below.

- Paul

OMAP: PM: create omap_devices for MPU, DSP, L3

From: Kevin Hilman <[email protected]>

Create simple omap_devices for the main processors and busses.

This is required to support the forth-coming device-based OPP approach, where OPPs are managed and tracked at the device level.

Also, move these common PM init functions into a common_pm_init call that is called as a device_initcall(). The PM init is done at this level to ensure that the driver core is initialized before initialized.

[[email protected]: sparse warnings cleaned up; newly-created functions moved
from mach-omap2/io.c to mach-omap2/pm.c; newly-created functions renamed to start with "omap2" rather than "omap"]

---
 arch/arm/mach-omap2/Makefile             |    2 -
 arch/arm/mach-omap2/io.c                 |    2 -
 arch/arm/mach-omap2/pm.c                 |   84 ++++++++++++++++++++++++++++++
 arch/arm/plat-omap/include/plat/common.h |    4 +
 4 files changed, 90 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/mach-omap2/pm.c
arch/arm/mach-omap2/Makefile +1 -1
index 2fa3418..213f1df 100644
@@ -3,7 +3,7 @@
 #
 
 # Common support
-obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o
+obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o
 
 omap-2-3-common				= irq.o sdrc.o
 hwmod-common				= omap_hwmod.o \
arch/arm/mach-omap2/io.c +1 -1
index 05c9cdb..2b983ac 100644
@@ -44,6 +44,7 @@
 
 #include <plat/clockdomain.h>
 #include "clockdomains.h"
+
 #include <plat/omap_hwmod.h>
 
 /*
@@ -346,7 +347,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
 		omap_hwmod_late_init(skip_setup_idle);
 
-	omap_pm_if_init();
 	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
 		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
 		_omap2_init_reprogram_sdrc();
arch/arm/mach-omap2/pm.c new file +84 -0

84 lines not on this page · raw message

arch/arm/plat-omap/include/plat/common.h +4 -0
index 5e4afbe..5cf9509 100644
@@ -89,4 +89,8 @@ void omap2_set_globals_uart(struct omap_globals *);
 	}							\
 })
 
+extern struct device *omap2_get_mpuss_device(void);
+extern struct device *omap2_get_dsp_device(void);
+extern struct device *omap2_get_l3_device(void);
+
 #endif /* __ARCH_ARM_MACH_OMAP_COMMON_H */
maintainer
#23 lore raw

Re: [PATCH v2 10/13] OMAP: create omap_devices for MPU, DSP, L3

Hi,

Quoted 11 lines · Paul Walmsley
Quoted 6 lines · Kevin Hilman
Quoted 1 line · Kevin Hilman

Create simple omap_devices for the main processors and busses.

I've reworked this patch so that it is no longer using early devices, updated version below.

Thanks for these changes, this seems better than the early_platform_device approach. I've made a few more changes:

Just FYI, after this patch, 2420 platforms (and presumably 2430 platforms also) emit this warning on boot:

[    0.057067] WARNING: at arch/arm/mach-omap2/pm.c:53 _init_omap_device+0x80/0xa0()
[    0.057098] _init_omap_device: could not find omap_hwmod for iva
[    0.057128] Modules linked in:
[    0.057189] [<c002a580>] (unwind_backtrace+0x0/0xec) from [<c004a084>] (warn_slowpath_common+0x4c/0x64)
[    0.057250] [<c004a084>] (warn_slowpath_common+0x4c/0x64) from [<c004a11c>] (warn_slowpath_fmt+0x2c/0x3)
[    0.057342] [<c004a11c>] (warn_slowpath_fmt+0x2c/0x3c) from [<c002ef90>] (_init_omap_device+0x80/0xa0)
[    0.057403] [<c002ef90>] (_init_omap_device+0x80/0xa0) from [<c000e360>] (omap2_common_pm_init+0x20/0x4)
[    0.057495] [<c000e360>] (omap2_common_pm_init+0x20/0x48) from [<c0024384>] (do_one_initcall+0x5c/0x1b4)
[    0.057556] [<c0024384>] (do_one_initcall+0x5c/0x1b4) from [<c00083f8>] (kernel_init+0x90/0x144)
[    0.057647] [<c00083f8>] (kernel_init+0x90/0x144) from [<c0025dd0>] (kernel_thread_exit+0x0/0x8)
[    0.057708] ---[ end trace dec6997083161631 ]---

This appears to be due to the lack of an IVA hwmod for 2420/2430, so I've added one based on Benoît's patch for 3xxx (below). This fixes the warnings.

- Paul

OMAP2: hwmod data: add IVA1 (2420), IVA2 (2430) hwmods

From: Paul Walmsley <[email protected]>

Add IVA1 hwmod data for OMAP2420 and IVA2 hwmod data for 2430. The data is based on Benoît Cousson's hwmod data for the OMAP3 IVA blocks.

Cc Benoît Cousson <[email protected]>
Cc Kevin Hilman <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   30 ++++++++++++++++++++++++++
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   32 ++++++++++++++++++++++++++--
 2 files changed, 60 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +30 -0
index 8c90b27..3cc768e 100644
@@ -30,6 +30,7 @@
  */
 
 static struct omap_hwmod omap2420_mpu_hwmod;
+static struct omap_hwmod omap2420_iva_hwmod;
 static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
 
@@ -136,11 +137,40 @@ static struct omap_hwmod omap2420_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 };
 
+/*
+ * IVA1 interface data
+ */
+
+/* IVA <- L3 interface */
+static struct omap_hwmod_ocp_if omap2420_l3__iva = {
+	.master		= &omap2420_l3_main_hwmod,
+	.slave		= &omap2420_iva_hwmod,
+	.clk		= "iva1_ifck",
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap2420_iva_masters[] = {
+	&omap2420_l3__iva,
+};
+
+/*
+ * IVA2 (IVA2)
+ */
+
+static struct omap_hwmod omap2420_iva_hwmod = {
+	.name		= "iva",
+	.class		= &iva_hwmod_class,
+	.masters	= omap2420_iva_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2420_iva_masters),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420)
+};
+
 static __initdata struct omap_hwmod *omap2420_hwmods[] = {
 	&omap2420_l3_main_hwmod,
 	&omap2420_l4_core_hwmod,
 	&omap2420_l4_wkup_hwmod,
 	&omap2420_mpu_hwmod,
+	&omap2420_iva_hwmod,
 	NULL,
 };
 
arch/arm/mach-omap2/omap_hwmod_2430_data.c +30 -2
index c0f3311..4526628 100644
@@ -30,6 +30,7 @@
  */
 
 static struct omap_hwmod omap2430_mpu_hwmod;
+static struct omap_hwmod omap2430_iva_hwmod;
 static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
 
@@ -70,8 +71,6 @@ static struct omap_hwmod omap2430_l3_main_hwmod = {
 };
 
 static struct omap_hwmod omap2430_l4_wkup_hwmod;
-static struct omap_hwmod omap2430_mmc1_hwmod;
-static struct omap_hwmod omap2430_mmc2_hwmod;
 
 /* L4_CORE -> L4_WKUP interface */
 static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
@@ -138,11 +137,40 @@ static struct omap_hwmod omap2430_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 };
 
+/*
+ * IVA2_1 interface data
+ */
+
+/* IVA2 <- L3 interface */
+static struct omap_hwmod_ocp_if omap2430_l3__iva = {
+	.master		= &omap2430_l3_main_hwmod,
+	.slave		= &omap2430_iva_hwmod,
+	.clk		= "dsp_fck",
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap2430_iva_masters[] = {
+	&omap2430_l3__iva,
+};
+
+/*
+ * IVA2 (IVA2)
+ */
+
+static struct omap_hwmod omap2430_iva_hwmod = {
+	.name		= "iva",
+	.class		= &iva_hwmod_class,
+	.masters	= omap2430_iva_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2430_iva_masters),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)
+};
+
 static __initdata struct omap_hwmod *omap2430_hwmods[] = {
 	&omap2430_l3_main_hwmod,
 	&omap2430_l4_core_hwmod,
 	&omap2430_l4_wkup_hwmod,
 	&omap2430_mpu_hwmod,
+	&omap2430_iva_hwmod,
 	NULL,
 };
 
#24 lore raw

PATCH v2 11/13 OMAP: hwmod data: add class for IVA hwmods

In reply to Kevin Hilman

Add a new hwmod class for IVA devices. To be used when hwmods are created for IVA2 on OMAP3.

---
 arch/arm/mach-omap2/omap_hwmod_common_data.c |    3 +++
 arch/arm/mach-omap2/omap_hwmod_common_data.h |    1 +
 2 files changed, 4 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_common_data.c +3 -0
index 1e80b91..08a1342 100644
@@ -66,3 +66,6 @@ struct omap_hwmod_class mpu_hwmod_class = {
 	.name = "mpu"
 };
 
+struct omap_hwmod_class iva_hwmod_class = {
+	.name = "iva"
+};
arch/arm/mach-omap2/omap_hwmod_common_data.h +1 -0
index 3645a28..c34e98b 100644
@@ -20,5 +20,6 @@
 extern struct omap_hwmod_class l3_hwmod_class;
 extern struct omap_hwmod_class l4_hwmod_class;
 extern struct omap_hwmod_class mpu_hwmod_class;
+extern struct omap_hwmod_class iva_hwmod_class;
 
 #endif
Signature · 1 line
1.7.0.2
#25 lore raw

PATCH v2 12/13 OMAP2&3: hwmod: Replace l3 -> l3_main

In reply to Kevin Hilman

Replace all the struct that contain l3 with l3_main in order to be consistent with the OMAP4 naming convention.

---
 arch/arm/mach-omap2/omap_hwmod_2420_data.c |   34 +++++++++++-----------
 arch/arm/mach-omap2/omap_hwmod_2430_data.c |   34 +++++++++++-----------
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   42 ++++++++++++++--------------
 3 files changed, 55 insertions(+), 55 deletions(-)
arch/arm/mach-omap2/omap_hwmod_2420_data.c +17 -17
index 646386c..8c90b27 100644
@@ -30,41 +30,41 @@
  */
 
 static struct omap_hwmod omap2420_mpu_hwmod;
-static struct omap_hwmod omap2420_l3_hwmod;
+static struct omap_hwmod omap2420_l3_main_hwmod;
 static struct omap_hwmod omap2420_l4_core_hwmod;
 
 /* L3 -> L4_CORE interface */
-static struct omap_hwmod_ocp_if omap2420_l3__l4_core = {
-	.master	= &omap2420_l3_hwmod,
+static struct omap_hwmod_ocp_if omap2420_l3_main__l4_core = {
+	.master	= &omap2420_l3_main_hwmod,
 	.slave	= &omap2420_l4_core_hwmod,
 	.user	= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
 /* MPU -> L3 interface */
-static struct omap_hwmod_ocp_if omap2420_mpu__l3 = {
+static struct omap_hwmod_ocp_if omap2420_mpu__l3_main = {
 	.master = &omap2420_mpu_hwmod,
-	.slave	= &omap2420_l3_hwmod,
+	.slave	= &omap2420_l3_main_hwmod,
 	.user	= OCP_USER_MPU,
 };
 
 /* Slave interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l3_slaves[] = {
-	&omap2420_mpu__l3,
+static struct omap_hwmod_ocp_if *omap2420_l3_main_slaves[] = {
+	&omap2420_mpu__l3_main,
 };
 
 /* Master interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2420_l3_masters[] = {
-	&omap2420_l3__l4_core,
+static struct omap_hwmod_ocp_if *omap2420_l3_main_masters[] = {
+	&omap2420_l3_main__l4_core,
 };
 
 /* L3 */
-static struct omap_hwmod omap2420_l3_hwmod = {
+static struct omap_hwmod omap2420_l3_main_hwmod = {
 	.name		= "l3_main",
 	.class		= &l3_hwmod_class,
-	.masters	= omap2420_l3_masters,
-	.masters_cnt	= ARRAY_SIZE(omap2420_l3_masters),
-	.slaves		= omap2420_l3_slaves,
-	.slaves_cnt	= ARRAY_SIZE(omap2420_l3_slaves),
+	.masters	= omap2420_l3_main_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2420_l3_main_masters),
+	.slaves		= omap2420_l3_main_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2420_l3_main_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),
 	.flags		= HWMOD_NO_IDLEST,
 };
@@ -80,7 +80,7 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = {
 
 /* Slave interfaces on the L4_CORE interconnect */
 static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = {
-	&omap2420_l3__l4_core,
+	&omap2420_l3_main__l4_core,
 };
 
 /* Master interfaces on the L4_CORE interconnect */
@@ -123,7 +123,7 @@ static struct omap_hwmod omap2420_l4_wkup_hwmod = {
 
 /* Master interfaces on the MPU device */
 static struct omap_hwmod_ocp_if *omap2420_mpu_masters[] = {
-	&omap2420_mpu__l3,
+	&omap2420_mpu__l3_main,
 };
 
 /* MPU */
@@ -137,7 +137,7 @@ static struct omap_hwmod omap2420_mpu_hwmod = {
 };
 
 static __initdata struct omap_hwmod *omap2420_hwmods[] = {
-	&omap2420_l3_hwmod,
+	&omap2420_l3_main_hwmod,
 	&omap2420_l4_core_hwmod,
 	&omap2420_l4_wkup_hwmod,
 	&omap2420_mpu_hwmod,
arch/arm/mach-omap2/omap_hwmod_2430_data.c +17 -17
index b2100cf..c0f3311 100644
@@ -30,41 +30,41 @@
  */
 
 static struct omap_hwmod omap2430_mpu_hwmod;
-static struct omap_hwmod omap2430_l3_hwmod;
+static struct omap_hwmod omap2430_l3_main_hwmod;
 static struct omap_hwmod omap2430_l4_core_hwmod;
 
 /* L3 -> L4_CORE interface */
-static struct omap_hwmod_ocp_if omap2430_l3__l4_core = {
-	.master	= &omap2430_l3_hwmod,
+static struct omap_hwmod_ocp_if omap2430_l3_main__l4_core = {
+	.master	= &omap2430_l3_main_hwmod,
 	.slave	= &omap2430_l4_core_hwmod,
 	.user	= OCP_USER_MPU | OCP_USER_SDMA,
 };
 
 /* MPU -> L3 interface */
-static struct omap_hwmod_ocp_if omap2430_mpu__l3 = {
+static struct omap_hwmod_ocp_if omap2430_mpu__l3_main = {
 	.master = &omap2430_mpu_hwmod,
-	.slave	= &omap2430_l3_hwmod,
+	.slave	= &omap2430_l3_main_hwmod,
 	.user	= OCP_USER_MPU,
 };
 
 /* Slave interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l3_slaves[] = {
-	&omap2430_mpu__l3,
+static struct omap_hwmod_ocp_if *omap2430_l3_main_slaves[] = {
+	&omap2430_mpu__l3_main,
 };
 
 /* Master interfaces on the L3 interconnect */
-static struct omap_hwmod_ocp_if *omap2430_l3_masters[] = {
-	&omap2430_l3__l4_core,
+static struct omap_hwmod_ocp_if *omap2430_l3_main_masters[] = {
+	&omap2430_l3_main__l4_core,
 };
 
 /* L3 */
-static struct omap_hwmod omap2430_l3_hwmod = {
+static struct omap_hwmod omap2430_l3_main_hwmod = {
 	.name		= "l3_main",
 	.class		= &l3_hwmod_class,
-	.masters	= omap2430_l3_masters,
-	.masters_cnt	= ARRAY_SIZE(omap2430_l3_masters),
-	.slaves		= omap2430_l3_slaves,
-	.slaves_cnt	= ARRAY_SIZE(omap2430_l3_slaves),
+	.masters	= omap2430_l3_main_masters,
+	.masters_cnt	= ARRAY_SIZE(omap2430_l3_main_masters),
+	.slaves		= omap2430_l3_main_slaves,
+	.slaves_cnt	= ARRAY_SIZE(omap2430_l3_main_slaves),
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430),
 	.flags		= HWMOD_NO_IDLEST,
 };
@@ -82,7 +82,7 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = {
 
 /* Slave interfaces on the L4_CORE interconnect */
 static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = {
-	&omap2430_l3__l4_core,
+	&omap2430_l3_main__l4_core,
 };
 
 /* Master interfaces on the L4_CORE interconnect */
@@ -125,7 +125,7 @@ static struct omap_hwmod omap2430_l4_wkup_hwmod = {
 
 /* Master interfaces on the MPU device */
 static struct omap_hwmod_ocp_if *omap2430_mpu_masters[] = {
-	&omap2430_mpu__l3,
+	&omap2430_mpu__l3_main,
 };
 
 /* MPU */
@@ -139,7 +139,7 @@ static struct omap_hwmod omap2430_mpu_hwmod = {
 };
 
 static __initdata struct omap_hwmod *omap2430_hwmods[] = {
-	&omap2430_l3_hwmod,
+	&omap2430_l3_main_hwmod,
 	&omap2430_l4_core_hwmod,
 	&omap2430_l4_wkup_hwmod,
 	&omap2430_mpu_hwmod,
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +21 -21

99 lines not on this page · raw message

Signature · 1 line
1.7.0.2
#26 lore raw

PATCH v2 13/13 OMAP3: hwmod data: add data for OMAP3 IVA2

In reply to Kevin Hilman

Add hwmod data for IVA2 module on OMAP3.

Naming of "iva" instead of "iva2" to be aligned with OMAP4 naming done by Benoit Cousson.

Cc Paul Walmsley <[email protected]>
Cc Benoit Cousson <[email protected]>
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c |   30 ++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +30 -0
index 9d9cfb9..d3bf85b 100644
@@ -32,6 +32,7 @@
  */
 
 static struct omap_hwmod omap3xxx_mpu_hwmod;
+static struct omap_hwmod omap3xxx_iva_hwmod;
 static struct omap_hwmod omap3xxx_l3_main_hwmod;
 static struct omap_hwmod omap3xxx_l4_core_hwmod;
 static struct omap_hwmod omap3xxx_l4_per_hwmod;
@@ -168,12 +169,41 @@ static struct omap_hwmod omap3xxx_mpu_hwmod = {
 	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430),
 };
 
+/*
+ * IVA2_2 interface data
+ */
+
+/* IVA2 <- L3 interface */
+static struct omap_hwmod_ocp_if omap3xxx_l3__iva = {
+	.master		= &omap3xxx_l3_main_hwmod,
+	.slave		= &omap3xxx_iva_hwmod,
+	.clk		= "iva2_ck",
+	.user		= OCP_USER_MPU | OCP_USER_SDMA,
+};
+
+static struct omap_hwmod_ocp_if *omap3xxx_iva_masters[] = {
+	&omap3xxx_l3__iva,
+};
+
+/*
+ * IVA2 (IVA2)
+ */
+
+static struct omap_hwmod omap3xxx_iva_hwmod = {
+	.name		= "iva",
+	.class          = &iva_hwmod_class,
+	.masters	= omap3xxx_iva_masters,
+	.masters_cnt	= ARRAY_SIZE(omap3xxx_iva_masters),
+	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430)
+};
+
 static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {
 	&omap3xxx_l3_main_hwmod,
 	&omap3xxx_l4_core_hwmod,
 	&omap3xxx_l4_per_hwmod,
 	&omap3xxx_l4_wkup_hwmod,
 	&omap3xxx_mpu_hwmod,
+	&omap3xxx_iva_hwmod,
 	NULL,
 };
 
Signature · 1 line
1.7.0.2
maintainer
#27 lore raw
In reply to Kevin Hilman

Hi,

Quoted 3 lines · Kevin Hilman

This is a series of fixes & updates mostly to hwmod and omap_device that are required for the on-going hwmod conversions and runtime PM conversion of drivers.

I've taken patches 1, 3, 6, 11, 12, and 13 as-is; and handled the rest as per the mailing list comments on the individual patches.

Thanks Kevin,

- Paul