sama5.c 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /*
  2. * Setup code for SAMA5
  3. *
  4. * Copyright (C) 2013 Atmel,
  5. * 2013 Ludovic Desroches <ludovic.desroches@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/mach/map.h>
  13. #include <asm/system_misc.h>
  14. #include "generic.h"
  15. #include "soc.h"
  16. static const struct at91_soc sama5_socs[] = {
  17. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D21CU_EXID_MATCH,
  18. "sama5d21", "sama5d2"),
  19. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D22CU_EXID_MATCH,
  20. "sama5d22", "sama5d2"),
  21. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D23CU_EXID_MATCH,
  22. "sama5d23", "sama5d2"),
  23. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CX_EXID_MATCH,
  24. "sama5d24", "sama5d2"),
  25. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D24CU_EXID_MATCH,
  26. "sama5d24", "sama5d2"),
  27. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D26CU_EXID_MATCH,
  28. "sama5d26", "sama5d2"),
  29. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CU_EXID_MATCH,
  30. "sama5d27", "sama5d2"),
  31. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D27CN_EXID_MATCH,
  32. "sama5d27", "sama5d2"),
  33. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CU_EXID_MATCH,
  34. "sama5d28", "sama5d2"),
  35. AT91_SOC(SAMA5D2_CIDR_MATCH, SAMA5D28CN_EXID_MATCH,
  36. "sama5d28", "sama5d2"),
  37. AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D31_EXID_MATCH,
  38. "sama5d31", "sama5d3"),
  39. AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D33_EXID_MATCH,
  40. "sama5d33", "sama5d3"),
  41. AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D34_EXID_MATCH,
  42. "sama5d34", "sama5d3"),
  43. AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D35_EXID_MATCH,
  44. "sama5d35", "sama5d3"),
  45. AT91_SOC(SAMA5D3_CIDR_MATCH, SAMA5D36_EXID_MATCH,
  46. "sama5d36", "sama5d3"),
  47. AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D41_EXID_MATCH,
  48. "sama5d41", "sama5d4"),
  49. AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D42_EXID_MATCH,
  50. "sama5d42", "sama5d4"),
  51. AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D43_EXID_MATCH,
  52. "sama5d43", "sama5d4"),
  53. AT91_SOC(SAMA5D4_CIDR_MATCH, SAMA5D44_EXID_MATCH,
  54. "sama5d44", "sama5d4"),
  55. { /* sentinel */ },
  56. };
  57. static void __init sama5_dt_device_init(void)
  58. {
  59. struct soc_device *soc;
  60. struct device *soc_dev = NULL;
  61. soc = at91_soc_init(sama5_socs);
  62. if (soc != NULL)
  63. soc_dev = soc_device_to_device(soc);
  64. of_platform_default_populate(NULL, NULL, soc_dev);
  65. sama5_pm_init();
  66. }
  67. static const char *const sama5_dt_board_compat[] __initconst = {
  68. "atmel,sama5",
  69. NULL
  70. };
  71. DT_MACHINE_START(sama5_dt, "Atmel SAMA5")
  72. /* Maintainer: Atmel */
  73. .init_machine = sama5_dt_device_init,
  74. .dt_compat = sama5_dt_board_compat,
  75. MACHINE_END
  76. static const char *const sama5_alt_dt_board_compat[] __initconst = {
  77. "atmel,sama5d2",
  78. "atmel,sama5d4",
  79. NULL
  80. };
  81. DT_MACHINE_START(sama5_alt_dt, "Atmel SAMA5")
  82. /* Maintainer: Atmel */
  83. .init_machine = sama5_dt_device_init,
  84. .dt_compat = sama5_alt_dt_board_compat,
  85. .l2c_aux_mask = ~0UL,
  86. MACHINE_END