.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * plat smp support for CSR Marco dual-core SMP SoCs |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company. |
---|
5 | | - * |
---|
6 | | - * Licensed under GPLv2 or later. |
---|
7 | 6 | */ |
---|
8 | 7 | |
---|
9 | 8 | #include <linux/init.h> |
---|
.. | .. |
---|
24 | 23 | |
---|
25 | 24 | static DEFINE_SPINLOCK(boot_lock); |
---|
26 | 25 | |
---|
| 26 | +/* XXX prima2_pen_release is cargo culted code - DO NOT COPY XXX */ |
---|
| 27 | +volatile int prima2_pen_release = -1; |
---|
| 28 | + |
---|
27 | 29 | static void sirfsoc_secondary_init(unsigned int cpu) |
---|
28 | 30 | { |
---|
29 | 31 | /* |
---|
30 | 32 | * let the primary processor know we're out of the |
---|
31 | 33 | * pen, then head off into the C entry point |
---|
32 | 34 | */ |
---|
33 | | - pen_release = -1; |
---|
| 35 | + prima2_pen_release = -1; |
---|
34 | 36 | smp_wmb(); |
---|
35 | 37 | |
---|
36 | 38 | /* |
---|
.. | .. |
---|
80 | 82 | /* |
---|
81 | 83 | * The secondary processor is waiting to be released from |
---|
82 | 84 | * the holding pen - release it, then wait for it to flag |
---|
83 | | - * that it has been released by resetting pen_release. |
---|
| 85 | + * that it has been released by resetting prima2_pen_release. |
---|
84 | 86 | * |
---|
85 | | - * Note that "pen_release" is the hardware CPU ID, whereas |
---|
| 87 | + * Note that "prima2_pen_release" is the hardware CPU ID, whereas |
---|
86 | 88 | * "cpu" is Linux's internal ID. |
---|
87 | 89 | */ |
---|
88 | | - pen_release = cpu_logical_map(cpu); |
---|
89 | | - sync_cache_w(&pen_release); |
---|
| 90 | + prima2_pen_release = cpu_logical_map(cpu); |
---|
| 91 | + sync_cache_w(&prima2_pen_release); |
---|
90 | 92 | |
---|
91 | 93 | /* |
---|
92 | 94 | * Send the secondary CPU SEV, thereby causing the boot monitor to read |
---|
.. | .. |
---|
97 | 99 | timeout = jiffies + (1 * HZ); |
---|
98 | 100 | while (time_before(jiffies, timeout)) { |
---|
99 | 101 | smp_rmb(); |
---|
100 | | - if (pen_release == -1) |
---|
| 102 | + if (prima2_pen_release == -1) |
---|
101 | 103 | break; |
---|
102 | 104 | |
---|
103 | 105 | udelay(10); |
---|
.. | .. |
---|
109 | 111 | */ |
---|
110 | 112 | spin_unlock(&boot_lock); |
---|
111 | 113 | |
---|
112 | | - return pen_release != -1 ? -ENOSYS : 0; |
---|
| 114 | + return prima2_pen_release != -1 ? -ENOSYS : 0; |
---|
113 | 115 | } |
---|
114 | 116 | |
---|
115 | 117 | const struct smp_operations sirfsoc_smp_ops __initconst = { |
---|