sunxi.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. 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. extern void __init sun6i_reset_init(void);
  34. static void __init sun6i_timer_init(void)
  35. {
  36. of_clk_init(NULL);
  37. if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
  38. sun6i_reset_init();
  39. clocksource_probe();
  40. }
  41. DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
  42. .init_time = sun6i_timer_init,
  43. .dt_compat = sun6i_board_dt_compat,
  44. MACHINE_END
  45. static const char * const sun7i_board_dt_compat[] = {
  46. "allwinner,sun7i-a20",
  47. NULL,
  48. };
  49. DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
  50. .dt_compat = sun7i_board_dt_compat,
  51. MACHINE_END
  52. static const char * const sun8i_board_dt_compat[] = {
  53. "allwinner,sun8i-a23",
  54. "allwinner,sun8i-a33",
  55. "allwinner,sun8i-a83t",
  56. "allwinner,sun8i-h3",
  57. NULL,
  58. };
  59. DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
  60. .init_time = sun6i_timer_init,
  61. .dt_compat = sun8i_board_dt_compat,
  62. MACHINE_END
  63. static const char * const sun9i_board_dt_compat[] = {
  64. "allwinner,sun9i-a80",
  65. NULL,
  66. };
  67. DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
  68. .dt_compat = sun9i_board_dt_compat,
  69. MACHINE_END