diff options
author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2014-04-14 11:10:06 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2014-05-08 12:18:51 -0400 |
commit | b41375f71aceadb7d74a18aafba4da5024fc104b (patch) | |
tree | ef79aa21f36ad88f8c44ba31b19bbc07df2d3bd3 /arch/arm/mach-mvebu | |
parent | ccd6a13180193700067bfdac5f7d7b436d757382 (diff) |
ARM: mvebu: ll_set_cpu_coherent always uses the current CPU
ll_set_cpu_coherent is always used on the current CPU, so instead of
passing the CPU id as argument, ll_set_cpu_coherent() can find it by
itself.
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Link: https://lkml.kernel.org/r/1397488214-20685-4-git-send-email-gregory.clement@free-electrons.com
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/arm/mach-mvebu')
-rw-r--r-- | arch/arm/mach-mvebu/coherency.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/coherency.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/coherency_ll.S | 10 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/headsmp.S | 4 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/platsmp.c | 2 |
5 files changed, 12 insertions, 18 deletions
diff --git a/arch/arm/mach-mvebu/coherency.c b/arch/arm/mach-mvebu/coherency.c index 615dc0b6093e..2df90c998820 100644 --- a/arch/arm/mach-mvebu/coherency.c +++ b/arch/arm/mach-mvebu/coherency.c | |||
@@ -61,17 +61,17 @@ static struct of_device_id of_coherency_table[] = { | |||
61 | }; | 61 | }; |
62 | 62 | ||
63 | /* Function defined in coherency_ll.S */ | 63 | /* Function defined in coherency_ll.S */ |
64 | int ll_set_cpu_coherent(unsigned int hw_cpu_id); | 64 | int ll_set_cpu_coherent(void); |
65 | 65 | ||
66 | int set_cpu_coherent(unsigned int hw_cpu_id, int smp_group_id) | 66 | int set_cpu_coherent(int smp_group_id) |
67 | { | 67 | { |
68 | if (!coherency_base) { | 68 | if (!coherency_base) { |
69 | pr_warn("Can't make CPU %d cache coherent.\n", hw_cpu_id); | 69 | pr_warn("Can't make current CPU cache coherent.\n"); |
70 | pr_warn("Coherency fabric is not initialized\n"); | 70 | pr_warn("Coherency fabric is not initialized\n"); |
71 | return 1; | 71 | return 1; |
72 | } | 72 | } |
73 | 73 | ||
74 | return ll_set_cpu_coherent(hw_cpu_id); | 74 | return ll_set_cpu_coherent(); |
75 | } | 75 | } |
76 | 76 | ||
77 | /* | 77 | /* |
@@ -302,7 +302,7 @@ static void __init armada_370_coherency_init(struct device_node *np) | |||
302 | sync_cache_w(&coherency_phys_base); | 302 | sync_cache_w(&coherency_phys_base); |
303 | coherency_base = of_iomap(np, 0); | 303 | coherency_base = of_iomap(np, 0); |
304 | coherency_cpu_base = of_iomap(np, 1); | 304 | coherency_cpu_base = of_iomap(np, 1); |
305 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); | 305 | set_cpu_coherent(0); |
306 | } | 306 | } |
307 | 307 | ||
308 | static void __init armada_375_380_coherency_init(struct device_node *np) | 308 | static void __init armada_375_380_coherency_init(struct device_node *np) |
@@ -330,8 +330,6 @@ static int coherency_type(void) | |||
330 | /* Armada 380 coherency works only on SMP */ | 330 | /* Armada 380 coherency works only on SMP */ |
331 | else if (type == COHERENCY_FABRIC_TYPE_ARMADA_380 && is_smp()) | 331 | else if (type == COHERENCY_FABRIC_TYPE_ARMADA_380 && is_smp()) |
332 | return type; | 332 | return type; |
333 | |||
334 | of_node_put(np); | ||
335 | } | 333 | } |
336 | 334 | ||
337 | return COHERENCY_FABRIC_TYPE_NONE; | 335 | return COHERENCY_FABRIC_TYPE_NONE; |
diff --git a/arch/arm/mach-mvebu/coherency.h b/arch/arm/mach-mvebu/coherency.h index 02f7ec34ced2..ab594a75fef3 100644 --- a/arch/arm/mach-mvebu/coherency.h +++ b/arch/arm/mach-mvebu/coherency.h | |||
@@ -16,7 +16,7 @@ | |||
16 | 16 | ||
17 | extern unsigned long coherency_phys_base; | 17 | extern unsigned long coherency_phys_base; |
18 | 18 | ||
19 | int set_cpu_coherent(unsigned int cpu_id, int smp_group_id); | 19 | int set_cpu_coherent(int smp_group_id); |
20 | int coherency_init(void); | 20 | int coherency_init(void); |
21 | int coherency_available(void); | 21 | int coherency_available(void); |
22 | 22 | ||
diff --git a/arch/arm/mach-mvebu/coherency_ll.S b/arch/arm/mach-mvebu/coherency_ll.S index 1f2bcd4b5424..98a0b73f909b 100644 --- a/arch/arm/mach-mvebu/coherency_ll.S +++ b/arch/arm/mach-mvebu/coherency_ll.S | |||
@@ -24,9 +24,7 @@ | |||
24 | #include <asm/cp15.h> | 24 | #include <asm/cp15.h> |
25 | 25 | ||
26 | .text | 26 | .text |
27 | /* | 27 | |
28 | * r0: HW CPU id | ||
29 | */ | ||
30 | ENTRY(ll_set_cpu_coherent) | 28 | ENTRY(ll_set_cpu_coherent) |
31 | mrc p15, 0, r1, c1, c0, 0 | 29 | mrc p15, 0, r1, c1, c0, 0 |
32 | tst r1, #CR_M @ Check MMU bit enabled | 30 | tst r1, #CR_M @ Check MMU bit enabled |
@@ -43,8 +41,10 @@ ENTRY(ll_set_cpu_coherent) | |||
43 | ldr r0, [r0] | 41 | ldr r0, [r0] |
44 | 2: | 42 | 2: |
45 | /* Create bit by cpu index */ | 43 | /* Create bit by cpu index */ |
46 | mov r3, #(1 << 24) | 44 | mrc 15, 0, r1, cr0, cr0, 5 |
47 | lsl r1, r3, r1 | 45 | and r1, r1, #15 |
46 | mov r2, #(1 << 24) | ||
47 | lsl r1, r2, r1 | ||
48 | ARM_BE8(rev r1, r1) | 48 | ARM_BE8(rev r1, r1) |
49 | 49 | ||
50 | /* Add CPU to SMP group - Atomic */ | 50 | /* Add CPU to SMP group - Atomic */ |
diff --git a/arch/arm/mach-mvebu/headsmp.S b/arch/arm/mach-mvebu/headsmp.S index f30bc8d78871..cf7abe6554f7 100644 --- a/arch/arm/mach-mvebu/headsmp.S +++ b/arch/arm/mach-mvebu/headsmp.S | |||
@@ -31,10 +31,6 @@ | |||
31 | ENTRY(armada_xp_secondary_startup) | 31 | ENTRY(armada_xp_secondary_startup) |
32 | ARM_BE8(setend be ) @ go BE8 if entered LE | 32 | ARM_BE8(setend be ) @ go BE8 if entered LE |
33 | 33 | ||
34 | /* Read CPU id */ | ||
35 | mrc p15, 0, r1, c0, c0, 5 | ||
36 | and r1, r1, #0xF | ||
37 | |||
38 | /* Add CPU to coherency fabric */ | 34 | /* Add CPU to coherency fabric */ |
39 | bl ll_set_cpu_coherent | 35 | bl ll_set_cpu_coherent |
40 | b secondary_startup | 36 | b secondary_startup |
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c index 32bf78e80c48..75436c0023a8 100644 --- a/arch/arm/mach-mvebu/platsmp.c +++ b/arch/arm/mach-mvebu/platsmp.c | |||
@@ -103,7 +103,7 @@ static void __init armada_xp_smp_prepare_cpus(unsigned int max_cpus) | |||
103 | 103 | ||
104 | set_secondary_cpus_clock(); | 104 | set_secondary_cpus_clock(); |
105 | flush_cache_all(); | 105 | flush_cache_all(); |
106 | set_cpu_coherent(cpu_logical_map(smp_processor_id()), 0); | 106 | set_cpu_coherent(0); |
107 | 107 | ||
108 | /* | 108 | /* |
109 | * In order to boot the secondary CPUs we need to ensure | 109 | * In order to boot the secondary CPUs we need to ensure |