Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 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 | |
Maxime Ripard | 751b2ac | 2013-10-05 14:53:48 +0200 | [diff] [blame] | 13 | #include <linux/clocksource.h> |
Maxime Ripard | d767af5 | 2014-06-29 15:48:53 +0200 | [diff] [blame] | 14 | #include <linux/init.h> |
Geert Uytterhoeven | 614215c | 2020-02-12 11:08:29 +0100 | [diff] [blame] | 15 | #include <linux/of_clk.h> |
Chen-Yu Tsai | f91b7c6 | 2015-01-06 10:35:11 +0800 | [diff] [blame] | 16 | #include <linux/platform_device.h> |
Philipp Zabel | fdce6078 | 2018-12-13 12:22:32 +0100 | [diff] [blame] | 17 | #include <linux/reset/sunxi.h> |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 18 | |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 19 | #include <asm/mach/arch.h> |
Mylène Josserand | 46ebbfc | 2018-05-04 21:05:40 +0200 | [diff] [blame] | 20 | #include <asm/secure_cntvoff.h> |
Maxime Ripard | bc34b5f | 2013-03-11 20:21:11 +0100 | [diff] [blame] | 21 | |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 22 | static const char * const sunxi_board_dt_compat[] = { |
Maxime Ripard | 43880f7 | 2012-12-18 15:17:12 +0100 | [diff] [blame] | 23 | "allwinner,sun4i-a10", |
Maxime Ripard | 81265df | 2013-06-09 09:40:05 +0200 | [diff] [blame] | 24 | "allwinner,sun5i-a10s", |
Maxime Ripard | 43880f7 | 2012-12-18 15:17:12 +0100 | [diff] [blame] | 25 | "allwinner,sun5i-a13", |
Maxime Ripard | bef6229 | 2015-06-09 19:38:04 +0200 | [diff] [blame] | 26 | "allwinner,sun5i-r8", |
Maxime Ripard | c1efda1 | 2016-09-08 12:26:08 +0200 | [diff] [blame] | 27 | "nextthing,gr8", |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 28 | NULL, |
| 29 | }; |
| 30 | |
Maxime Ripard | bef6229 | 2015-06-09 19:38:04 +0200 | [diff] [blame] | 31 | DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families") |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 32 | .dt_compat = sunxi_board_dt_compat, |
| 33 | MACHINE_END |
Maxime Ripard | 91a3197 | 2013-08-11 14:35:08 +0200 | [diff] [blame] | 34 | |
| 35 | static const char * const sun6i_board_dt_compat[] = { |
| 36 | "allwinner,sun6i-a31", |
Hans de Goede | b0f2faa | 2014-12-17 18:18:14 +0100 | [diff] [blame] | 37 | "allwinner,sun6i-a31s", |
Maxime Ripard | 91a3197 | 2013-08-11 14:35:08 +0200 | [diff] [blame] | 38 | NULL, |
| 39 | }; |
| 40 | |
Maxime Ripard | 751b2ac | 2013-10-05 14:53:48 +0200 | [diff] [blame] | 41 | static void __init sun6i_timer_init(void) |
| 42 | { |
| 43 | of_clk_init(NULL); |
Arnd Bergmann | e58cf01 | 2014-05-26 17:14:57 +0200 | [diff] [blame] | 44 | if (IS_ENABLED(CONFIG_RESET_CONTROLLER)) |
| 45 | sun6i_reset_init(); |
Daniel Lezcano | ba5d08c | 2017-05-26 17:40:46 +0200 | [diff] [blame] | 46 | timer_probe(); |
Maxime Ripard | 751b2ac | 2013-10-05 14:53:48 +0200 | [diff] [blame] | 47 | } |
| 48 | |
Maxime Ripard | 91a3197 | 2013-08-11 14:35:08 +0200 | [diff] [blame] | 49 | DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family") |
Maxime Ripard | 751b2ac | 2013-10-05 14:53:48 +0200 | [diff] [blame] | 50 | .init_time = sun6i_timer_init, |
Maxime Ripard | 91a3197 | 2013-08-11 14:35:08 +0200 | [diff] [blame] | 51 | .dt_compat = sun6i_board_dt_compat, |
| 52 | MACHINE_END |
| 53 | |
| 54 | static const char * const sun7i_board_dt_compat[] = { |
| 55 | "allwinner,sun7i-a20", |
| 56 | NULL, |
| 57 | }; |
| 58 | |
| 59 | DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family") |
Maxime Ripard | 91a3197 | 2013-08-11 14:35:08 +0200 | [diff] [blame] | 60 | .dt_compat = sun7i_board_dt_compat, |
Maxime Ripard | 3b52634 | 2012-11-08 12:40:16 +0100 | [diff] [blame] | 61 | MACHINE_END |
Chen-Yu Tsai | ac84b79 | 2014-06-20 22:52:50 +0800 | [diff] [blame] | 62 | |
| 63 | static const char * const sun8i_board_dt_compat[] = { |
| 64 | "allwinner,sun8i-a23", |
Vishnu Patekar | 159870d | 2015-05-30 16:55:01 +0200 | [diff] [blame] | 65 | "allwinner,sun8i-a33", |
Icenowy Zheng | 16fa962 | 2016-12-02 23:05:12 +0800 | [diff] [blame] | 66 | "allwinner,sun8i-h2-plus", |
Jens Kuske | 14a882d | 2015-05-15 18:38:55 +0200 | [diff] [blame] | 67 | "allwinner,sun8i-h3", |
Icenowy Zheng | 14e25a0 | 2017-08-22 13:23:22 +0800 | [diff] [blame] | 68 | "allwinner,sun8i-r40", |
Icenowy Zheng | b074fed | 2017-01-20 01:54:44 +0800 | [diff] [blame] | 69 | "allwinner,sun8i-v3s", |
Chen-Yu Tsai | ac84b79 | 2014-06-20 22:52:50 +0800 | [diff] [blame] | 70 | NULL, |
| 71 | }; |
| 72 | |
Jens Kuske | 14a882d | 2015-05-15 18:38:55 +0200 | [diff] [blame] | 73 | DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family") |
| 74 | .init_time = sun6i_timer_init, |
Chen-Yu Tsai | ac84b79 | 2014-06-20 22:52:50 +0800 | [diff] [blame] | 75 | .dt_compat = sun8i_board_dt_compat, |
| 76 | MACHINE_END |
Chen-Yu Tsai | 3d4c2f1 | 2014-10-08 21:02:52 +0800 | [diff] [blame] | 77 | |
Mylène Josserand | 46ebbfc | 2018-05-04 21:05:40 +0200 | [diff] [blame] | 78 | static void __init sun8i_a83t_cntvoff_init(void) |
| 79 | { |
| 80 | #ifdef CONFIG_SMP |
| 81 | secure_cntvoff_init(); |
| 82 | #endif |
| 83 | } |
| 84 | |
| 85 | static const char * const sun8i_a83t_cntvoff_board_dt_compat[] = { |
| 86 | "allwinner,sun8i-a83t", |
| 87 | NULL, |
| 88 | }; |
| 89 | |
| 90 | DT_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, |
| 94 | MACHINE_END |
| 95 | |
Chen-Yu Tsai | 3d4c2f1 | 2014-10-08 21:02:52 +0800 | [diff] [blame] | 96 | static const char * const sun9i_board_dt_compat[] = { |
| 97 | "allwinner,sun9i-a80", |
| 98 | NULL, |
| 99 | }; |
| 100 | |
| 101 | DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family") |
| 102 | .dt_compat = sun9i_board_dt_compat, |
| 103 | MACHINE_END |
Mesih Kilinc | ba08dcc | 2018-12-02 23:23:37 +0300 | [diff] [blame] | 104 | |
| 105 | static const char * const suniv_board_dt_compat[] = { |
| 106 | "allwinner,suniv-f1c100s", |
| 107 | NULL, |
| 108 | }; |
| 109 | |
| 110 | DT_MACHINE_START(SUNIV_DT, "Allwinner suniv Family") |
| 111 | .dt_compat = suniv_board_dt_compat, |
| 112 | MACHINE_END |