2 * Copyright (C) 2015-2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
5 * SPDX-License-Identifier: GPL-2.0+
10 #include <linux/kernel.h>
14 DECLARE_GLOBAL_DATA_PTR
;
16 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
17 static const struct uniphier_board_data uniphier_ld4_data
= {
27 .flags
= UNIPHIER_BD_DDR3PLUS
,
31 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
33 static const struct uniphier_board_data uniphier_pro4_data
= {
46 static const struct uniphier_board_data uniphier_pro4_2g_data
= {
59 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
60 static const struct uniphier_board_data uniphier_sld8_data
= {
70 .flags
= UNIPHIER_BD_DDR3PLUS
,
74 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
75 static const struct uniphier_board_data uniphier_pro5_data
= {
88 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
89 static const struct uniphier_board_data uniphier_pxs2_data
= {
106 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
107 static const struct uniphier_board_data uniphier_ld6b_data
= {
124 struct uniphier_board_id
{
125 const char *compatible
;
126 const struct uniphier_board_data
*param
;
129 static const struct uniphier_board_id uniphier_boards
[] = {
130 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
131 { "socionext,uniphier-ld4", &uniphier_ld4_data
, },
133 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
134 { "socionext,uniphier-pro4-ace", &uniphier_pro4_2g_data
, },
135 { "socionext,uniphier-pro4-sanji", &uniphier_pro4_2g_data
, },
136 { "socionext,uniphier-pro4", &uniphier_pro4_data
, },
138 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
139 { "socionext,uniphier-sld8", &uniphier_sld8_data
, },
141 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
142 { "socionext,uniphier-pro5", &uniphier_pro5_data
, },
144 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
145 { "socionext,uniphier-pxs2", &uniphier_pxs2_data
, },
147 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
148 { "socionext,uniphier-ld6b", &uniphier_ld6b_data
, },
152 const struct uniphier_board_data
*uniphier_get_board_param(void)
156 for (i
= 0; i
< ARRAY_SIZE(uniphier_boards
); i
++) {
157 if (!fdt_node_check_compatible(gd
->fdt_blob
, 0,
158 uniphier_boards
[i
].compatible
))
159 return uniphier_boards
[i
].param
;