xref: /openbmc/linux/arch/arm/mach-sunxi/sunxi.c (revision 14e25a03)
13b52634fSMaxime Ripard /*
23b52634fSMaxime Ripard  * Device Tree support for Allwinner A1X SoCs
33b52634fSMaxime Ripard  *
43b52634fSMaxime Ripard  * Copyright (C) 2012 Maxime Ripard
53b52634fSMaxime Ripard  *
63b52634fSMaxime Ripard  * Maxime Ripard <maxime.ripard@free-electrons.com>
73b52634fSMaxime Ripard  *
83b52634fSMaxime Ripard  * This file is licensed under the terms of the GNU General Public
93b52634fSMaxime Ripard  * License version 2.  This program is licensed "as is" without any
103b52634fSMaxime Ripard  * warranty of any kind, whether express or implied.
113b52634fSMaxime Ripard  */
123b52634fSMaxime Ripard 
13751b2ac4SMaxime Ripard #include <linux/clk-provider.h>
14751b2ac4SMaxime Ripard #include <linux/clocksource.h>
15d767af5eSMaxime Ripard #include <linux/init.h>
16f91b7c62SChen-Yu Tsai #include <linux/platform_device.h>
173b52634fSMaxime Ripard 
183b52634fSMaxime Ripard #include <asm/mach/arch.h>
19bc34b5f2SMaxime Ripard 
203b52634fSMaxime Ripard static const char * const sunxi_board_dt_compat[] = {
2143880f70SMaxime Ripard 	"allwinner,sun4i-a10",
2281265dfbSMaxime Ripard 	"allwinner,sun5i-a10s",
2343880f70SMaxime Ripard 	"allwinner,sun5i-a13",
24bef6229fSMaxime Ripard 	"allwinner,sun5i-r8",
25c1efda12SMaxime Ripard 	"nextthing,gr8",
263b52634fSMaxime Ripard 	NULL,
273b52634fSMaxime Ripard };
283b52634fSMaxime Ripard 
29bef6229fSMaxime Ripard DT_MACHINE_START(SUNXI_DT, "Allwinner sun4i/sun5i Families")
303b52634fSMaxime Ripard 	.dt_compat	= sunxi_board_dt_compat,
313b52634fSMaxime Ripard MACHINE_END
3291a31977SMaxime Ripard 
3391a31977SMaxime Ripard static const char * const sun6i_board_dt_compat[] = {
3491a31977SMaxime Ripard 	"allwinner,sun6i-a31",
35b0f2faa5SHans de Goede 	"allwinner,sun6i-a31s",
3691a31977SMaxime Ripard 	NULL,
3791a31977SMaxime Ripard };
3891a31977SMaxime Ripard 
39751b2ac4SMaxime Ripard extern void __init sun6i_reset_init(void);
40751b2ac4SMaxime Ripard static void __init sun6i_timer_init(void)
41751b2ac4SMaxime Ripard {
42751b2ac4SMaxime Ripard 	of_clk_init(NULL);
43e58cf019SArnd Bergmann 	if (IS_ENABLED(CONFIG_RESET_CONTROLLER))
44751b2ac4SMaxime Ripard 		sun6i_reset_init();
45ba5d08c0SDaniel Lezcano 	timer_probe();
46751b2ac4SMaxime Ripard }
47751b2ac4SMaxime Ripard 
4891a31977SMaxime Ripard DT_MACHINE_START(SUN6I_DT, "Allwinner sun6i (A31) Family")
49751b2ac4SMaxime Ripard 	.init_time	= sun6i_timer_init,
5091a31977SMaxime Ripard 	.dt_compat	= sun6i_board_dt_compat,
5191a31977SMaxime Ripard MACHINE_END
5291a31977SMaxime Ripard 
5391a31977SMaxime Ripard static const char * const sun7i_board_dt_compat[] = {
5491a31977SMaxime Ripard 	"allwinner,sun7i-a20",
5591a31977SMaxime Ripard 	NULL,
5691a31977SMaxime Ripard };
5791a31977SMaxime Ripard 
5891a31977SMaxime Ripard DT_MACHINE_START(SUN7I_DT, "Allwinner sun7i (A20) Family")
5991a31977SMaxime Ripard 	.dt_compat	= sun7i_board_dt_compat,
603b52634fSMaxime Ripard MACHINE_END
61ac84b79fSChen-Yu Tsai 
62ac84b79fSChen-Yu Tsai static const char * const sun8i_board_dt_compat[] = {
63ac84b79fSChen-Yu Tsai 	"allwinner,sun8i-a23",
64159870d2SVishnu Patekar 	"allwinner,sun8i-a33",
651425ec0fSVishnu Patekar 	"allwinner,sun8i-a83t",
6616fa9629SIcenowy Zheng 	"allwinner,sun8i-h2-plus",
6714a882dfSJens Kuske 	"allwinner,sun8i-h3",
6814e25a03SIcenowy Zheng 	"allwinner,sun8i-r40",
69b074fedeSIcenowy Zheng 	"allwinner,sun8i-v3s",
70ac84b79fSChen-Yu Tsai 	NULL,
71ac84b79fSChen-Yu Tsai };
72ac84b79fSChen-Yu Tsai 
7314a882dfSJens Kuske DT_MACHINE_START(SUN8I_DT, "Allwinner sun8i Family")
7414a882dfSJens Kuske 	.init_time	= sun6i_timer_init,
75ac84b79fSChen-Yu Tsai 	.dt_compat	= sun8i_board_dt_compat,
76ac84b79fSChen-Yu Tsai MACHINE_END
773d4c2f1cSChen-Yu Tsai 
783d4c2f1cSChen-Yu Tsai static const char * const sun9i_board_dt_compat[] = {
793d4c2f1cSChen-Yu Tsai 	"allwinner,sun9i-a80",
803d4c2f1cSChen-Yu Tsai 	NULL,
813d4c2f1cSChen-Yu Tsai };
823d4c2f1cSChen-Yu Tsai 
833d4c2f1cSChen-Yu Tsai DT_MACHINE_START(SUN9I_DT, "Allwinner sun9i Family")
843d4c2f1cSChen-Yu Tsai 	.dt_compat	= sun9i_board_dt_compat,
853d4c2f1cSChen-Yu Tsai MACHINE_END
86