diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2014-04-14 09:47:04 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-04-24 01:00:37 -0400 |
commit | 77fa4b9ab0aafc0a06976814ad62aeff990dfd2c (patch) | |
tree | 02675a879bf9ebf3817685514fcca10b71c079be /arch/arm/mach-mvebu/coherency.c | |
parent | 8e6ac20338228dc77c8f3538efb5a3aba712e0e5 (diff) |
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>
Diffstat (limited to 'arch/arm/mach-mvebu/coherency.c')
-rw-r--r-- | arch/arm/mach-mvebu/coherency.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 862100f7c836..7ccaf87fd772 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c | |||
@@ -41,11 +41,14 @@ static void __iomem *coherency_cpu_base; | |||
41 | enum { | 41 | enum { |
42 | COHERENCY_FABRIC_TYPE_NONE, | 42 | COHERENCY_FABRIC_TYPE_NONE, |
43 | COHERENCY_FABRIC_TYPE_ARMADA_370_XP, | 43 | COHERENCY_FABRIC_TYPE_ARMADA_370_XP, |
44 | COHERENCY_FABRIC_TYPE_ARMADA_375, | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | static struct of_device_id of_coherency_table[] = { | 47 | static struct of_device_id of_coherency_table[] = { |
47 | {.compatible = "marvell,coherency-fabric", | 48 | {.compatible = "marvell,coherency-fabric", |
48 | .data = (void *) COHERENCY_FABRIC_TYPE_ARMADA_370_XP }, | 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 | { /* end of list */ }, | 52 | { /* end of list */ }, |
50 | }; | 53 | }; |
51 | 54 | ||
@@ -145,6 +148,11 @@ static void __init armada_370_coherency_init(struct device_node *np) | |||
145 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); | 148 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); |
146 | } | 149 | } |
147 | 150 | ||
151 | static void __init armada_375_coherency_init(struct device_node *np) | ||
152 | { | ||
153 | coherency_cpu_base = of_iomap(np, 0); | ||
154 | } | ||
155 | |||
148 | static int coherency_type(void) | 156 | static int coherency_type(void) |
149 | { | 157 | { |
150 | struct device_node *np; | 158 | struct device_node *np; |
@@ -158,6 +166,10 @@ static int coherency_type(void) | |||
158 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) | 166 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) |
159 | return type; | 167 | return type; |
160 | 168 | ||
169 | /* Armada 375 coherency works only on SMP */ | ||
170 | else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375 && is_smp()) | ||
171 | return type; | ||
172 | |||
161 | of_node_put(np); | 173 | of_node_put(np); |
162 | } | 174 | } |
163 | 175 | ||
@@ -178,6 +190,8 @@ int __init coherency_init(void) | |||
178 | 190 | ||
179 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) | 191 | if (type == COHERENCY_FABRIC_TYPE_ARMADA_370_XP) |
180 | armada_370_coherency_init(np); | 192 | armada_370_coherency_init(np); |
193 | else if (type == COHERENCY_FABRIC_TYPE_ARMADA_375) | ||
194 | armada_375_coherency_init(np); | ||
181 | 195 | ||
182 | return 0; | 196 | return 0; |
183 | } | 197 | } |