blob: 2b5f7ac001a3326a160c346b9a3a0706d9e3c858 [file] [log] [blame]
Russell King59ac59f2010-02-11 21:56:07 +00001/*
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 King59ac59f2010-02-11 21:56:07 +000013#include <linux/smp.h>
14#include <linux/io.h>
15
Russell King59ac59f2010-02-11 21:56:07 +000016#include <asm/unified.h>
17
Russell King59ac59f2010-02-11 21:56:07 +000018#include <mach/motherboard.h>
19#define V2M_PA_CS7 0x10000000
20
21#include "core.h"
22
Russell King0462b442011-01-19 10:24:56 +000023extern void versatile_secondary_startup(void);
Russell King3705ff62010-12-18 10:53:12 +000024
Russell King59ac59f2010-02-11 21:56:07 +000025/*
26 * Initialise the CPU possible map early - this describes the CPUs
27 * which may be present or become present in the system.
28 */
29void __init smp_init_cpus(void)
30{
Will Deacon80b5efb2011-02-28 17:01:04 +010031 ct_desc->init_cpu_map();
Russell King59ac59f2010-02-11 21:56:07 +000032}
33
Russell King05c74a62010-12-03 11:09:48 +000034void __init platform_smp_prepare_cpus(unsigned int max_cpus)
Russell King59ac59f2010-02-11 21:56:07 +000035{
Russell King59ac59f2010-02-11 21:56:07 +000036 /*
37 * Initialise the present map, which describes the set of CPUs
38 * actually populated at the present time.
39 */
Will Deacon80b5efb2011-02-28 17:01:04 +010040 ct_desc->smp_enable(max_cpus);
Russell King05c74a62010-12-03 11:09:48 +000041
Russell King59ac59f2010-02-11 21:56:07 +000042 /*
Russell King05c74a62010-12-03 11:09:48 +000043 * Write the address of secondary startup into the
44 * system-wide flags register. The boot monitor waits
45 * until it receives a soft interrupt, and then the
46 * secondary CPU branches to this address.
Russell King59ac59f2010-02-11 21:56:07 +000047 */
Russell King05c74a62010-12-03 11:09:48 +000048 writel(~0, MMIO_P2V(V2M_SYS_FLAGSCLR));
Russell King0462b442011-01-19 10:24:56 +000049 writel(BSYM(virt_to_phys(versatile_secondary_startup)),
Russell King05c74a62010-12-03 11:09:48 +000050 MMIO_P2V(V2M_SYS_FLAGSSET));
Russell King59ac59f2010-02-11 21:56:07 +000051}