sunxi.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * Device Tree support for Allwinner A1X SoCs
  4. *
  5. * Copyright (C) 2012 Maxime Ripard
  6. *
  7. * Maxime Ripard <[email protected]>
  8. *
  9. */
  10. #include <linux/clocksource.h>
  11. #include <linux/init.h>
  12. #include <linux/of_clk.h>
  13. #include <linux/platform_device.h>
  14. #include <linux/reset/sunxi.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/secure_cntvoff.h>
  17. static const char * const sunxi_board_dt_compat[] = {
  18. "allwinner,sun4i-a10",
  19. "allwinner,sun5i-a10s",
  20. "allwinner,sun5i-a13",
  21. "allwinner,sun5i-r8",
  22. "nextthing,gr8",
  23. NULL,
  24. };
  25. DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
  26. .dt_compat = sunxi_board_dt_compat,
  27. MACHINE_END
  28. static const char * const sun6i_board_dt_compat[] = {
  29. "allwinner,sun6i-a31",
  30. "allwinner,sun6i-a31s",
  31. NULL,
  32. };
  33. static void __init sun6i_timer_init(void)
  34. {
  35. of_clk_init(NULL);
  36. if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
  37. sun6i_reset_init();
  38. timer_probe();
  39. }
  40. DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
  41. .init_time = sun6i_timer_init,
  42. .dt_compat = sun6i_board_dt_compat,
  43. MACHINE_END
  44. static const char * const sun7i_board_dt_compat[] = {
  45. "allwinner,sun7i-a20",
  46. NULL,
  47. };
  48. DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
  49. .dt_compat = sun7i_board_dt_compat,
  50. MACHINE_END
  51. static const char * const sun8i_board_dt_compat[] = {
  52. "allwinner,sun8i-a23",
  53. "allwinner,sun8i-a33",
  54. "allwinner,sun8i-h2-plus",
  55. "allwinner,sun8i-h3",
  56. "allwinner,sun8i-r40",
  57. "allwinner,sun8i-v3",
  58. "allwinner,sun8i-v3s",
  59. NULL,
  60. };
  61. DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
  62. .init_time = sun6i_timer_init,
  63. .dt_compat = sun8i_board_dt_compat,
  64. MACHINE_END
  65. static void __init sun8i_a83t_cntvoff_init(void)
  66. {
  67. #ifdef CONFIG_SMP
  68. secure_cntvoff_init();
  69. #endif
  70. }
  71. static const char * const sun8i_a83t_cntvoff_board_dt_compat[] = {
  72. "allwinner,sun8i-a83t",
  73. NULL,
  74. };
  75. DT_MACHINE_START(SUN8I_A83T_CNTVOFF_DT, "Allwinner A83t board")
  76. .init_early = sun8i_a83t_cntvoff_init,
  77. .init_time = sun6i_timer_init,
  78. .dt_compat = sun8i_a83t_cntvoff_board_dt_compat,
  79. MACHINE_END
  80. static const char * const sun9i_board_dt_compat[] = {
  81. "allwinner,sun9i-a80",
  82. NULL,
  83. };
  84. DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
  85. .dt_compat = sun9i_board_dt_compat,
  86. MACHINE_END
  87. static const char * const suniv_board_dt_compat[] = {
  88. "allwinner,suniv-f1c100s",
  89. NULL,
  90. };
  91. DT_MACHINE_START(SUNIV_DT, "Allwinner suniv Family")
  92. .dt_compat = suniv_board_dt_compat,
  93. MACHINE_END