rk319x: add cpu_is_rk319x and soc_is_rk3190
author黄涛 <huangtao@rock-chips.com>
Wed, 6 Nov 2013 03:08:11 +0000 (11:08 +0800)
committer黄涛 <huangtao@rock-chips.com>
Wed, 6 Nov 2013 03:08:11 +0000 (11:08 +0800)
arch/arm/plat-rk/cpu.c
arch/arm/plat-rk/include/plat/cpu.h

index b4e3fb5e0acf11fbbb7774422b8695b8f53b2fe4..5f3e64190fbde42982d162c1ae6c066eabb9a5d6 100644 (file)
@@ -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";
index 21e9a9e180aa2b388a81145dbda5562c5965b5bd..e39395d32b3442c35d1ba73fd58dd9d700d8242d 100644 (file)
@@ -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