blob: 7ab353fb25f292be31b36cc4fe9fd872e7ad4964 [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/clk-provider.h>
14#include <linux/clocksource.h>
Maxime Ripardd767af52014-06-29 15:48:53 +020015#include <linux/init.h>
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080016#include <linux/platform_device.h>
Maxime Ripard3b526342012-11-08 12:40:16 +010017
Maxime Ripard3b526342012-11-08 12:40:16 +010018#include <asm/mach/arch.h>
Maxime Ripardbc34b5f2013-03-11 20:21:11 +010019
Maxime Ripard3b526342012-11-08 12:40:16 +010020static const char * const sunxi_board_dt_compat[] = {
Maxime Ripard43880f72012-12-18 15:17:12 +010021 "allwinner,sun4i-a10",
Maxime Ripard81265df2013-06-09 09:40:05 +020022 "allwinner,sun5i-a10s",
Maxime Ripard43880f72012-12-18 15:17:12 +010023 "allwinner,sun5i-a13",
Maxime Ripardbef62292015-06-09 19:38:04 +020024 "allwinner,sun5i-r8",
Maxime Ripardc1efda12016-09-08 12:26:08 +020025 "nextthing,gr8",
Maxime Ripard3b526342012-11-08 12:40:16 +010026 NULL,
27};
28
Maxime Ripardbef62292015-06-09 19:38:04 +020029DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
Maxime Ripard3b526342012-11-08 12:40:16 +010030 .dt_compat = sunxi_board_dt_compat,
31MACHINE_END
Maxime Ripard91a31972013-08-11 14:35:08 +020032
33static const char * const sun6i_board_dt_compat[] = {
34 "allwinner,sun6i-a31",
Hans de Goedeb0f2faa2014-12-17 18:18:14 +010035 "allwinner,sun6i-a31s",
Maxime Ripard91a31972013-08-11 14:35:08 +020036 NULL,
37};
38
Maxime Ripard751b2ac2013-10-05 14:53:48 +020039extern void __init sun6i_reset_init(void);
40static void __init sun6i_timer_init(void)
41{
42 of_clk_init(NULL);
Arnd Bergmanne58cf012014-05-26 17:14:57 +020043 if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
44 sun6i_reset_init();
Daniel Lezcanoba5d08c2017-05-26 17:40:46 +020045 timer_probe();
Maxime Ripard751b2ac2013-10-05 14:53:48 +020046}
47
Maxime Ripard91a31972013-08-11 14:35:08 +020048DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
Maxime Ripard751b2ac2013-10-05 14:53:48 +020049 .init_time = sun6i_timer_init,
Maxime Ripard91a31972013-08-11 14:35:08 +020050 .dt_compat = sun6i_board_dt_compat,
51MACHINE_END
52
53static const char * const sun7i_board_dt_compat[] = {
54 "allwinner,sun7i-a20",
55 NULL,
56};
57
58DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
Maxime Ripard91a31972013-08-11 14:35:08 +020059 .dt_compat = sun7i_board_dt_compat,
Maxime Ripard3b526342012-11-08 12:40:16 +010060MACHINE_END
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080061
62static const char * const sun8i_board_dt_compat[] = {
63 "allwinner,sun8i-a23",
Vishnu Patekar159870d2015-05-30 16:55:01 +020064 "allwinner,sun8i-a33",
Vishnu Patekar1425ec02016-01-06 21:11:52 +080065 "allwinner,sun8i-a83t",
Icenowy Zheng16fa9622016-12-02 23:05:12 +080066 "allwinner,sun8i-h2-plus",
Jens Kuske14a882d2015-05-15 18:38:55 +020067 "allwinner,sun8i-h3",
Icenowy Zhengb074fed2017-01-20 01:54:44 +080068 "allwinner,sun8i-v3s",
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080069 NULL,
70};
71
Jens Kuske14a882d2015-05-15 18:38:55 +020072DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
73 .init_time = sun6i_timer_init,
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080074 .dt_compat = sun8i_board_dt_compat,
75MACHINE_END
Chen-Yu Tsai3d4c2f12014-10-08 21:02:52 +080076
77static const char * const sun9i_board_dt_compat[] = {
78 "allwinner,sun9i-a80",
79 NULL,
80};
81
82DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
83 .dt_compat = sun9i_board_dt_compat,
84MACHINE_END