Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 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> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 13 | #include <linux/device.h> |
Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 14 | #include <linux/platform_device.h> |
Vineet Gupta | 7fadc1e | 2013-01-18 15:12:24 +0530 | [diff] [blame] | 15 | #include <linux/io.h> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 16 | #include <linux/console.h> |
Vineet Gupta | abe11dd | 2013-01-18 15:12:21 +0530 | [diff] [blame] | 17 | #include <linux/of_platform.h> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 18 | #include <asm/setup.h> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 19 | #include <asm/clk.h> |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 20 | #include <asm/mach_desc.h> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 21 | #include <plat/memmap.h> |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 22 | #include <plat/smp.h> |
Vineet Gupta | e97ff12 | 2013-01-18 15:12:26 +0530 | [diff] [blame] | 23 | #include <plat/irq.h> |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 24 | |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 25 | static void __init plat_fpga_early_init(void) |
Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 26 | { |
| 27 | pr_info("[plat-arcfpga]: registering early dev resources\n"); |
Vineet Gupta | ee36d17 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 28 | |
Vineet Gupta | 9a091d9 | 2014-02-28 16:13:44 +0800 | [diff] [blame] | 29 | #ifdef CONFIG_ISS_SMP_EXTN |
Vineet Gupta | b830cde | 2013-01-18 15:12:26 +0530 | [diff] [blame] | 30 | iss_model_init_early_smp(); |
| 31 | #endif |
Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 32 | } |
| 33 | |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 34 | static void __init plat_fpga_populate_dev(void) |
Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 35 | { |
Vineet Gupta | abe11dd | 2013-01-18 15:12:21 +0530 | [diff] [blame] | 36 | /* |
| 37 | * Traverses flattened DeviceTree - registering platform devices |
Vineet Gupta | 1b9bff7 | 2014-06-24 13:55:13 +0530 | [diff] [blame] | 38 | * (if any) complete with their resources |
Vineet Gupta | abe11dd | 2013-01-18 15:12:21 +0530 | [diff] [blame] | 39 | */ |
Vineet Gupta | 1b9bff7 | 2014-06-24 13:55:13 +0530 | [diff] [blame] | 40 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
Vineet Gupta | c121c50 | 2013-01-18 15:12:20 +0530 | [diff] [blame] | 41 | } |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 42 | |
| 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 Jonker | 18bff65 | 2014-01-27 15:34:17 +0100 | [diff] [blame] | 51 | static const char *aa4_compat[] __initconst = { |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 52 | "snps,arc-angel4", |
| 53 | NULL, |
| 54 | }; |
| 55 | |
| 56 | MACHINE_START(ANGEL4, "angel4") |
| 57 | .dt_compat = aa4_compat, |
| 58 | .init_early = plat_fpga_early_init, |
| 59 | .init_machine = plat_fpga_populate_dev, |
Vineet Gupta | 9a091d9 | 2014-02-28 16:13:44 +0800 | [diff] [blame] | 60 | #ifdef CONFIG_ISS_SMP_EXTN |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 61 | .init_smp = iss_model_init_smp, |
| 62 | #endif |
| 63 | MACHINE_END |
| 64 | |
Mischa Jonker | 18bff65 | 2014-01-27 15:34:17 +0100 | [diff] [blame] | 65 | static const char *ml509_compat[] __initconst = { |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 66 | "snps,arc-ml509", |
| 67 | NULL, |
| 68 | }; |
| 69 | |
| 70 | MACHINE_START(ML509, "ml509") |
| 71 | .dt_compat = ml509_compat, |
| 72 | .init_early = plat_fpga_early_init, |
| 73 | .init_machine = plat_fpga_populate_dev, |
Vineet Gupta | 877768c | 2013-01-23 16:32:48 +0530 | [diff] [blame] | 74 | #ifdef CONFIG_SMP |
| 75 | .init_smp = iss_model_init_smp, |
| 76 | #endif |
| 77 | MACHINE_END |
Mischa Jonker | a92a5d0 | 2013-04-18 11:40:39 +0200 | [diff] [blame] | 78 | |
Mischa Jonker | 18bff65 | 2014-01-27 15:34:17 +0100 | [diff] [blame] | 79 | static const char *nsimosci_compat[] __initconst = { |
Mischa Jonker | a92a5d0 | 2013-04-18 11:40:39 +0200 | [diff] [blame] | 80 | "snps,nsimosci", |
| 81 | NULL, |
| 82 | }; |
| 83 | |
| 84 | MACHINE_START(NSIMOSCI, "nsimosci") |
| 85 | .dt_compat = nsimosci_compat, |
| 86 | .init_early = NULL, |
| 87 | .init_machine = plat_fpga_populate_dev, |
Mischa Jonker | a92a5d0 | 2013-04-18 11:40:39 +0200 | [diff] [blame] | 88 | MACHINE_END |