public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fixes for broken PM init with multi-OMAP
@ 2010-03-10 17:16 Kevin Hilman
  2010-03-10 17:16 ` [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of unused code Kevin Hilman
  2010-03-10 17:16 ` [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM Kevin Hilman
  0 siblings, 2 replies; 8+ messages in thread
From: Kevin Hilman @ 2010-03-10 17:16 UTC (permalink / raw)
  To: linux-omap

multi-OMAP builds are broken in various ways due to conditional code.
Here is a small series of fixes.

Build tested: omap3_defconfig, omap_4430sdp_defconfig
Boot tested: omap3_defconfig on OMAP3EVM
Boot tested: omap3_defconfig on OMAP3430SDP (Thanks, Santosh)
Boot tested: omap3_defconfig on OMAP4430SDP (Thanks, Santosh)

Applies on current l-o master branch.

Updates from RFC patch:
- removed 'FIXME' around conditional SDRC execution for OMAP4
  since OMAP4 has no SDRC.

Kevin Hilman (2):
  OMAP2: cpu_is_omap2*: fix compile-time removal of unused code.
  OMAP4: fix temporary hacks that break multi-omap PM

 arch/arm/mach-omap2/io.c              |   13 ++++++-------
 arch/arm/plat-omap/include/plat/cpu.h |    8 ++++++--
 2 files changed, 12 insertions(+), 9 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of unused code.
  2010-03-10 17:16 [PATCH 0/2] fixes for broken PM init with multi-OMAP Kevin Hilman
@ 2010-03-10 17:16 ` Kevin Hilman
  2010-03-11 22:12   ` [APPLIED] [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of Tony Lindgren
  2010-03-10 17:16 ` [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM Kevin Hilman
  1 sibling, 1 reply; 8+ messages in thread
From: Kevin Hilman @ 2010-03-10 17:16 UTC (permalink / raw)
  To: linux-omap

Currently if omap2420 is defined but not omap2430, cpu_is_omap2430()
is still defined as a macro, instead of #define'd to zero.  This
results in conditional cpu_is_omap2430() code still being compiled,
and leads to possible compile/link errors.  In particular for hwmod
init.

To fix, add extra #ifdefs to CPU check macros to ensure that the
is_omap* macros are zero for each OMAP2 if they are not configured
into the kernel.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/plat-omap/include/plat/cpu.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
index ed8786c..7514174 100644
--- a/arch/arm/plat-omap/include/plat/cpu.h
+++ b/arch/arm/plat-omap/include/plat/cpu.h
@@ -167,10 +167,14 @@ IS_OMAP_SUBCLASS(443x, 0x443)
 #if defined(MULTI_OMAP2)
 # if defined(CONFIG_ARCH_OMAP2)
 #  undef  cpu_is_omap24xx
-#  undef  cpu_is_omap242x
-#  undef  cpu_is_omap243x
 #  define cpu_is_omap24xx()		is_omap24xx()
+# endif
+# if defined (CONFIG_ARCH_OMAP2420)
+#  undef  cpu_is_omap242x
 #  define cpu_is_omap242x()		is_omap242x()
+# endif
+# if defined (CONFIG_ARCH_OMAP2430)
+#  undef  cpu_is_omap243x
 #  define cpu_is_omap243x()		is_omap243x()
 # endif
 # if defined(CONFIG_ARCH_OMAP3)
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
  2010-03-10 17:16 [PATCH 0/2] fixes for broken PM init with multi-OMAP Kevin Hilman
  2010-03-10 17:16 ` [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of unused code Kevin Hilman
@ 2010-03-10 17:16 ` Kevin Hilman
  2010-03-10 21:42   ` Tony Lindgren
  2010-03-11 22:12   ` [APPLIED] " Tony Lindgren
  1 sibling, 2 replies; 8+ messages in thread
From: Kevin Hilman @ 2010-03-10 17:16 UTC (permalink / raw)
  To: linux-omap

When building for multi-omap, and OMAP4 is enabled, CONFIG_ARCH_OMAP4
will be true and prevent included code from building/running for
OMAP2/3 as well.

This problem exists in io.c where some hwmod/PM/SDRC init code is
prevented from running even on OMAP2/3 when OMAP4 is included in a
multi-OMAP build.

A quick glance suggests that this #ifndef is no longer needed in most
of the cases.  In the remaining cases, the function is wrapped with
"if (cpu_is_omap24xx() || cpu_is_omap34xx())" which will be optimized
out for OMAP4-only builds.

Note that this is only a short-term fix.  Longer-term, OMAP4
needs to create init functions for SDRC and hwmod late-init.

Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/io.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
index 402e8f0..9742804 100644
--- a/arch/arm/mach-omap2/io.c
+++ b/arch/arm/mach-omap2/io.c
@@ -309,7 +309,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 {
 	pwrdm_init(powerdomains_omap);
 	clkdm_init(clockdomains_omap, clkdm_autodeps);
-#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */
 	if (cpu_is_omap242x())
 		omap2420_hwmod_init();
 	else if (cpu_is_omap243x())
@@ -319,7 +318,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 	omap2_mux_init();
 	/* The OPP tables have to be registered before a clk init */
 	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps);
-#endif
 
 	if (cpu_is_omap2420())
 		omap2420_clk_init();
@@ -333,11 +331,12 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 		pr_err("Could not init clock framework - unknown CPU\n");
 
 	omap_serial_early_init();
-#ifndef CONFIG_ARCH_OMAP4
-	omap_hwmod_late_init();
+	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */
+		omap_hwmod_late_init();
 	omap_pm_if_init();
-	omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
-	_omap2_init_reprogram_sdrc();
-#endif
+	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {
+		omap2_sdrc_init(sdrc_cs0, sdrc_cs1);
+		_omap2_init_reprogram_sdrc();
+	}
 	gpmc_init();
 }
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
  2010-03-10 17:16 ` [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM Kevin Hilman
@ 2010-03-10 21:42   ` Tony Lindgren
  2010-03-10 21:49     ` Kevin Hilman
  2010-03-11  5:12     ` Shilimkar, Santosh
  2010-03-11 22:12   ` [APPLIED] " Tony Lindgren
  1 sibling, 2 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-10 21:42 UTC (permalink / raw)
  To: Kevin Hilman; +Cc: linux-omap, Santosh Shilimkar

* Kevin Hilman <khilman@deeprootsystems.com> [100310 09:16]:
> When building for multi-omap, and OMAP4 is enabled, CONFIG_ARCH_OMAP4
> will be true and prevent included code from building/running for
> OMAP2/3 as well.
> 
> This problem exists in io.c where some hwmod/PM/SDRC init code is
> prevented from running even on OMAP2/3 when OMAP4 is included in a
> multi-OMAP build.
> 
> A quick glance suggests that this #ifndef is no longer needed in most
> of the cases.  In the remaining cases, the function is wrapped with
> "if (cpu_is_omap24xx() || cpu_is_omap34xx())" which will be optimized
> out for OMAP4-only builds.
> 
> Note that this is only a short-term fix.  Longer-term, OMAP4
> needs to create init functions for SDRC and hwmod late-init.

Good to get rid of the temporary hacks. Santosh, maybe grep
to see if there are other hacks left that can be now removed?

Regards,

Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
  2010-03-10 21:42   ` Tony Lindgren
@ 2010-03-10 21:49     ` Kevin Hilman
  2010-03-11  5:12     ` Shilimkar, Santosh
  1 sibling, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2010-03-10 21:49 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, Santosh Shilimkar

Tony Lindgren <tony@atomide.com> writes:

> * Kevin Hilman <khilman@deeprootsystems.com> [100310 09:16]:
[...]

>> Note that this is only a short-term fix.  Longer-term, OMAP4
>> needs to create init functions for SDRC and hwmod late-init.
>
> Good to get rid of the temporary hacks. Santosh, maybe grep
> to see if there are other hacks left that can be now removed?

Oops, I shoul've removed  last comment about SDRC init.  I think
the only thing missing is an OMAP4 hwmod init, which is work in
progress with the auto-generated hwmods.

Kevin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
  2010-03-10 21:42   ` Tony Lindgren
  2010-03-10 21:49     ` Kevin Hilman
@ 2010-03-11  5:12     ` Shilimkar, Santosh
  1 sibling, 0 replies; 8+ messages in thread
From: Shilimkar, Santosh @ 2010-03-11  5:12 UTC (permalink / raw)
  To: Tony Lindgren, Kevin Hilman; +Cc: linux-omap@vger.kernel.org

> -----Original Message-----
> From: Tony Lindgren [mailto:tony@atomide.com]
> Sent: Thursday, March 11, 2010 3:13 AM
> To: Kevin Hilman
> Cc: linux-omap@vger.kernel.org; Shilimkar, Santosh
> Subject: Re: [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
> 
> * Kevin Hilman <khilman@deeprootsystems.com> [100310 09:16]:
> > When building for multi-omap, and OMAP4 is enabled, CONFIG_ARCH_OMAP4
> > will be true and prevent included code from building/running for
> > OMAP2/3 as well.
> >
> > This problem exists in io.c where some hwmod/PM/SDRC init code is
> > prevented from running even on OMAP2/3 when OMAP4 is included in a
> > multi-OMAP build.
> >
> > A quick glance suggests that this #ifndef is no longer needed in most
> > of the cases.  In the remaining cases, the function is wrapped with
> > "if (cpu_is_omap24xx() || cpu_is_omap34xx())" which will be optimized
> > out for OMAP4-only builds.
> >
> > Note that this is only a short-term fix.  Longer-term, OMAP4
> > needs to create init functions for SDRC and hwmod late-init.
> 
> Good to get rid of the temporary hacks. Santosh, maybe grep
> to see if there are other hacks left that can be now removed?
> 
Tony,
We have almost cleaned up all the hacks in platform code 
except the one around ongoing hwmod work.

Will check if I have missed anything.

Regards,
Santosh

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [APPLIED] [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of
  2010-03-10 17:16 ` [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of unused code Kevin Hilman
@ 2010-03-11 22:12   ` Tony Lindgren
  0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 22:12 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-fixes

Initial commit ID (Likely to change): c9846244fa63adfa4930e35a1ee8bec02e0dd1b4

PatchWorks
http://patchwork.kernel.org/patch/84640/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=c9846244fa63adfa4930e35a1ee8bec02e0dd1b4



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [APPLIED]  [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM
  2010-03-10 17:16 ` [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM Kevin Hilman
  2010-03-10 21:42   ` Tony Lindgren
@ 2010-03-11 22:12   ` Tony Lindgren
  1 sibling, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2010-03-11 22:12 UTC (permalink / raw)
  To: linux-omap

This patch has been applied to the linux-omap
by youw fwiendly patch wobot.

Branch in linux-omap: omap-fixes

Initial commit ID (Likely to change): f5564bf423cb747c82101d397655216c9d98682f

PatchWorks
http://patchwork.kernel.org/patch/84641/

Git (Likely to change, and takes a while to get mirrored)
http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap-2.6.git;a=commit;h=f5564bf423cb747c82101d397655216c9d98682f



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-11 22:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-10 17:16 [PATCH 0/2] fixes for broken PM init with multi-OMAP Kevin Hilman
2010-03-10 17:16 ` [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of unused code Kevin Hilman
2010-03-11 22:12   ` [APPLIED] [PATCH 1/2] OMAP2: cpu_is_omap2*: fix compile-time removal of Tony Lindgren
2010-03-10 17:16 ` [PATCH 2/2] OMAP4: fix temporary hacks that break multi-omap PM Kevin Hilman
2010-03-10 21:42   ` Tony Lindgren
2010-03-10 21:49     ` Kevin Hilman
2010-03-11  5:12     ` Shilimkar, Santosh
2010-03-11 22:12   ` [APPLIED] " Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox