aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-socfpga/socfpga.c
diff options
context:
space:
mode:
authorDinh Nguyen <dinguyen@altera.com>2012-10-25 12:41:39 -0400
committerArnd Bergmann <arnd@arndb.de>2012-10-26 08:59:39 -0400
commit9c4566a117a6fe404a0e49b27ac71b631945a70f (patch)
tree21802a1dc88b6dbd4ea39f7cc11b734c4f5465c9 /arch/arm/mach-socfpga/socfpga.c
parent6f0c0580b70c89094b3422ba81118c7b959c7556 (diff)
ARM: socfpga: Enable SMP for socfpga
Enable SMP for the SOCFPGA platform. Signed-off-by: Pavel Machek <pavel@denx.de> Signed-off-by: Dinh Nguyen <dinguyen@altera.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-socfpga/socfpga.c')
-rw-r--r--arch/arm/mach-socfpga/socfpga.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/arch/arm/mach-socfpga/socfpga.c b/arch/arm/mach-socfpga/socfpga.c
index f01e1ebf5396..ab81ea91a7c4 100644
--- a/arch/arm/mach-socfpga/socfpga.c
+++ b/arch/arm/mach-socfpga/socfpga.c
@@ -15,23 +15,64 @@
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17#include <linux/dw_apb_timer.h> 17#include <linux/dw_apb_timer.h>
18#include <linux/of_address.h>
18#include <linux/of_irq.h> 19#include <linux/of_irq.h>
19#include <linux/of_platform.h> 20#include <linux/of_platform.h>
20 21
21#include <asm/hardware/cache-l2x0.h> 22#include <asm/hardware/cache-l2x0.h>
22#include <asm/hardware/gic.h> 23#include <asm/hardware/gic.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
24 26
25extern void socfpga_init_clocks(void); 27#include "core.h"
28
29void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
30void __iomem *sys_manager_base_addr;
31void __iomem *rst_manager_base_addr;
32
33static struct map_desc scu_io_desc __initdata = {
34 .virtual = SOCFPGA_SCU_VIRT_BASE,
35 .pfn = 0, /* run-time */
36 .length = SZ_8K,
37 .type = MT_DEVICE,
38};
39
40static void __init socfpga_scu_map_io(void)
41{
42 unsigned long base;
43
44 /* Get SCU base */
45 asm("mrc p15, 4, %0, c15, c0, 0" : "=r" (base));
46
47 scu_io_desc.pfn = __phys_to_pfn(base);
48 iotable_init(&scu_io_desc, 1);
49}
50
51static void __init socfpga_map_io(void)
52{
53 socfpga_scu_map_io();
54}
26 55
27const static struct of_device_id irq_match[] = { 56const static struct of_device_id irq_match[] = {
28 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, }, 57 { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
29 {} 58 {}
30}; 59};
31 60
61void __init socfpga_sysmgr_init(void)
62{
63 struct device_node *np;
64
65 np = of_find_compatible_node(NULL, NULL, "altr,sys-mgr");
66 sys_manager_base_addr = of_iomap(np, 0);
67
68 np = of_find_compatible_node(NULL, NULL, "altr,rst-mgr");
69 rst_manager_base_addr = of_iomap(np, 0);
70}
71
32static void __init gic_init_irq(void) 72static void __init gic_init_irq(void)
33{ 73{
34 of_irq_init(irq_match); 74 of_irq_init(irq_match);
75 socfpga_sysmgr_init();
35} 76}
36 77
37static void socfpga_cyclone5_restart(char mode, const char *cmd) 78static void socfpga_cyclone5_restart(char mode, const char *cmd)
@@ -53,6 +94,8 @@ static const char *altera_dt_match[] = {
53}; 94};
54 95
55DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA") 96DT_MACHINE_START(SOCFPGA, "Altera SOCFPGA")
97 .smp = smp_ops(socfpga_smp_ops),
98 .map_io = socfpga_map_io,
56 .init_irq = gic_init_irq, 99 .init_irq = gic_init_irq,
57 .handle_irq = gic_handle_irq, 100 .handle_irq = gic_handle_irq,
58 .timer = &dw_apb_timer, 101 .timer = &dw_apb_timer,