From: 黄涛 Date: Wed, 6 Nov 2013 03:08:11 +0000 (+0800) Subject: rk319x: add cpu_is_rk319x and soc_is_rk3190 X-Git-Tag: firefly_0821_release~6505 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8ec12b57791fb56f87778dcd68667990eb7f6aea;p=firefly-linux-kernel-4.4.55.git rk319x: add cpu_is_rk319x and soc_is_rk3190 --- diff --git a/arch/arm/plat-rk/cpu.c b/arch/arm/plat-rk/cpu.c index b4e3fb5e0acf..5f3e64190fbd 100644 --- a/arch/arm/plat-rk/cpu.c +++ b/arch/arm/plat-rk/cpu.c @@ -6,7 +6,9 @@ static ssize_t show_type(struct sysdev_class *dev, struct sysdev_class_attribute { const char *type; - if (cpu_is_rk3188()) + if (cpu_is_rk319x()) + type = "rk319x"; + else if (cpu_is_rk3188()) type = "rk3188"; else if (cpu_is_rk3066b()) type = "rk3066b"; @@ -28,7 +30,9 @@ static ssize_t show_soc(struct sysdev_class *dev, struct sysdev_class_attribute { const char *soc; - if (soc_is_rk3188plus()) + if (soc_is_rk3190()) + soc = "rk3190"; + else if (soc_is_rk3188plus()) soc = "rk3188+"; else if (soc_is_rk3188()) soc = "rk3188"; diff --git a/arch/arm/plat-rk/include/plat/cpu.h b/arch/arm/plat-rk/include/plat/cpu.h index 21e9a9e180aa..e39395d32b34 100644 --- a/arch/arm/plat-rk/include/plat/cpu.h +++ b/arch/arm/plat-rk/include/plat/cpu.h @@ -33,7 +33,7 @@ static inline bool soc_is_rk2928l(void) { return false; } static inline bool soc_is_rk2926(void) { return false; } #endif -#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188) || defined(CONFIG_ARCH_RK3026) +#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188) || defined(CONFIG_ARCH_RK3026) || defined(CONFIG_ARCH_RK319X) static inline bool cpu_is_rk30xx(void) { return readl_relaxed(RK30_ROM_BASE + 0x27f0) == 0x33303041 @@ -77,12 +77,21 @@ static inline bool cpu_is_rk3026(void) && readl_relaxed(RK30_ROM_BASE + 0x3ff8) == 0x30353239 && readl_relaxed(RK30_ROM_BASE + 0x3ffc) == 0x56313031; } + +static inline bool cpu_is_rk319x(void) +{ + return readl_relaxed(RK30_ROM_BASE + 0x3ff0) == 0x33313042 + && readl_relaxed(RK30_ROM_BASE + 0x3ff4) == 0x32303133 + && readl_relaxed(RK30_ROM_BASE + 0x3ff8) == 0x30383237 + && readl_relaxed(RK30_ROM_BASE + 0x3ffc) == 0x56313031; +} #else static inline bool cpu_is_rk30xx(void) { return false; } static inline bool cpu_is_rk3066b(void) { return false; } static inline bool soc_is_rk3188(void) { return false; } static inline bool soc_is_rk3188plus(void) { return false; } static inline bool cpu_is_rk3026(void) { return false; } +static inline bool cpu_is_rk319x(void) { return false; } #endif #if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK3188) @@ -153,4 +162,10 @@ static inline bool soc_is_rk3026(void) { return false; } static inline bool soc_is_rk3028a(void) { return false; } #endif +#ifdef CONFIG_SOC_RK3190 +static inline bool soc_is_rk3190(void) { return true; } +#else +static inline bool soc_is_rk3190(void) { return false; } +#endif + #endif