platform.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. #include <linux/types.h>
  11. #include <linux/init.h>
  12. #include <linux/device.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/io.h>
  15. #include <linux/console.h>
  16. #include <linux/of_platform.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. static void __init plat_fpga_early_init(void)
  24. {
  25. pr_info("[plat-arcfpga]: registering early dev resources\n");
  26. #ifdef CONFIG_ISS_SMP_EXTN
  27. iss_model_init_early_smp();
  28. #endif
  29. }
  30. static void __init plat_fpga_populate_dev(void)
  31. {
  32. /*
  33. * Traverses flattened DeviceTree - registering platform devices
  34. * (if any) complete with their resources
  35. */
  36. of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
  37. }
  38. /*----------------------- Machine Descriptions ------------------------------
  39. *
  40. * Machine description is simply a set of platform/board specific callbacks
  41. * This is not directly related to DeviceTree based dynamic device creation,
  42. * however as part of early device tree scan, we also select the right
  43. * callback set, by matching the DT compatible name.
  44. */
  45. static const char *aa4_compat[] __initconst = {
  46. "snps,arc-angel4",
  47. NULL,
  48. };
  49. MACHINE_START(ANGEL4, "angel4")
  50. .dt_compat = aa4_compat,
  51. .init_early = plat_fpga_early_init,
  52. .init_machine = plat_fpga_populate_dev,
  53. #ifdef CONFIG_ISS_SMP_EXTN
  54. .init_smp = iss_model_init_smp,
  55. #endif
  56. MACHINE_END
  57. static const char *ml509_compat[] __initconst = {
  58. "snps,arc-ml509",
  59. NULL,
  60. };
  61. MACHINE_START(ML509, "ml509")
  62. .dt_compat = ml509_compat,
  63. .init_early = plat_fpga_early_init,
  64. .init_machine = plat_fpga_populate_dev,
  65. #ifdef CONFIG_SMP
  66. .init_smp = iss_model_init_smp,
  67. #endif
  68. MACHINE_END
  69. static const char *nsimosci_compat[] __initconst = {
  70. "snps,nsimosci",
  71. NULL,
  72. };
  73. MACHINE_START(NSIMOSCI, "nsimosci")
  74. .dt_compat = nsimosci_compat,
  75. .init_early = NULL,
  76. .init_machine = plat_fpga_populate_dev,
  77. MACHINE_END