ARM: OMAP5: fix build breakage due to SCU usage
Subsystems (3)
cover ARM: OMAP5: fix build breakage due to SCU usage
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
Signature · 1 line
1.7.9.5
PATCH 1/2 ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4
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'
--- arch/arm/mach-omap2/sleep44xx.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
arch/arm/mach-omap2/sleep44xx.S +5 -1
@@ -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)
Signature · 1 line
1.7.9.5
PATCH 2/2 ARM: scu: provide inline dummy functions when SCU is not present
In reply to Nishanth MenonOn 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'
--- arch/arm/include/asm/smp_scu.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
arch/arm/include/asm/smp_scu.h +12 -1
@@ -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) {}
Signature · 1 line
1.7.9.5
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.
Quoted 40 lines · 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 toscu_power_mode' arch/arm/mach-omap2/built-in.o: In functionscu_gp_clear':arch/arm/mach-omap2/sleep44xx.S:229: undefined reference toscu_power_mode' arch/arm/mach-omap2/built-in.o: In functionomap4_smp_init_cpus':arch/arm/mach-omap2/omap-smp.c:185: undefined reference toscu_get_core_count' arch/arm/mach-omap2/built-in.o: In functionomap4_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.gitnext-20130626Nishanth Menon (2):
ARM: OMAP4: sleep: build OMAP4 specific functions only for OMAP4
ARM: scu: provide inline dummy functions when SCU is not presentarch/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
Signature · 2 lines
Regards, Nishanth Menon
Tony Lindgren
maintainerQuoted 3 lines · Nishanth Menon
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