blob: 95dca8c2c9edcd5a72276dd05ab8572c7dd7bd9e [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 Ripard3b526342012-11-08 12:40:16 +010025 NULL,
26};
27
Maxime Ripardbef62292015-06-09 19:38:04 +020028DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
Maxime Ripard3b526342012-11-08 12:40:16 +010029 .dt_compat = sunxi_board_dt_compat,
30MACHINE_END
Maxime Ripard91a31972013-08-11 14:35:08 +020031
32static const char * const sun6i_board_dt_compat[] = {
33 "allwinner,sun6i-a31",
Hans de Goedeb0f2faa2014-12-17 18:18:14 +010034 "allwinner,sun6i-a31s",
Maxime Ripard91a31972013-08-11 14:35:08 +020035 NULL,
36};
37
Maxime Ripard751b2ac2013-10-05 14:53:48 +020038extern void __init sun6i_reset_init(void);
39static void __init sun6i_timer_init(void)
40{
41 of_clk_init(NULL);
Arnd Bergmanne58cf012014-05-26 17:14:57 +020042 if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
43 sun6i_reset_init();
Marc Zyngier3722ed22015-09-28 15:49:18 +010044 clocksource_probe();
Maxime Ripard751b2ac2013-10-05 14:53:48 +020045}
46
Maxime Ripard91a31972013-08-11 14:35:08 +020047DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
Maxime Ripard751b2ac2013-10-05 14:53:48 +020048 .init_time = sun6i_timer_init,
Maxime Ripard91a31972013-08-11 14:35:08 +020049 .dt_compat = sun6i_board_dt_compat,
50MACHINE_END
51
52static const char * const sun7i_board_dt_compat[] = {
53 "allwinner,sun7i-a20",
54 NULL,
55};
56
57DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
Maxime Ripard91a31972013-08-11 14:35:08 +020058 .dt_compat = sun7i_board_dt_compat,
Maxime Ripard3b526342012-11-08 12:40:16 +010059MACHINE_END
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080060
61static const char * const sun8i_board_dt_compat[] = {
62 "allwinner,sun8i-a23",
Vishnu Patekar159870d2015-05-30 16:55:01 +020063 "allwinner,sun8i-a33",
Vishnu Patekar1425ec02016-01-06 21:11:52 +080064 "allwinner,sun8i-a83t",
Jens Kuske14a882d2015-05-15 18:38:55 +020065 "allwinner,sun8i-h3",
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080066 NULL,
67};
68
Jens Kuske14a882d2015-05-15 18:38:55 +020069DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
70 .init_time = sun6i_timer_init,
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080071 .dt_compat = sun8i_board_dt_compat,
72MACHINE_END
Chen-Yu Tsai3d4c2f12014-10-08 21:02:52 +080073
74static const char * const sun9i_board_dt_compat[] = {
75 "allwinner,sun9i-a80",
76 NULL,
77};
78
79DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
80 .dt_compat = sun9i_board_dt_compat,
81MACHINE_END