Merge remote-tracking branch 'lsk/v3.10/topic/of' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-prima2 / common.c
1 /*
2  * Defines machines for CSR SiRFprimaII
3  *
4  * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
5  *
6  * Licensed under GPLv2 or later.
7  */
8
9 #include <linux/clocksource.h>
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/irqchip.h>
13 #include <asm/sizes.h>
14 #include <asm/mach-types.h>
15 #include <asm/mach/arch.h>
16 #include <linux/of.h>
17 #include <linux/of_platform.h>
18 #include "common.h"
19
20 static struct of_device_id sirfsoc_of_bus_ids[] __initdata = {
21         { .compatible = "simple-bus", },
22         {},
23 };
24
25 void __init sirfsoc_mach_init(void)
26 {
27         of_platform_bus_probe(NULL, sirfsoc_of_bus_ids, NULL);
28 }
29
30 void __init sirfsoc_init_late(void)
31 {
32         sirfsoc_pm_init();
33 }
34
35 static __init void sirfsoc_init_time(void)
36 {
37         /* initialize clocking early, we want to set the OS timer */
38         sirfsoc_of_clk_init();
39         clocksource_of_init();
40 }
41
42 static __init void sirfsoc_map_io(void)
43 {
44         sirfsoc_map_lluart();
45         sirfsoc_map_scu();
46 }
47
48 #ifdef CONFIG_ARCH_ATLAS6
49 static const char *atlas6_dt_match[] __initdata = {
50         "sirf,atlas6",
51         NULL
52 };
53
54 DT_MACHINE_START(ATLAS6_DT, "Generic ATLAS6 (Flattened Device Tree)")
55         /* Maintainer: Barry Song <baohua.song@csr.com> */
56         .nr_irqs        = 128,
57         .map_io         = sirfsoc_map_io,
58         .init_irq       = irqchip_init,
59         .init_time      = sirfsoc_init_time,
60         .init_machine   = sirfsoc_mach_init,
61         .init_late      = sirfsoc_init_late,
62         .dt_compat      = atlas6_dt_match,
63         .restart        = sirfsoc_restart,
64 MACHINE_END
65 #endif
66
67 #ifdef CONFIG_ARCH_PRIMA2
68 static const char *prima2_dt_match[] __initdata = {
69        "sirf,prima2",
70        NULL
71 };
72
73 DT_MACHINE_START(PRIMA2_DT, "Generic PRIMA2 (Flattened Device Tree)")
74         /* Maintainer: Barry Song <baohua.song@csr.com> */
75         .nr_irqs        = 128,
76         .map_io         = sirfsoc_map_io,
77         .init_irq       = irqchip_init,
78         .init_time      = sirfsoc_init_time,
79         .dma_zone_size  = SZ_256M,
80         .init_machine   = sirfsoc_mach_init,
81         .init_late      = sirfsoc_init_late,
82         .dt_compat      = prima2_dt_match,
83         .restart        = sirfsoc_restart,
84 MACHINE_END
85 #endif
86
87 #ifdef CONFIG_ARCH_MARCO
88 static const char *marco_dt_match[] __initdata = {
89         "sirf,marco",
90         NULL
91 };
92
93 DT_MACHINE_START(MARCO_DT, "Generic MARCO (Flattened Device Tree)")
94         /* Maintainer: Barry Song <baohua.song@csr.com> */
95         .smp            = smp_ops(sirfsoc_smp_ops),
96         .map_io         = sirfsoc_map_io,
97         .init_irq       = irqchip_init,
98         .init_time      = sirfsoc_init_time,
99         .init_machine   = sirfsoc_mach_init,
100         .init_late      = sirfsoc_init_late,
101         .dt_compat      = marco_dt_match,
102         .restart        = sirfsoc_restart,
103 MACHINE_END
104 #endif