mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 03:04:07 +07:00
af040ffc9b
Ensure that platform maintainers check the CPU part number in the right manner: the CPU part number is meaningless without also checking the CPU implement(e|o)r (choose your preferred spelling!) Provide an interface which returns both the implementer and part number together, and update the definitions to include the implementer. Mark the old function as being deprecated... indeed, using the old function with the definitions will now always evaluate as false, so people must update their un-merged code to the new function. While this could be avoided by adding new definitions, we'd also have to create new names for them which would be awkward. Acked-by: Nicolas Pitre <nico@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
49 lines
922 B
C
49 lines
922 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() == 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
|