blob: 8b88768b565de8a0ec1442a325c1a96151297e4f [file] [log] [blame]
Viresh Kumarf56aad12016-03-30 13:45:26 +05301/*
2 * Copyright (C) 2016 Linaro.
3 * Viresh Kumar <viresh.kumar@linaro.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#include <linux/err.h>
11#include <linux/of.h>
12#include <linux/platform_device.h>
13
Viresh Kumar297a6622016-09-09 16:48:08 +053014#include "cpufreq-dt.h"
15
Viresh Kumare92bb162016-04-22 16:58:39 +053016static const struct of_device_id machines[] __initconst = {
Viresh Kumar117d4f52016-04-22 16:58:45 +053017 { .compatible = "allwinner,sun4i-a10", },
18 { .compatible = "allwinner,sun5i-a10s", },
19 { .compatible = "allwinner,sun5i-a13", },
20 { .compatible = "allwinner,sun5i-r8", },
21 { .compatible = "allwinner,sun6i-a31", },
22 { .compatible = "allwinner,sun6i-a31s", },
23 { .compatible = "allwinner,sun7i-a20", },
24 { .compatible = "allwinner,sun8i-a23", },
25 { .compatible = "allwinner,sun8i-a33", },
26 { .compatible = "allwinner,sun8i-a83t", },
27 { .compatible = "allwinner,sun8i-h3", },
28
Hoan Trane11b6292016-12-15 14:55:00 -080029 { .compatible = "apm,xgene-shadowcat", },
30
Linus Walleij650ec6c2016-10-25 09:21:24 +020031 { .compatible = "arm,integrator-ap", },
32 { .compatible = "arm,integrator-cp", },
33
Tao Wanga0df7732017-05-23 16:13:18 +080034 { .compatible = "hisilicon,hi3660", },
Viresh Kumar3920be42016-04-22 16:58:47 +053035 { .compatible = "hisilicon,hi6220", },
36
Viresh Kumar7ead83f2016-04-22 16:58:41 +053037 { .compatible = "fsl,imx27", },
38 { .compatible = "fsl,imx51", },
39 { .compatible = "fsl,imx53", },
40 { .compatible = "fsl,imx7d", },
41
Viresh Kumara59511d2016-04-22 16:58:40 +053042 { .compatible = "marvell,berlin", },
Robert Jarzmikdcd2ea42016-10-31 20:54:53 +010043 { .compatible = "marvell,pxa250", },
44 { .compatible = "marvell,pxa270", },
Viresh Kumara59511d2016-04-22 16:58:40 +053045
Viresh Kumar2249c002016-03-30 13:45:28 +053046 { .compatible = "samsung,exynos3250", },
47 { .compatible = "samsung,exynos4210", },
48 { .compatible = "samsung,exynos4212", },
49 { .compatible = "samsung,exynos4412", },
50 { .compatible = "samsung,exynos5250", },
51#ifndef CONFIG_BL_SWITCHER
52 { .compatible = "samsung,exynos5420", },
Chanwoo Choic4b40572016-08-16 15:27:19 +090053 { .compatible = "samsung,exynos5433", },
Viresh Kumar2249c002016-03-30 13:45:28 +053054 { .compatible = "samsung,exynos5800", },
55#endif
Viresh Kumar7694ca62016-04-22 16:58:42 +053056
Viresh Kumara399dc92016-04-22 16:58:44 +053057 { .compatible = "renesas,emev2", },
58 { .compatible = "renesas,r7s72100", },
59 { .compatible = "renesas,r8a73a4", },
60 { .compatible = "renesas,r8a7740", },
Geert Uytterhoevenf0da8982016-11-16 11:05:51 +010061 { .compatible = "renesas,r8a7743", },
62 { .compatible = "renesas,r8a7745", },
Viresh Kumara399dc92016-04-22 16:58:44 +053063 { .compatible = "renesas,r8a7778", },
64 { .compatible = "renesas,r8a7779", },
65 { .compatible = "renesas,r8a7790", },
66 { .compatible = "renesas,r8a7791", },
Geert Uytterhoevenffdf8b82016-09-06 14:18:20 +020067 { .compatible = "renesas,r8a7792", },
Viresh Kumara399dc92016-04-22 16:58:44 +053068 { .compatible = "renesas,r8a7793", },
69 { .compatible = "renesas,r8a7794", },
Khiem Nguyen034def52017-08-04 15:18:00 +020070 { .compatible = "renesas,r8a7795", },
Khiem Nguyenbea2ebc2017-08-11 17:36:57 +020071 { .compatible = "renesas,r8a7796", },
Viresh Kumara399dc92016-04-22 16:58:44 +053072 { .compatible = "renesas,sh73a0", },
73
Finley Xiao014400c2016-04-22 16:58:43 +053074 { .compatible = "rockchip,rk2928", },
75 { .compatible = "rockchip,rk3036", },
76 { .compatible = "rockchip,rk3066a", },
77 { .compatible = "rockchip,rk3066b", },
78 { .compatible = "rockchip,rk3188", },
79 { .compatible = "rockchip,rk3228", },
80 { .compatible = "rockchip,rk3288", },
Finley Xiao319af402017-08-04 09:52:31 +080081 { .compatible = "rockchip,rk3328", },
Finley Xiao014400c2016-04-22 16:58:43 +053082 { .compatible = "rockchip,rk3366", },
83 { .compatible = "rockchip,rk3368", },
84 { .compatible = "rockchip,rk3399", },
85
Masahiro Yamada1758b332016-10-27 01:41:33 +090086 { .compatible = "socionext,uniphier-pro5", },
87 { .compatible = "socionext,uniphier-pxs2", },
88 { .compatible = "socionext,uniphier-ld6b", },
89 { .compatible = "socionext,uniphier-ld11", },
90 { .compatible = "socionext,uniphier-ld20", },
91
Linus Walleijff6c3492017-08-16 10:19:12 +020092 { .compatible = "st-ericsson,u8500", },
93 { .compatible = "st-ericsson,u8540", },
94 { .compatible = "st-ericsson,u9500", },
95 { .compatible = "st-ericsson,u9540", },
96
Viresh Kumar7694ca62016-04-22 16:58:42 +053097 { .compatible = "ti,omap2", },
98 { .compatible = "ti,omap3", },
99 { .compatible = "ti,omap4", },
100 { .compatible = "ti,omap5", },
Viresh Kumar5e4249c2016-04-22 16:58:46 +0530101
102 { .compatible = "xlnx,zynq-7000", },
Shubhrajyoti Dattaa5685782017-07-13 11:19:10 +0200103 { .compatible = "xlnx,zynqmp", },
Wei Yongjunbd37e022016-08-21 15:41:44 +0000104
Baoyou Xieab838052016-11-30 15:35:29 +0800105 { .compatible = "zte,zx296718", },
106
Wei Yongjunbd37e022016-08-21 15:41:44 +0000107 { }
Viresh Kumarf56aad12016-03-30 13:45:26 +0530108};
109
110static int __init cpufreq_dt_platdev_init(void)
111{
112 struct device_node *np = of_find_node_by_path("/");
Masahiro Yamadaca5eda52016-06-27 14:50:13 +0900113 const struct of_device_id *match;
Viresh Kumarf56aad12016-03-30 13:45:26 +0530114
115 if (!np)
116 return -ENODEV;
117
Masahiro Yamadaca5eda52016-06-27 14:50:13 +0900118 match = of_match_node(machines, np);
119 of_node_put(np);
120 if (!match)
Viresh Kumarf56aad12016-03-30 13:45:26 +0530121 return -ENODEV;
122
Viresh Kumar297a6622016-09-09 16:48:08 +0530123 return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt",
124 -1, match->data,
125 sizeof(struct cpufreq_dt_platform_data)));
Viresh Kumarf56aad12016-03-30 13:45:26 +0530126}
127device_initcall(cpufreq_dt_platdev_init);