blob: 06da2747a90bc21dec68ada963250833c69af898 [file] [log] [blame]
Maxime Ripard3b526342012-11-08 12:40:16 +01001/*
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
Maxime Ripard751b2ac2013-10-05 14:53:48 +020013#include <linux/clocksource.h>
Maxime Ripardd767af52014-06-29 15:48:53 +020014#include <linux/init.h>
Geert Uytterhoeven614215c2020-02-12 11:08:29 +010015#include <linux/of_clk.h>
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080016#include <linux/platform_device.h>
Philipp Zabelfdce60782018-12-13 12:22:32 +010017#include <linux/reset/sunxi.h>
Maxime Ripard3b526342012-11-08 12:40:16 +010018
Maxime Ripard3b526342012-11-08 12:40:16 +010019#include <asm/mach/arch.h>
Mylène Josserand46ebbfc2018-05-04 21:05:40 +020020#include <asm/secure_cntvoff.h>
Maxime Ripardbc34b5f2013-03-11 20:21:11 +010021
Maxime Ripard3b526342012-11-08 12:40:16 +010022static const char * const sunxi_board_dt_compat[] = {
Maxime Ripard43880f72012-12-18 15:17:12 +010023 "allwinner,sun4i-a10",
Maxime Ripard81265df2013-06-09 09:40:05 +020024 "allwinner,sun5i-a10s",
Maxime Ripard43880f72012-12-18 15:17:12 +010025 "allwinner,sun5i-a13",
Maxime Ripardbef62292015-06-09 19:38:04 +020026 "allwinner,sun5i-r8",
Maxime Ripardc1efda12016-09-08 12:26:08 +020027 "nextthing,gr8",
Maxime Ripard3b526342012-11-08 12:40:16 +010028 NULL,
29};
30
Maxime Ripardbef62292015-06-09 19:38:04 +020031DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
Maxime Ripard3b526342012-11-08 12:40:16 +010032 .dt_compat = sunxi_board_dt_compat,
33MACHINE_END
Maxime Ripard91a31972013-08-11 14:35:08 +020034
35static const char * const sun6i_board_dt_compat[] = {
36 "allwinner,sun6i-a31",
Hans de Goedeb0f2faa2014-12-17 18:18:14 +010037 "allwinner,sun6i-a31s",
Maxime Ripard91a31972013-08-11 14:35:08 +020038 NULL,
39};
40
Maxime Ripard751b2ac2013-10-05 14:53:48 +020041static void __init sun6i_timer_init(void)
42{
43 of_clk_init(NULL);
Arnd Bergmanne58cf012014-05-26 17:14:57 +020044 if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
45 sun6i_reset_init();
Daniel Lezcanoba5d08c2017-05-26 17:40:46 +020046 timer_probe();
Maxime Ripard751b2ac2013-10-05 14:53:48 +020047}
48
Maxime Ripard91a31972013-08-11 14:35:08 +020049DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
Maxime Ripard751b2ac2013-10-05 14:53:48 +020050 .init_time = sun6i_timer_init,
Maxime Ripard91a31972013-08-11 14:35:08 +020051 .dt_compat = sun6i_board_dt_compat,
52MACHINE_END
53
54static const char * const sun7i_board_dt_compat[] = {
55 "allwinner,sun7i-a20",
56 NULL,
57};
58
59DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
Maxime Ripard91a31972013-08-11 14:35:08 +020060 .dt_compat = sun7i_board_dt_compat,
Maxime Ripard3b526342012-11-08 12:40:16 +010061MACHINE_END
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080062
63static const char * const sun8i_board_dt_compat[] = {
64 "allwinner,sun8i-a23",
Vishnu Patekar159870d2015-05-30 16:55:01 +020065 "allwinner,sun8i-a33",
Icenowy Zheng16fa9622016-12-02 23:05:12 +080066 "allwinner,sun8i-h2-plus",
Jens Kuske14a882d2015-05-15 18:38:55 +020067 "allwinner,sun8i-h3",
Icenowy Zheng14e25a02017-08-22 13:23:22 +080068 "allwinner,sun8i-r40",
Icenowy Zhengb074fed2017-01-20 01:54:44 +080069 "allwinner,sun8i-v3s",
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080070 NULL,
71};
72
Jens Kuske14a882d2015-05-15 18:38:55 +020073DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
74 .init_time = sun6i_timer_init,
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080075 .dt_compat = sun8i_board_dt_compat,
76MACHINE_END
Chen-Yu Tsai3d4c2f12014-10-08 21:02:52 +080077
Mylène Josserand46ebbfc2018-05-04 21:05:40 +020078static void __init sun8i_a83t_cntvoff_init(void)
79{
80#ifdef CONFIG_SMP
81 secure_cntvoff_init();
82#endif
83}
84
85static const char * const sun8i_a83t_cntvoff_board_dt_compat[] = {
86 "allwinner,sun8i-a83t",
87 NULL,
88};
89
90DT_MACHINE_START(SUN8I_A83T_CNTVOFF_DT, "Allwinner A83t board")
91 .init_early = sun8i_a83t_cntvoff_init,
92 .init_time = sun6i_timer_init,
93 .dt_compat = sun8i_a83t_cntvoff_board_dt_compat,
94MACHINE_END
95
Chen-Yu Tsai3d4c2f12014-10-08 21:02:52 +080096static const char * const sun9i_board_dt_compat[] = {
97 "allwinner,sun9i-a80",
98 NULL,
99};
100
101DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
102 .dt_compat = sun9i_board_dt_compat,
103MACHINE_END
Mesih Kilincba08dcc2018-12-02 23:23:37 +0300104
105static const char * const suniv_board_dt_compat[] = {
106 "allwinner,suniv-f1c100s",
107 NULL,
108};
109
110DT_MACHINE_START(SUNIV_DT, "Allwinner suniv Family")
111 .dt_compat = suniv_board_dt_compat,
112MACHINE_END