From: 黄涛 Date: Mon, 22 Oct 2012 10:50:52 +0000 (+0800) Subject: rk: move rk2928 cpu.h to plat-rk, add rk3066b cpu.h X-Git-Tag: firefly_0821_release~8346 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=448a630380df1a6d0e294e27b70a2510931d4bc1;p=firefly-linux-kernel-4.4.55.git rk: move rk2928 cpu.h to plat-rk, add rk3066b cpu.h --- diff --git a/arch/arm/mach-rk2928/include/mach/cpu.h b/arch/arm/mach-rk2928/include/mach/cpu.h index 11fdb447ebb9..f5243639e8af 100755 --- a/arch/arm/mach-rk2928/include/mach/cpu.h +++ b/arch/arm/mach-rk2928/include/mach/cpu.h @@ -1,28 +1,11 @@ #ifndef __MACH_CPU_H #define __MACH_CPU_H -#include -#include - -#define SOC_RK2928G 0x01 -#define SOC_RK2928L 0x02 -#define SOC_RK2926 0x00 +#include static inline void soc_gpio_init(void) { writel_relaxed(readl_relaxed(RK2928_GPIO3_BASE + 0x04) & (~0x07), RK2928_GPIO3_BASE + 0x04); } -static inline int soc_is_rk2928g(void) -{ - return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928G); -} -static inline int soc_is_rk2928l(void) -{ - return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928L); -} -static inline int soc_is_rk2926(void) -{ - return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2926); -} - + #endif diff --git a/arch/arm/mach-rk30/include/mach/cpu.h b/arch/arm/mach-rk30/include/mach/cpu.h new file mode 100644 index 000000000000..40195f1ccdc9 --- /dev/null +++ b/arch/arm/mach-rk30/include/mach/cpu.h @@ -0,0 +1 @@ +#include diff --git a/arch/arm/plat-rk/include/plat/cpu.h b/arch/arm/plat-rk/include/plat/cpu.h new file mode 100644 index 000000000000..a027c96bfd93 --- /dev/null +++ b/arch/arm/plat-rk/include/plat/cpu.h @@ -0,0 +1,48 @@ +#ifndef __PLAT_CPU_H +#define __PLAT_CPU_H + +#include +#include +#include + +#ifdef CONFIG_ARCH_RK2928 +#define SOC_RK2928G 0x01 +#define SOC_RK2928L 0x02 +#define SOC_RK2926 0x00 + +static inline bool soc_is_rk2928g(void) +{ + return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928G); +} + +static inline bool soc_is_rk2928l(void) +{ + return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2928L); +} + +static inline bool soc_is_rk2926(void) +{ + return ((readl_relaxed(RK2928_GPIO3_BASE + 0x50) & 0x07) == SOC_RK2926); +} +#else +static inline bool soc_is_rk2928g(void) { return false; } +static inline bool soc_is_rk2928l(void) { return false; } +static inline bool soc_is_rk2926(void) { return false; } +#endif + +#ifdef CONFIG_ARCH_RK3066B +static inline bool soc_is_rk3066b(void) +{ + return (((readl_relaxed(RK30_GPIO1_BASE + GPIO_EXT_PORT) >> 22) & 3) == 0); +} + +static inline bool soc_is_rk3108(void) +{ + return (((readl_relaxed(RK30_GPIO1_BASE + GPIO_EXT_PORT) >> 22) & 3) == 1); +} +#else +static inline bool soc_is_rk3066b(void) { return false; } +static inline bool soc_is_rk3108(void) { return false; } +#endif + +#endif