aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-05-16 06:51:14 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-05-17 14:00:37 -0400
commita8cbcd92bd4bf893085eddf7f58e63ea98503d94 (patch)
tree7798cd1487362208793632f4ff0b4a6f579eb0ec /arch/arm/kernel
parent49613d4d9ae759193915823e67de546fca58c951 (diff)
[ARM] smp: separate SCU support code from realview
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/smp_scu.c41
2 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 11a5197a221f..90ffbaf23b4e 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_ARTHUR) += arthur.o
22obj-$(CONFIG_ISA_DMA) += dma-isa.o 22obj-$(CONFIG_ISA_DMA) += dma-isa.o
23obj-$(CONFIG_PCI) += bios32.o isa.o 23obj-$(CONFIG_PCI) += bios32.o isa.o
24obj-$(CONFIG_SMP) += smp.o 24obj-$(CONFIG_SMP) += smp.o
25obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
25obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 26obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
26obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o 27obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
27obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o 28obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o
diff --git a/arch/arm/kernel/smp_scu.c b/arch/arm/kernel/smp_scu.c
new file mode 100644
index 000000000000..7f24ee9d7330
--- /dev/null
+++ b/arch/arm/kernel/smp_scu.c
@@ -0,0 +1,41 @@
1/*
2 * linux/arch/arm/kernel/smp_scu.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/io.h>
13
14#include <asm/smp_scu.h>
15
16#define SCU_CTRL 0x00
17#define SCU_CONFIG 0x04
18#define SCU_CPU_STATUS 0x08
19#define SCU_INVALIDATE 0x0c
20#define SCU_FPGA_REVISION 0x10
21
22/*
23 * Get the number of CPU cores from the SCU configuration
24 */
25unsigned int __init scu_get_core_count(void __iomem *scu_base)
26{
27 unsigned int ncores = __raw_readl(scu_base + SCU_CONFIG);
28 return (ncores & 0x03) + 1;
29}
30
31/*
32 * Enable the SCU
33 */
34void __init scu_enable(void __iomem *scu_base)
35{
36 u32 scu_ctrl;
37
38 scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
39 scu_ctrl |= 1;
40 __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
41}