ARC: [plat*] move code out of .init_machine into common
[firefly-linux-kernel-4.4.55.git] / arch / arc / plat-arcfpga / platform.c
1 /*
2  * ARC FPGA Platform support code
3  *
4  * Copyright (C) 2012 Synopsys, Inc. (www.synopsys.com)
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10
11 #include <linux/types.h>
12 #include <linux/init.h>
13 #include <linux/device.h>
14 #include <linux/platform_device.h>
15 #include <linux/io.h>
16 #include <linux/console.h>
17 #include <asm/setup.h>
18 #include <asm/clk.h>
19 #include <asm/mach_desc.h>
20 #include <plat/memmap.h>
21 #include <plat/smp.h>
22 #include <plat/irq.h>
23
24 static void __init plat_fpga_early_init(void)
25 {
26         pr_info("[plat-arcfpga]: registering early dev resources\n");
27
28 #ifdef CONFIG_ISS_SMP_EXTN
29         iss_model_init_early_smp();
30 #endif
31 }
32
33 /*----------------------- Machine Descriptions ------------------------------
34  *
35  * Machine description is simply a set of platform/board specific callbacks
36  * This is not directly related to DeviceTree based dynamic device creation,
37  * however as part of early device tree scan, we also select the right
38  * callback set, by matching the DT compatible name.
39  */
40
41 static const char *legacy_fpga_compat[] __initconst = {
42         "snps,arc-angel4",
43         "snps,arc-ml509",
44         NULL,
45 };
46
47 MACHINE_START(LEGACY_FPGA, "legacy_fpga")
48         .dt_compat      = legacy_fpga_compat,
49         .init_early     = plat_fpga_early_init,
50 #ifdef CONFIG_ISS_SMP_EXTN
51         .init_smp       = iss_model_init_smp,
52 #endif
53 MACHINE_END
54
55 static const char *simulation_compat[] __initconst = {
56         "snps,nsim",
57         "snps,nsimosci",
58         NULL,
59 };
60
61 MACHINE_START(SIMULATION, "simulation")
62         .dt_compat      = simulation_compat,
63 MACHINE_END