2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/kernel.h>
13 DECLARE_GLOBAL_DATA_PTR;
15 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
16 static const struct uniphier_board_data ph1_sld3_data = {
37 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
38 static const struct uniphier_board_data ph1_ld4_data = {
54 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
56 static const struct uniphier_board_data ph1_pro4_data = {
72 static const struct uniphier_board_data ph1_pro4_2g_data = {
88 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
89 static const struct uniphier_board_data ph1_sld8_data = {
105 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
106 static const struct uniphier_board_data ph1_pro5_data = {
122 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
123 static const struct uniphier_board_data proxstream2_data = {
144 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
145 static const struct uniphier_board_data ph1_ld6b_data = {
166 struct uniphier_board_id {
167 const char *compatible;
168 const struct uniphier_board_data *param;
171 static const struct uniphier_board_id uniphier_boards[] = {
172 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
173 { "socionext,ph1-sld3", &ph1_sld3_data, },
175 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
176 { "socionext,ph1-ld4", &ph1_ld4_data, },
178 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
179 { "socionext,ph1-pro4-ace", &ph1_pro4_2g_data, },
180 { "socionext,ph1-pro4-sanji", &ph1_pro4_2g_data, },
181 { "socionext,ph1-pro4", &ph1_pro4_data, },
183 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
184 { "socionext,ph1-sld8", &ph1_sld8_data, },
186 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
187 { "socionext,ph1-pro5", &ph1_pro5_data, },
189 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
190 { "socionext,proxstream2", &proxstream2_data, },
192 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
193 { "socionext,ph1-ld6b", &ph1_ld6b_data, },
197 const struct uniphier_board_data *uniphier_get_board_param(void)
201 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
202 if (!fdt_node_check_compatible(gd->fdt_blob, 0,
203 uniphier_boards[i].compatible))
204 return uniphier_boards[i].param;