Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-vexpress/platsmp.c |
| 3 | * |
| 4 | * Copyright (C) 2002 ARM Ltd. |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | */ |
| 11 | #include <linux/init.h> |
| 12 | #include <linux/errno.h> |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 13 | #include <linux/smp.h> |
| 14 | #include <linux/io.h> |
| 15 | |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 16 | #include <mach/motherboard.h> |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 17 | |
| 18 | #include "core.h" |
| 19 | |
Russell King | 0462b44 | 2011-01-19 10:24:56 +0000 | [diff] [blame] | 20 | extern void versatile_secondary_startup(void); |
Russell King | 3705ff6 | 2010-12-18 10:53:12 +0000 | [diff] [blame] | 21 | |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 22 | /* |
| 23 | * Initialise the CPU possible map early - this describes the CPUs |
| 24 | * which may be present or become present in the system. |
| 25 | */ |
| 26 | void __init smp_init_cpus(void) |
| 27 | { |
Will Deacon | 80b5efb | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 28 | ct_desc->init_cpu_map(); |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 29 | } |
| 30 | |
Russell King | 05c74a6 | 2010-12-03 11:09:48 +0000 | [diff] [blame] | 31 | void __init platform_smp_prepare_cpus(unsigned int max_cpus) |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 32 | { |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 33 | /* |
| 34 | * Initialise the present map, which describes the set of CPUs |
| 35 | * actually populated at the present time. |
| 36 | */ |
Will Deacon | 80b5efb | 2011-02-28 17:01:04 +0100 | [diff] [blame] | 37 | ct_desc->smp_enable(max_cpus); |
Russell King | 05c74a6 | 2010-12-03 11:09:48 +0000 | [diff] [blame] | 38 | |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 39 | /* |
Russell King | 05c74a6 | 2010-12-03 11:09:48 +0000 | [diff] [blame] | 40 | * Write the address of secondary startup into the |
| 41 | * system-wide flags register. The boot monitor waits |
| 42 | * until it receives a soft interrupt, and then the |
| 43 | * secondary CPU branches to this address. |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 44 | */ |
Pawel Moll | 98ed4ce | 2012-01-25 15:37:29 +0000 | [diff] [blame^] | 45 | v2m_flags_set(virt_to_phys(versatile_secondary_startup)); |
Russell King | 59ac59f | 2010-02-11 21:56:07 +0000 | [diff] [blame] | 46 | } |