hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm/mach-prima2/platsmp.c
....@@ -1,9 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * plat smp support for CSR Marco dual-core SMP SoCs
34 *
45 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
5
- *
6
- * Licensed under GPLv2 or later.
76 */
87
98 #include <linux/init.h>
....@@ -22,7 +21,10 @@
2221
2322 static void __iomem *clk_base;
2423
25
-static DEFINE_RAW_SPINLOCK(boot_lock);
24
+static DEFINE_SPINLOCK(boot_lock);
25
+
26
+/* XXX prima2_pen_release is cargo culted code - DO NOT COPY XXX */
27
+volatile int prima2_pen_release = -1;
2628
2729 static void sirfsoc_secondary_init(unsigned int cpu)
2830 {
....@@ -30,14 +32,14 @@
3032 * let the primary processor know we're out of the
3133 * pen, then head off into the C entry point
3234 */
33
- pen_release = -1;
35
+ prima2_pen_release = -1;
3436 smp_wmb();
3537
3638 /*
3739 * Synchronise with the boot thread.
3840 */
39
- raw_spin_lock(&boot_lock);
40
- raw_spin_unlock(&boot_lock);
41
+ spin_lock(&boot_lock);
42
+ spin_unlock(&boot_lock);
4143 }
4244
4345 static const struct of_device_id clk_ids[] = {
....@@ -75,18 +77,18 @@
7577 /* make sure write buffer is drained */
7678 mb();
7779
78
- raw_spin_lock(&boot_lock);
80
+ spin_lock(&boot_lock);
7981
8082 /*
8183 * The secondary processor is waiting to be released from
8284 * 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.
8486 *
85
- * Note that "pen_release" is the hardware CPU ID, whereas
87
+ * Note that "prima2_pen_release" is the hardware CPU ID, whereas
8688 * "cpu" is Linux's internal ID.
8789 */
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);
9092
9193 /*
9294 * Send the secondary CPU SEV, thereby causing the boot monitor to read
....@@ -97,7 +99,7 @@
9799 timeout = jiffies + (1 * HZ);
98100 while (time_before(jiffies, timeout)) {
99101 smp_rmb();
100
- if (pen_release == -1)
102
+ if (prima2_pen_release == -1)
101103 break;
102104
103105 udelay(10);
....@@ -107,9 +109,9 @@
107109 * now the secondary core is starting up let it run its
108110 * calibrations, then wait for it to finish
109111 */
110
- raw_spin_unlock(&boot_lock);
112
+ spin_unlock(&boot_lock);
111113
112
- return pen_release != -1 ? -ENOSYS : 0;
114
+ return prima2_pen_release != -1 ? -ENOSYS : 0;
113115 }
114116
115117 const struct smp_operations sirfsoc_smp_ops __initconst = {