aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-04-14 09:47:06 -0400
committerJason Cooper <jason@lakedaemon.net>2014-04-24 01:00:38 -0400
commitd0de9323822fada543f2f244eb67f520aa21ed77 (patch)
treeb7530bb19d7235d7a2d359c681e27d2ca3987626 /arch/arm
parent5ab5afd8ba837560f76f8ee527271d2e819bcaef (diff)
ARM: mvebu: add Armada 38x support to the coherency code
The Armada 38x has a coherency unit that is similar to the one of the Armada 375 SoC, except that it does not have the bug of the Armada 375 coherency unit that requires the XOR based workaround. This commit therefore extends the Marvell EBU coherency code with a new compatible string to support the Armada 38x coherency unit. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Link: https://lkml.kernel.org/r/1397483228-25625-9-git-send-email-thomas.petazzoni@free-electrons.com Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-mvebu/coherency.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c
index 75db33ef93ee..489edd157cfb 100644
--- a/arch/arm/mach-mvebu/coherency.c
+++ b/arch/arm/mach-mvebu/coherency.c
@@ -47,6 +47,7 @@ enum {
47 COHERENCY_FABRIC_TYPE_NONE, 47 COHERENCY_FABRIC_TYPE_NONE,
48 COHERENCY_FABRIC_TYPE_ARMADA_370_XP, 48 COHERENCY_FABRIC_TYPE_ARMADA_370_XP,
49 COHERENCY_FABRIC_TYPE_ARMADA_375, 49 COHERENCY_FABRIC_TYPE_ARMADA_375,
50 COHERENCY_FABRIC_TYPE_ARMADA_380,
50}; 51};
51 52
52static struct of_device_id of_coherency_table[] = { 53static struct of_device_id of_coherency_table[] = {
@@ -54,6 +55,8 @@ static struct of_device_id of_coherency_table[] = {
54 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, 55 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP },
55 {.compatible = "marvell,armada-375-coherency-fabric", 56 {.compatible = "marvell,armada-375-coherency-fabric",
56 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_375 }, 57 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_375 },
58 {.compatible = "marvell,armada-380-coherency-fabric",
59 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_380 },
57 { /* end of list */ }, 60 { /* end of list */ },
58}; 61};
59 62
@@ -302,7 +305,7 @@ static void __init armada_370_coherency_init(struct device_node *np)
302 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); 305 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0);
303} 306}
304 307
305static void __init armada_375_coherency_init(struct device_node *np) 308static void __init armada_375_380_coherency_init(struct device_node *np)
306{ 309{
307 coherency_cpu_base = of_iomap(np, 0); 310 coherency_cpu_base = of_iomap(np, 0);
308} 311}
@@ -324,6 +327,10 @@ static int coherency_type(void)
324 else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 && is_smp()) 327 else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 && is_smp())
325 return type; 328 return type;
326 329
330 /* Armada 380 coherency works only on SMP */
331 else if (type == COHERENCY_FABRIC_TYPE_ARMADA_380 && is_smp())
332 return type;
333
327 of_node_put(np); 334 of_node_put(np);
328 } 335 }
329 336
@@ -344,8 +351,9 @@ int __init coherency_init(void)
344 351
345 if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) 352 if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP)
346 armada_370_coherency_init(np); 353 armada_370_coherency_init(np);
347 else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375) 354 else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 ||
348 armada_375_coherency_init(np); 355 type == COHERENCY_FABRIC_TYPE_ARMADA_380)
356 armada_375_380_coherency_init(np);
349 357
350 return 0; 358 return 0;
351} 359}