sunxi.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Device Tree support for Allwinner A1X SoCs
  3. *
  4. * Copyright (C) 2012 Maxime Ripard
  5. *
  6. * Maxime Ripard <maxime.ripard@free-electrons.com>
  7. *
  8. * This file is licensed under the terms of the GNU General Public
  9. * License version 2. This program is licensed "as is" without any
  10. * warranty of any kind, whether express or implied.
  11. */
  12. #include <linux/clk-provider.h>
  13. #include <linux/clocksource.h>
  14. #include <linux/init.h>
  15. #include <linux/platform_device.h>
  16. #include <asm/mach/arch.h>
  17. #include <asm/secure_cntvoff.h>
  18. static const char * const sunxi_board_dt_compat[] = {
  19. "allwinner,sun4i-a10",
  20. "allwinner,sun5i-a10s",
  21. "allwinner,sun5i-a13",
  22. "allwinner,sun5i-r8",
  23. "nextthing,gr8",
  24. NULL,
  25. };
  26. DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
  27. .dt_compat = sunxi_board_dt_compat,
  28. MACHINE_END
  29. static const char * const sun6i_board_dt_compat[] = {
  30. "allwinner,sun6i-a31",
  31. "allwinner,sun6i-a31s",
  32. NULL,
  33. };
  34. extern void __init sun6i_reset_init(void);
  35. static void __init sun6i_timer_init(void)
  36. {
  37. of_clk_init(NULL);
  38. if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
  39. sun6i_reset_init();
  40. timer_probe();
  41. }
  42. DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
  43. .init_time = sun6i_timer_init,
  44. .dt_compat = sun6i_board_dt_compat,
  45. MACHINE_END
  46. static const char * const sun7i_board_dt_compat[] = {
  47. "allwinner,sun7i-a20",
  48. NULL,
  49. };
  50. DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
  51. .dt_compat = sun7i_board_dt_compat,
  52. MACHINE_END
  53. static const char * const sun8i_board_dt_compat[] = {
  54. "allwinner,sun8i-a23",
  55. "allwinner,sun8i-a33",
  56. "allwinner,sun8i-h2-plus",
  57. "allwinner,sun8i-h3",
  58. "allwinner,sun8i-r40",
  59. "allwinner,sun8i-v3s",
  60. NULL,
  61. };
  62. DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
  63. .init_time = sun6i_timer_init,
  64. .dt_compat = sun8i_board_dt_compat,
  65. MACHINE_END
  66. static void __init sun8i_a83t_cntvoff_init(void)
  67. {
  68. #ifdef CONFIG_SMP
  69. secure_cntvoff_init();
  70. #endif
  71. }
  72. static const char * const sun8i_a83t_cntvoff_board_dt_compat[] = {
  73. "allwinner,sun8i-a83t",
  74. NULL,
  75. };
  76. DT_MACHINE_START(SUN8I_A83T_CNTVOFF_DT, "Allwinner A83t board")
  77. .init_early = sun8i_a83t_cntvoff_init,
  78. .init_time = sun6i_timer_init,
  79. .dt_compat = sun8i_a83t_cntvoff_board_dt_compat,
  80. MACHINE_END
  81. static const char * const sun9i_board_dt_compat[] = {
  82. "allwinner,sun9i-a80",
  83. NULL,
  84. };
  85. DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
  86. .dt_compat = sun9i_board_dt_compat,
  87. MACHINE_END