linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage
@ 2013-06-26 14:39 Nishanth Menon
  2013-06-26 14:39 ` [-next PATCH 1/2] ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4 Nishanth Menon
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nishanth Menon @ 2013-06-26 14:39 UTC (permalink / raw)
  To: Russell King, Tony Lindgren, Stephen Warren, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, linux-kernel, linux-omap, Arnd Bergmann,
	Nishanth Menon

Hi,

Cortex-A15 based OMAP5 does not use Snoop Control Unit(SCU)[1].
However, there is lot of code that is shared between Cortex-A9 based
OMAP4 and OMAP5, hence functionality code is shared with runtime usage
of SCU based on SoC worked on. However on building with OMAP5 only
generates the following errors:
arch/arm/mach-omap2/built-in.o: In function `scu_gp_set':
arch/arm/mach-omap2/sleep44xx.S:132: undefined reference to `scu_power_mode'
arch/arm/mach-omap2/built-in.o: In function `scu_gp_clear':
arch/arm/mach-omap2/sleep44xx.S:229: undefined reference to `scu_power_mode'
arch/arm/mach-omap2/built-in.o: In function `omap4_smp_init_cpus':
arch/arm/mach-omap2/omap-smp.c:185: undefined reference to `scu_get_core_count'
arch/arm/mach-omap2/built-in.o: In function `omap4_smp_prepare_cpus':
arch/arm/mach-omap2/omap-smp.c:211: undefined reference to `scu_enable'

This was attempted to be "fixed" in various attempts in the past [2] [3].

This series applies on top of the other fixes in discussion for linux-next [4] [5].

Based on:
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git  next-20130626

Nishanth Menon (2):
  ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4
  ARM: scu: provide inline dummy functions when SCU is not present

 arch/arm/include/asm/smp_scu.h  |   13 ++++++++++++-
 arch/arm/mach-omap2/sleep44xx.S |    6 +++++-
 2 files changed, 17 insertions(+), 2 deletions(-)

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0407e/CHDFJICC.html
[2] https://patchwork.kernel.org/patch/2568091/
[3] http://marc.info/?t=137120115400001&r=1&w=2
[4] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/178209.html
[5] https://patchwork.kernel.org/patch/2781471/

Regards,
Nishanth Menon
-- 
1.7.9.5

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

* [-next PATCH 1/2] ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4
  2013-06-26 14:39 [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
@ 2013-06-26 14:39 ` Nishanth Menon
  2013-06-26 14:39 ` [-next PATCH 2/2] ARM: scu: provide inline dummy functions when SCU is not present Nishanth Menon
  2013-07-01 15:34 ` [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
  2 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2013-06-26 14:39 UTC (permalink / raw)
  To: Russell King, Tony Lindgren, Stephen Warren, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, linux-kernel, linux-omap, Arnd Bergmann,
	Nishanth Menon

CPU sleep and resume functions for Cortex-A9 based OMAP4 and
Cortex-A15 based OMAP5 are different. Hence, even though we reuse
most of the remaining file as part of OMAP4/5 consolidation, build
OMAP4 specific sleep/resume operations only for OMAP4. SCU is not used
OMAP5.

This fixes the following build failure with OMAP5 only build:
arch/arm/mach-omap2/built-in.o: In function `scu_gp_set':
arch/arm/mach-omap2/sleep44xx.S:132: undefined reference to `scu_power_mode'
arch/arm/mach-omap2/built-in.o: In function `scu_gp_clear':
arch/arm/mach-omap2/sleep44xx.S:229: undefined reference to `scu_power_mode'

Reported-by: Pekon Gupta <pekon@ti.com>
Reported-by: Vincent Stehlé <v-stehle@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/mach-omap2/sleep44xx.S |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index 88ff83a..9086ce0 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -34,6 +34,8 @@ ppa_zero_params:
 ppa_por_params:
 	.word		1, 0
 
+#ifdef CONFIG_ARCH_OMAP4
+
 /*
  * =============================
  * == CPU suspend finisher ==
@@ -326,7 +328,9 @@ skip_l2en:
 
 	b	cpu_resume			@ Jump to generic resume
 ENDPROC(omap4_cpu_resume)
-#endif
+#endif	/* CONFIG_ARCH_OMAP4 */
+
+#endif	/* defined(CONFIG_SMP) && defined(CONFIG_PM) */
 
 #ifndef CONFIG_OMAP4_ERRATA_I688
 ENTRY(omap_bus_sync)
-- 
1.7.9.5

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

* [-next PATCH 2/2] ARM: scu: provide inline dummy functions when SCU is not present
  2013-06-26 14:39 [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
  2013-06-26 14:39 ` [-next PATCH 1/2] ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4 Nishanth Menon
@ 2013-06-26 14:39 ` Nishanth Menon
  2013-07-01 15:34 ` [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
  2 siblings, 0 replies; 5+ messages in thread
From: Nishanth Menon @ 2013-06-26 14:39 UTC (permalink / raw)
  To: Russell King, Tony Lindgren, Stephen Warren, Rob Herring,
	Santosh Shilimkar
  Cc: linux-arm-kernel, linux-kernel, linux-omap, Arnd Bergmann,
	Nishanth Menon

On platforms such as Cortex-A15 based OMAP5, SCU is not used, however
since much code is shared between Cortex-A9 based OMAP4 (which uses
SCU) and OMAP5, It does help to have inline functions returning error
values when SCU is not present on the platform.

arch/arm/mach-omap2/omap-smp.c which is common between OMAP4 and 5
handles the SCU usage only for OMAP4.

This fixes the following build failure with OMAP5 only build:
arch/arm/mach-omap2/built-in.o: In function `omap4_smp_init_cpus':
arch/arm/mach-omap2/omap-smp.c:185: undefined reference to `scu_get_core_count'
arch/arm/mach-omap2/built-in.o: In function `omap4_smp_prepare_cpus':
arch/arm/mach-omap2/omap-smp.c:211: undefined reference to `scu_enable'

Reported-by: Pekon Gupta <pekon@ti.com>
Reported-by: Vincent Stehlé <v-stehle@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/include/asm/smp_scu.h |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/smp_scu.h b/arch/arm/include/asm/smp_scu.h
index 18d1693..433f9d9 100644
--- a/arch/arm/include/asm/smp_scu.h
+++ b/arch/arm/include/asm/smp_scu.h
@@ -23,10 +23,21 @@ static inline unsigned long scu_a9_get_base(void)
 	return pa;
 }
 
+#ifdef CONFIG_HAVE_ARM_SCU
 unsigned int scu_get_core_count(void __iomem *);
 int scu_power_mode(void __iomem *, unsigned int);
+#else
+static inline unsigned int scu_get_core_count(void __iomem *scu_base)
+{
+	return 0;
+}
+static inline int scu_power_mode(void __iomem *scu_base, unsigned int mode)
+{
+	return -EINVAL;
+}
+#endif
 
-#ifdef CONFIG_SMP
+#if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU)
 void scu_enable(void __iomem *scu_base);
 #else
 static inline void scu_enable(void __iomem *scu_base) {}
-- 
1.7.9.5

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

* Re: [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage
  2013-06-26 14:39 [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
  2013-06-26 14:39 ` [-next PATCH 1/2] ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4 Nishanth Menon
  2013-06-26 14:39 ` [-next PATCH 2/2] ARM: scu: provide inline dummy functions when SCU is not present Nishanth Menon
@ 2013-07-01 15:34 ` Nishanth Menon
  2013-07-04 12:02   ` Tony Lindgren
  2 siblings, 1 reply; 5+ messages in thread
From: Nishanth Menon @ 2013-07-01 15:34 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Nishanth Menon, Russell King, Stephen Warren, Rob Herring,
	Santosh Shilimkar, linux-arm-kernel, linux-kernel, linux-omap,
	Arnd Bergmann

Tony,

Any chance of picking these up?

I see that next-20130701 is broke as well in an OMAP5 only build. beyond 
the fixes already merged in - the missing series seems to be the 
$subject series to allow an OMAP5 only build.

On 06/26/2013 09:39 AM, Nishanth Menon wrote:
> Hi,
>
> Cortex-A15 based OMAP5 does not use Snoop Control Unit(SCU)[1].
> However, there is lot of code that is shared between Cortex-A9 based
> OMAP4 and OMAP5, hence functionality code is shared with runtime usage
> of SCU based on SoC worked on. However on building with OMAP5 only
> generates the following errors:
> arch/arm/mach-omap2/built-in.o: In function `scu_gp_set':
> arch/arm/mach-omap2/sleep44xx.S:132: undefined reference to `scu_power_mode'
> arch/arm/mach-omap2/built-in.o: In function `scu_gp_clear':
> arch/arm/mach-omap2/sleep44xx.S:229: undefined reference to `scu_power_mode'
> arch/arm/mach-omap2/built-in.o: In function `omap4_smp_init_cpus':
> arch/arm/mach-omap2/omap-smp.c:185: undefined reference to `scu_get_core_count'
> arch/arm/mach-omap2/built-in.o: In function `omap4_smp_prepare_cpus':
> arch/arm/mach-omap2/omap-smp.c:211: undefined reference to `scu_enable'
>
> This was attempted to be "fixed" in various attempts in the past [2] [3].
>
> This series applies on top of the other fixes in discussion for linux-next [4] [5].
>
> Based on:
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git  next-20130626
>
> Nishanth Menon (2):
>    ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4
>    ARM: scu: provide inline dummy functions when SCU is not present
>
>   arch/arm/include/asm/smp_scu.h  |   13 ++++++++++++-
>   arch/arm/mach-omap2/sleep44xx.S |    6 +++++-
>   2 files changed, 17 insertions(+), 2 deletions(-)
>
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0407e/CHDFJICC.html
> [2] https://patchwork.kernel.org/patch/2568091/
> [3] http://marc.info/?t=137120115400001&r=1&w=2
> [4] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-June/178209.html
> [5] https://patchwork.kernel.org/patch/2781471/
>
> Regards,
> Nishanth Menon
>


-- 
Regards,
Nishanth Menon

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

* Re: [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage
  2013-07-01 15:34 ` [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
@ 2013-07-04 12:02   ` Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2013-07-04 12:02 UTC (permalink / raw)
  To: Nishanth Menon
  Cc: Russell King, Stephen Warren, Rob Herring, Santosh Shilimkar,
	linux-arm-kernel, linux-kernel, linux-omap, Arnd Bergmann

* Nishanth Menon <nm@ti.com> [130701 08:41]:
> Tony,
> 
> Any chance of picking these up?

Thanks yes applying into omap-for-v3.11/fixes now that the pending
branches have been merged.

Tony

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

end of thread, other threads:[~2013-07-04 12:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-26 14:39 [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
2013-06-26 14:39 ` [-next PATCH 1/2] ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4 Nishanth Menon
2013-06-26 14:39 ` [-next PATCH 2/2] ARM: scu: provide inline dummy functions when SCU is not present Nishanth Menon
2013-07-01 15:34 ` [-next PATCH 0/2] ARM: OMAP5: fix build breakage due to SCU usage Nishanth Menon
2013-07-04 12:02   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).