Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mvebu: add Armada 375 support to the coherency code

The Armada 375, like the Armada 370 and Armada XP, has a coherency
unit. However, unlike the coherency unit of 370/XP which does both CPU
and I/O coherency, the one on Armada 735 only does I/O
coherency. Therefore, instead of having two sets of registers (the
first one being used mainly to register each CPU in the coherency
fabric, the second one being used for the I/O coherency barrier), it
has only one set of register (for the I/O coherency barrier).

This commit adds a new "marvell,armada-375-coherency-fabric"
compatible string for this variant of the coherency fabric. The custom
DMA operations, and the way of triggering an I/O barrier is the same
as Armada 370/XP, so the code changes are minimal. However, the
set_cpu_coherent() function is not needed on Armada 375 and will not
work.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Link: https://lkml.kernel.org/r/1397483228-25625-7-git-send-email-thomas.petazzoni@free-electrons.com
Signed-off-by: Jason Cooper <jason@lakedaemon.net>

authored by

Thomas Petazzoni and committed by
Jason Cooper
77fa4b9a 8e6ac203

+33 -5
+19 -5
Documentation/devicetree/bindings/arm/coherency-fabric.txt
··· 1 1 Coherency fabric 2 2 ---------------- 3 - Available on Marvell SOCs: Armada 370 and Armada XP 3 + Available on Marvell SOCs: Armada 370, Armada 375 and Armada XP 4 4 5 5 Required properties: 6 6 ··· 9 9 * "marvell,coherency-fabric", to be used for the coherency fabric of 10 10 the Armada 370 and Armada XP. 11 11 12 - - reg: Should contain coherency fabric registers location and 13 - length. First pair for the coherency fabric registers, second pair 14 - for the per-CPU fabric registers registers. 12 + * "marvell,armada-375-coherency-fabric", for the Armada 375 coherency 13 + fabric. 15 14 16 - Example: 15 + - reg: Should contain coherency fabric registers location and 16 + length. 17 + 18 + * For "marvell,coherency-fabric", the first pair for the coherency 19 + fabric registers, second pair for the per-CPU fabric registers. 20 + 21 + * For "marvell,armada-375-coherency-fabric", only one pair is needed 22 + for the per-CPU fabric registers. 23 + 24 + 25 + Examples: 17 26 18 27 coherency-fabric@d0020200 { 19 28 compatible = "marvell,coherency-fabric"; 20 29 reg = <0xd0020200 0xb0>, 21 30 <0xd0021810 0x1c>; 22 31 32 + }; 33 + 34 + coherency-fabric@21810 { 35 + compatible = "marvell,armada-375-coherency-fabric"; 36 + reg = <0x21810 0x1c>; 23 37 }; 24 38
+14
arch/arm/mach-mvebu/coherency.c
··· 41 41 enum { 42 42 COHERENCY_FABRIC_TYPE_NONE, 43 43 COHERENCY_FABRIC_TYPE_ARMADA_370_XP, 44 + COHERENCY_FABRIC_TYPE_ARMADA_375, 44 45 }; 45 46 46 47 static struct of_device_id of_coherency_table[] = { 47 48 {.compatible = "marvell,coherency-fabric", 48 49 .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, 50 + {.compatible = "marvell,armada-375-coherency-fabric", 51 + .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_375 }, 49 52 { /* end of list */ }, 50 53 }; 51 54 ··· 148 145 set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); 149 146 } 150 147 148 + static void __init armada_375_coherency_init(struct device_node *np) 149 + { 150 + coherency_cpu_base = of_iomap(np, 0); 151 + } 152 + 151 153 static int coherency_type(void) 152 154 { 153 155 struct device_node *np; ··· 164 156 165 157 /* Armada 370/XP coherency works in both UP and SMP */ 166 158 if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) 159 + return type; 160 + 161 + /* Armada 375 coherency works only on SMP */ 162 + else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 && is_smp()) 167 163 return type; 168 164 169 165 of_node_put(np); ··· 190 178 191 179 if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) 192 180 armada_370_coherency_init(np); 181 + else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375) 182 + armada_375_coherency_init(np); 193 183 194 184 return 0; 195 185 }