blob: 1038949a99a177a0c5e4429be113332268f20f29 [file] [log] [blame]
Vineet Guptac121c502013-01-18 15:12:20 +05301/*
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>
Vineet Guptaee36d172013-01-18 15:12:20 +053013#include <linux/device.h>
Vineet Guptac121c502013-01-18 15:12:20 +053014#include <linux/platform_device.h>
Vineet Gupta7fadc1e2013-01-18 15:12:24 +053015#include <linux/io.h>
Vineet Guptaee36d172013-01-18 15:12:20 +053016#include <linux/console.h>
Vineet Guptaabe11dd2013-01-18 15:12:21 +053017#include <linux/of_platform.h>
Vineet Guptaee36d172013-01-18 15:12:20 +053018#include <asm/setup.h>
Vineet Guptaee36d172013-01-18 15:12:20 +053019#include <asm/clk.h>
Vineet Gupta877768c2013-01-23 16:32:48 +053020#include <asm/mach_desc.h>
Vineet Guptaee36d172013-01-18 15:12:20 +053021#include <plat/memmap.h>
Vineet Gupta877768c2013-01-23 16:32:48 +053022#include <plat/smp.h>
Vineet Guptae97ff122013-01-18 15:12:26 +053023#include <plat/irq.h>
Vineet Guptaee36d172013-01-18 15:12:20 +053024
Vineet Gupta877768c2013-01-23 16:32:48 +053025static void __init plat_fpga_early_init(void)
Vineet Guptac121c502013-01-18 15:12:20 +053026{
27 pr_info("[plat-arcfpga]: registering early dev resources\n");
Vineet Guptaee36d172013-01-18 15:12:20 +053028
Vineet Gupta9a091d92014-02-28 16:13:44 +080029#ifdef CONFIG_ISS_SMP_EXTN
Vineet Guptab830cde2013-01-18 15:12:26 +053030 iss_model_init_early_smp();
31#endif
Vineet Guptac121c502013-01-18 15:12:20 +053032}
33
Vineet Gupta877768c2013-01-23 16:32:48 +053034static void __init plat_fpga_populate_dev(void)
Vineet Guptac121c502013-01-18 15:12:20 +053035{
Vineet Guptaabe11dd2013-01-18 15:12:21 +053036 /*
37 * Traverses flattened DeviceTree - registering platform devices
Vineet Gupta1b9bff72014-06-24 13:55:13 +053038 * (if any) complete with their resources
Vineet Guptaabe11dd2013-01-18 15:12:21 +053039 */
Vineet Gupta1b9bff72014-06-24 13:55:13 +053040 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
Vineet Guptac121c502013-01-18 15:12:20 +053041}
Vineet Gupta877768c2013-01-23 16:32:48 +053042
43/*----------------------- Machine Descriptions ------------------------------
44 *
45 * Machine description is simply a set of platform/board specific callbacks
46 * This is not directly related to DeviceTree based dynamic device creation,
47 * however as part of early device tree scan, we also select the right
48 * callback set, by matching the DT compatible name.
49 */
50
Mischa Jonker18bff652014-01-27 15:34:17 +010051static const char *aa4_compat[] __initconst = {
Vineet Gupta877768c2013-01-23 16:32:48 +053052 "snps,arc-angel4",
53 NULL,
54};
55
56MACHINE_START(ANGEL4, "angel4")
57 .dt_compat = aa4_compat,
58 .init_early = plat_fpga_early_init,
59 .init_machine = plat_fpga_populate_dev,
Vineet Gupta9a091d92014-02-28 16:13:44 +080060#ifdef CONFIG_ISS_SMP_EXTN
Vineet Gupta877768c2013-01-23 16:32:48 +053061 .init_smp = iss_model_init_smp,
62#endif
63MACHINE_END
64
Mischa Jonker18bff652014-01-27 15:34:17 +010065static const char *ml509_compat[] __initconst = {
Vineet Gupta877768c2013-01-23 16:32:48 +053066 "snps,arc-ml509",
67 NULL,
68};
69
70MACHINE_START(ML509, "ml509")
71 .dt_compat = ml509_compat,
72 .init_early = plat_fpga_early_init,
73 .init_machine = plat_fpga_populate_dev,
Vineet Gupta877768c2013-01-23 16:32:48 +053074#ifdef CONFIG_SMP
75 .init_smp = iss_model_init_smp,
76#endif
77MACHINE_END
Mischa Jonkera92a5d02013-04-18 11:40:39 +020078
Mischa Jonker18bff652014-01-27 15:34:17 +010079static const char *nsimosci_compat[] __initconst = {
Mischa Jonkera92a5d02013-04-18 11:40:39 +020080 "snps,nsimosci",
81 NULL,
82};
83
84MACHINE_START(NSIMOSCI, "nsimosci")
85 .dt_compat = nsimosci_compat,
86 .init_early = NULL,
87 .init_machine = plat_fpga_populate_dev,
Mischa Jonkera92a5d02013-04-18 11:40:39 +020088MACHINE_END