blob: 3c156190a1d44223027b4c9a37ab67550219854b [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
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080020static void __init sunxi_dt_cpufreq_init(void)
21{
22 platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
23}
24
Maxime Ripard3b526342012-11-08 12:40:16 +010025static const char * const sunxi_board_dt_compat[] = {
Maxime Ripard43880f72012-12-18 15:17:12 +010026 "allwinner,sun4i-a10",
Maxime Ripard81265df2013-06-09 09:40:05 +020027 "allwinner,sun5i-a10s",
Maxime Ripard43880f72012-12-18 15:17:12 +010028 "allwinner,sun5i-a13",
Maxime Ripardbef62292015-06-09 19:38:04 +020029 "allwinner,sun5i-r8",
Maxime Ripard3b526342012-11-08 12:40:16 +010030 NULL,
31};
32
Maxime Ripardbef62292015-06-09 19:38:04 +020033DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
Maxime Ripard3b526342012-11-08 12:40:16 +010034 .dt_compat = sunxi_board_dt_compat,
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080035 .init_late = sunxi_dt_cpufreq_init,
Maxime Ripard3b526342012-11-08 12:40:16 +010036MACHINE_END
Maxime Ripard91a31972013-08-11 14:35:08 +020037
38static const char * const sun6i_board_dt_compat[] = {
39 "allwinner,sun6i-a31",
Hans de Goedeb0f2faa2014-12-17 18:18:14 +010040 "allwinner,sun6i-a31s",
Maxime Ripard91a31972013-08-11 14:35:08 +020041 NULL,
42};
43
Maxime Ripard751b2ac2013-10-05 14:53:48 +020044extern void __init sun6i_reset_init(void);
45static void __init sun6i_timer_init(void)
46{
47 of_clk_init(NULL);
Arnd Bergmanne58cf012014-05-26 17:14:57 +020048 if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
49 sun6i_reset_init();
Marc Zyngier3722ed22015-09-28 15:49:18 +010050 clocksource_probe();
Maxime Ripard751b2ac2013-10-05 14:53:48 +020051}
52
Maxime Ripard91a31972013-08-11 14:35:08 +020053DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
Maxime Ripard751b2ac2013-10-05 14:53:48 +020054 .init_time = sun6i_timer_init,
Maxime Ripard91a31972013-08-11 14:35:08 +020055 .dt_compat = sun6i_board_dt_compat,
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080056 .init_late = sunxi_dt_cpufreq_init,
Maxime Ripard91a31972013-08-11 14:35:08 +020057MACHINE_END
58
59static const char * const sun7i_board_dt_compat[] = {
60 "allwinner,sun7i-a20",
61 NULL,
62};
63
64DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
Maxime Ripard91a31972013-08-11 14:35:08 +020065 .dt_compat = sun7i_board_dt_compat,
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080066 .init_late = sunxi_dt_cpufreq_init,
Maxime Ripard3b526342012-11-08 12:40:16 +010067MACHINE_END
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080068
69static const char * const sun8i_board_dt_compat[] = {
70 "allwinner,sun8i-a23",
Vishnu Patekar159870d2015-05-30 16:55:01 +020071 "allwinner,sun8i-a33",
Vishnu Patekar1425ec02016-01-06 21:11:52 +080072 "allwinner,sun8i-a83t",
Jens Kuske14a882d2015-05-15 18:38:55 +020073 "allwinner,sun8i-h3",
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080074 NULL,
75};
76
Jens Kuske14a882d2015-05-15 18:38:55 +020077DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
78 .init_time = sun6i_timer_init,
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080079 .dt_compat = sun8i_board_dt_compat,
Chen-Yu Tsaif91b7c62015-01-06 10:35:11 +080080 .init_late = sunxi_dt_cpufreq_init,
Chen-Yu Tsaiac84b792014-06-20 22:52:50 +080081MACHINE_END
Chen-Yu Tsai3d4c2f12014-10-08 21:02:52 +080082
83static const char * const sun9i_board_dt_compat[] = {
84 "allwinner,sun9i-a80",
85 NULL,
86};
87
88DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
89 .dt_compat = sun9i_board_dt_compat,
90MACHINE_END