| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * arch/arm/mach-spear13xx/platsmp.c |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * Copyright (C) 2012 ST Microelectronics Ltd. |
|---|
| 7 | 8 | * Shiraz Hashim <shiraz.linux.kernel@gmail.com> |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 11 | | - * published by the Free Software Foundation. |
|---|
| 12 | 9 | */ |
|---|
| 13 | 10 | |
|---|
| 14 | 11 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 20 | 17 | #include <mach/spear.h> |
|---|
| 21 | 18 | #include "generic.h" |
|---|
| 22 | 19 | |
|---|
| 20 | +/* XXX spear_pen_release is cargo culted code - DO NOT COPY XXX */ |
|---|
| 21 | +volatile int spear_pen_release = -1; |
|---|
| 22 | + |
|---|
| 23 | 23 | /* |
|---|
| 24 | | - * Write pen_release in a way that is guaranteed to be visible to all |
|---|
| 25 | | - * observers, irrespective of whether they're taking part in coherency |
|---|
| 24 | + * XXX CARGO CULTED CODE - DO NOT COPY XXX |
|---|
| 25 | + * |
|---|
| 26 | + * Write spear_pen_release in a way that is guaranteed to be visible to |
|---|
| 27 | + * all observers, irrespective of whether they're taking part in coherency |
|---|
| 26 | 28 | * or not. This is necessary for the hotplug code to work reliably. |
|---|
| 27 | 29 | */ |
|---|
| 28 | | -static void write_pen_release(int val) |
|---|
| 30 | +static void spear_write_pen_release(int val) |
|---|
| 29 | 31 | { |
|---|
| 30 | | - pen_release = val; |
|---|
| 32 | + spear_pen_release = val; |
|---|
| 31 | 33 | smp_wmb(); |
|---|
| 32 | | - sync_cache_w(&pen_release); |
|---|
| 34 | + sync_cache_w(&spear_pen_release); |
|---|
| 33 | 35 | } |
|---|
| 34 | 36 | |
|---|
| 35 | 37 | static DEFINE_SPINLOCK(boot_lock); |
|---|
| .. | .. |
|---|
| 42 | 44 | * let the primary processor know we're out of the |
|---|
| 43 | 45 | * pen, then head off into the C entry point |
|---|
| 44 | 46 | */ |
|---|
| 45 | | - write_pen_release(-1); |
|---|
| 47 | + spear_write_pen_release(-1); |
|---|
| 46 | 48 | |
|---|
| 47 | 49 | /* |
|---|
| 48 | 50 | * Synchronise with the boot thread. |
|---|
| .. | .. |
|---|
| 64 | 66 | /* |
|---|
| 65 | 67 | * The secondary processor is waiting to be released from |
|---|
| 66 | 68 | * the holding pen - release it, then wait for it to flag |
|---|
| 67 | | - * that it has been released by resetting pen_release. |
|---|
| 69 | + * that it has been released by resetting spear_pen_release. |
|---|
| 68 | 70 | * |
|---|
| 69 | | - * Note that "pen_release" is the hardware CPU ID, whereas |
|---|
| 71 | + * Note that "spear_pen_release" is the hardware CPU ID, whereas |
|---|
| 70 | 72 | * "cpu" is Linux's internal ID. |
|---|
| 71 | 73 | */ |
|---|
| 72 | | - write_pen_release(cpu); |
|---|
| 74 | + spear_write_pen_release(cpu); |
|---|
| 73 | 75 | |
|---|
| 74 | 76 | timeout = jiffies + (1 * HZ); |
|---|
| 75 | 77 | while (time_before(jiffies, timeout)) { |
|---|
| 76 | 78 | smp_rmb(); |
|---|
| 77 | | - if (pen_release == -1) |
|---|
| 79 | + if (spear_pen_release == -1) |
|---|
| 78 | 80 | break; |
|---|
| 79 | 81 | |
|---|
| 80 | 82 | udelay(10); |
|---|
| .. | .. |
|---|
| 86 | 88 | */ |
|---|
| 87 | 89 | spin_unlock(&boot_lock); |
|---|
| 88 | 90 | |
|---|
| 89 | | - return pen_release != -1 ? -ENOSYS : 0; |
|---|
| 91 | + return spear_pen_release != -1 ? -ENOSYS : 0; |
|---|
| 90 | 92 | } |
|---|
| 91 | 93 | |
|---|
| 92 | 94 | /* |
|---|