Merge tag 'fbdev-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-mvebu / coherency.c
index b5895f040caaf73a9f304f91c0fca2533a9dcc86..44eedf331ae7df40bb76fcfec0358e89ce128d76 100644 (file)
@@ -51,7 +51,7 @@ enum {
        COHERENCY_FABRIC_TYPE_ARMADA_380,
 };
 
-static struct of_device_id of_coherency_table[] = {
+static const struct of_device_id of_coherency_table[] = {
        {.compatible = "marvell,coherency-fabric",
         .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP },
        {.compatible = "marvell,armada-375-coherency-fabric",
@@ -65,18 +65,6 @@ static struct of_device_id of_coherency_table[] = {
 int ll_enable_coherency(void);
 void ll_add_cpu_to_smp_group(void);
 
-int set_cpu_coherent(void)
-{
-       if (!coherency_base) {
-               pr_warn("Can't make current CPU cache coherent.\n");
-               pr_warn("Coherency fabric is not initialized\n");
-               return 1;
-       }
-
-       ll_add_cpu_to_smp_group();
-       return ll_enable_coherency();
-}
-
 static int mvebu_hwcc_notifier(struct notifier_block *nb,
                               unsigned long event, void *__dev)
 {
@@ -206,6 +194,23 @@ static int coherency_type(void)
        return type;
 }
 
+int set_cpu_coherent(void)
+{
+       int type = coherency_type();
+
+       if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) {
+               if (!coherency_base) {
+                       pr_warn("Can't make current CPU cache coherent.\n");
+                       pr_warn("Coherency fabric is not initialized\n");
+                       return 1;
+               }
+               ll_add_cpu_to_smp_group();
+               return ll_enable_coherency();
+       }
+
+       return 0;
+}
+
 int coherency_available(void)
 {
        return coherency_type() != COHERENCY_FABRIC_TYPE_NONE;