at91sam9.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Setup code for AT91SAM9
  3. *
  4. * Copyright (C) 2011 Atmel,
  5. * 2011 Nicolas Ferre <nicolas.ferre@atmel.com>
  6. *
  7. * Licensed under GPLv2 or later.
  8. */
  9. #include <linux/of.h>
  10. #include <linux/of_platform.h>
  11. #include <asm/mach/arch.h>
  12. #include <asm/system_misc.h>
  13. #include "generic.h"
  14. #include "soc.h"
  15. static const struct at91_soc at91sam9_socs[] = {
  16. AT91_SOC(AT91SAM9260_CIDR_MATCH, 0, "at91sam9260", NULL),
  17. AT91_SOC(AT91SAM9261_CIDR_MATCH, 0, "at91sam9261", NULL),
  18. AT91_SOC(AT91SAM9263_CIDR_MATCH, 0, "at91sam9263", NULL),
  19. AT91_SOC(AT91SAM9G20_CIDR_MATCH, 0, "at91sam9g20", NULL),
  20. AT91_SOC(AT91SAM9RL64_CIDR_MATCH, 0, "at91sam9rl64", NULL),
  21. AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M11_EXID_MATCH,
  22. "at91sam9m11", "at91sam9g45"),
  23. AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9M10_EXID_MATCH,
  24. "at91sam9m10", "at91sam9g45"),
  25. AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G46_EXID_MATCH,
  26. "at91sam9g46", "at91sam9g45"),
  27. AT91_SOC(AT91SAM9G45_CIDR_MATCH, AT91SAM9G45_EXID_MATCH,
  28. "at91sam9g45", "at91sam9g45"),
  29. AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G15_EXID_MATCH,
  30. "at91sam9g15", "at91sam9x5"),
  31. AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G35_EXID_MATCH,
  32. "at91sam9g35", "at91sam9x5"),
  33. AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X35_EXID_MATCH,
  34. "at91sam9x35", "at91sam9x5"),
  35. AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9G25_EXID_MATCH,
  36. "at91sam9g25", "at91sam9x5"),
  37. AT91_SOC(AT91SAM9X5_CIDR_MATCH, AT91SAM9X25_EXID_MATCH,
  38. "at91sam9x25", "at91sam9x5"),
  39. AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN12_EXID_MATCH,
  40. "at91sam9cn12", "at91sam9n12"),
  41. AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9N12_EXID_MATCH,
  42. "at91sam9n12", "at91sam9n12"),
  43. AT91_SOC(AT91SAM9N12_CIDR_MATCH, AT91SAM9CN11_EXID_MATCH,
  44. "at91sam9cn11", "at91sam9n12"),
  45. AT91_SOC(AT91SAM9XE128_CIDR_MATCH, 0, "at91sam9xe128", "at91sam9xe128"),
  46. AT91_SOC(AT91SAM9XE256_CIDR_MATCH, 0, "at91sam9xe256", "at91sam9xe256"),
  47. AT91_SOC(AT91SAM9XE512_CIDR_MATCH, 0, "at91sam9xe512", "at91sam9xe512"),
  48. { /* sentinel */ },
  49. };
  50. static void __init at91sam9_common_init(void)
  51. {
  52. struct soc_device *soc;
  53. struct device *soc_dev = NULL;
  54. soc = at91_soc_init(at91sam9_socs);
  55. if (soc != NULL)
  56. soc_dev = soc_device_to_device(soc);
  57. of_platform_default_populate(NULL, NULL, soc_dev);
  58. }
  59. static void __init at91sam9_dt_device_init(void)
  60. {
  61. at91sam9_common_init();
  62. at91sam9260_pm_init();
  63. }
  64. static const char *const at91_dt_board_compat[] __initconst = {
  65. "atmel,at91sam9",
  66. NULL
  67. };
  68. DT_MACHINE_START(at91sam_dt, "Atmel AT91SAM9")
  69. /* Maintainer: Atmel */
  70. .init_machine = at91sam9_dt_device_init,
  71. .dt_compat = at91_dt_board_compat,
  72. MACHINE_END
  73. static void __init at91sam9g45_dt_device_init(void)
  74. {
  75. at91sam9_common_init();
  76. at91sam9g45_pm_init();
  77. }
  78. static const char *const at91sam9g45_board_compat[] __initconst = {
  79. "atmel,at91sam9g45",
  80. NULL
  81. };
  82. DT_MACHINE_START(at91sam9g45_dt, "Atmel AT91SAM9G45")
  83. /* Maintainer: Atmel */
  84. .init_machine = at91sam9g45_dt_device_init,
  85. .dt_compat = at91sam9g45_board_compat,
  86. MACHINE_END
  87. static void __init at91sam9x5_dt_device_init(void)
  88. {
  89. at91sam9_common_init();
  90. at91sam9x5_pm_init();
  91. }
  92. static const char *const at91sam9x5_board_compat[] __initconst = {
  93. "atmel,at91sam9x5",
  94. "atmel,at91sam9n12",
  95. NULL
  96. };
  97. DT_MACHINE_START(at91sam9x5_dt, "Atmel AT91SAM9")
  98. /* Maintainer: Atmel */
  99. .init_machine = at91sam9x5_dt_device_init,
  100. .dt_compat = at91sam9x5_board_compat,
  101. MACHINE_END