drm/radeon/kms: adjust eDP handling (v2)
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-realview / platsmp.c
blob23919229e12de14454945997b68941bda05e0077
1 /*
2 * linux/arch/arm/mach-realview/platsmp.c
4 * Copyright (C) 2002 ARM Ltd.
5 * All Rights Reserved
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.
11 #include <linux/init.h>
12 #include <linux/errno.h>
13 #include <linux/smp.h>
14 #include <linux/io.h>
16 #include <mach/hardware.h>
17 #include <asm/mach-types.h>
18 #include <asm/smp_scu.h>
19 #include <asm/unified.h>
21 #include <mach/board-eb.h>
22 #include <mach/board-pb11mp.h>
23 #include <mach/board-pbx.h>
25 #include "core.h"
27 extern void versatile_secondary_startup(void);
29 static void __iomem *scu_base_addr(void)
31 if (machine_is_realview_eb_mp())
32 return __io_address(REALVIEW_EB11MP_SCU_BASE);
33 else if (machine_is_realview_pb11mp())
34 return __io_address(REALVIEW_TC11MP_SCU_BASE);
35 else if (machine_is_realview_pbx() &&
36 (core_tile_pbx11mp() || core_tile_pbxa9mp()))
37 return __io_address(REALVIEW_PBX_TILE_SCU_BASE);
38 else
39 return (void __iomem *)0;
43 * Initialise the CPU possible map early - this describes the CPUs
44 * which may be present or become present in the system.
46 void __init smp_init_cpus(void)
48 void __iomem *scu_base = scu_base_addr();
49 unsigned int i, ncores;
51 ncores = scu_base ? scu_get_core_count(scu_base) : 1;
53 /* sanity check */
54 if (ncores > NR_CPUS) {
55 printk(KERN_WARNING
56 "Realview: no. of cores (%d) greater than configured "
57 "maximum of %d - clipping\n",
58 ncores, NR_CPUS);
59 ncores = NR_CPUS;
62 for (i = 0; i < ncores; i++)
63 set_cpu_possible(i, true);
66 void __init platform_smp_prepare_cpus(unsigned int max_cpus)
68 int i;
71 * Initialise the present map, which describes the set of CPUs
72 * actually populated at the present time.
74 for (i = 0; i < max_cpus; i++)
75 set_cpu_present(i, true);
77 scu_enable(scu_base_addr());
80 * Write the address of secondary startup into the
81 * system-wide flags register. The BootMonitor waits
82 * until it receives a soft interrupt, and then the
83 * secondary CPU branches to this address.
85 __raw_writel(BSYM(virt_to_phys(versatile_secondary_startup)),
86 __io_address(REALVIEW_SYS_FLAGSSET));