mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 10:01:43 +00:00
2abc75a8c5
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> Signed-off-by: Tony Lindgren <tony@atomide.com>
49 lines
929 B
C
49 lines
929 B
C
#ifndef __ASMARM_ARCH_SCU_H
|
|
#define __ASMARM_ARCH_SCU_H
|
|
|
|
#define SCU_PM_NORMAL 0
|
|
#define SCU_PM_DORMANT 2
|
|
#define SCU_PM_POWEROFF 3
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <asm/cputype.h>
|
|
|
|
static inline bool scu_a9_has_base(void)
|
|
{
|
|
return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9;
|
|
}
|
|
|
|
static inline unsigned long scu_a9_get_base(void)
|
|
{
|
|
unsigned long pa;
|
|
|
|
asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa));
|
|
|
|
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
|
|
|
|
#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) {}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|