149613d4dSRussell King #ifndef __ASMARM_ARCH_SCU_H 249613d4dSRussell King #define __ASMARM_ARCH_SCU_H 349613d4dSRussell King 4292ec42aSRussell King #define SCU_PM_NORMAL 0 5292ec42aSRussell King #define SCU_PM_DORMANT 2 6292ec42aSRussell King #define SCU_PM_POWEROFF 3 7292ec42aSRussell King 8292ec42aSRussell King #ifndef __ASSEMBLER__ 9e9d6b335SHiroshi Doyu 10e9d6b335SHiroshi Doyu #include <asm/cputype.h> 11e9d6b335SHiroshi Doyu 12e9d6b335SHiroshi Doyu static inline bool scu_a9_has_base(void) 13e9d6b335SHiroshi Doyu { 14*af040ffcSRussell King return read_cpuid_part() == ARM_CPU_PART_CORTEX_A9; 15e9d6b335SHiroshi Doyu } 16e9d6b335SHiroshi Doyu 17e9d6b335SHiroshi Doyu static inline unsigned long scu_a9_get_base(void) 18e9d6b335SHiroshi Doyu { 19e9d6b335SHiroshi Doyu unsigned long pa; 20e9d6b335SHiroshi Doyu 21e9d6b335SHiroshi Doyu asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (pa)); 22e9d6b335SHiroshi Doyu 23e9d6b335SHiroshi Doyu return pa; 24e9d6b335SHiroshi Doyu } 25e9d6b335SHiroshi Doyu 262abc75a8SNishanth Menon #ifdef CONFIG_HAVE_ARM_SCU 27a8cbcd92SRussell King unsigned int scu_get_core_count(void __iomem *); 28292ec42aSRussell King int scu_power_mode(void __iomem *, unsigned int); 292abc75a8SNishanth Menon #else 302abc75a8SNishanth Menon static inline unsigned int scu_get_core_count(void __iomem *scu_base) 312abc75a8SNishanth Menon { 322abc75a8SNishanth Menon return 0; 332abc75a8SNishanth Menon } 342abc75a8SNishanth Menon static inline int scu_power_mode(void __iomem *scu_base, unsigned int mode) 352abc75a8SNishanth Menon { 362abc75a8SNishanth Menon return -EINVAL; 372abc75a8SNishanth Menon } 382abc75a8SNishanth Menon #endif 39eed88123SRob Herring 402abc75a8SNishanth Menon #if defined(CONFIG_SMP) && defined(CONFIG_HAVE_ARM_SCU) 41eed88123SRob Herring void scu_enable(void __iomem *scu_base); 42eed88123SRob Herring #else 43eed88123SRob Herring static inline void scu_enable(void __iomem *scu_base) {} 44eed88123SRob Herring #endif 45eed88123SRob Herring 46292ec42aSRussell King #endif 4749613d4dSRussell King 4849613d4dSRussell King #endif 49