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_SLD3)
17 static const struct uniphier_board_data uniphier_sld3_data = {
38 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
39 static const struct uniphier_board_data uniphier_ld4_data = {
52 .flags = UNIPHIER_BD_DDR3PLUS,
56 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
58 static const struct uniphier_board_data uniphier_pro4_data = {
74 static const struct uniphier_board_data uniphier_pro4_2g_data = {
90 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
91 static const struct uniphier_board_data uniphier_sld8_data = {
104 .flags = UNIPHIER_BD_DDR3PLUS,
108 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
109 static const struct uniphier_board_data uniphier_pro5_data = {
125 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
126 static const struct uniphier_board_data uniphier_pxs2_data = {
147 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
148 static const struct uniphier_board_data uniphier_ld6b_data = {
169 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
170 static const struct uniphier_board_data uniphier_ld11_data = {
186 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
187 static const struct uniphier_board_data uniphier_ld20_data = {
201 .base = 0x100000000UL,
208 struct uniphier_board_id {
209 const char *compatible;
210 const struct uniphier_board_data *param;
213 static const struct uniphier_board_id uniphier_boards[] = {
214 #if defined(CONFIG_ARCH_UNIPHIER_SLD3)
215 { "socionext,ph1-sld3", &uniphier_sld3_data, },
217 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
218 { "socionext,ph1-ld4", &uniphier_ld4_data, },
220 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
221 { "socionext,ph1-pro4-ace", &uniphier_pro4_2g_data, },
222 { "socionext,ph1-pro4-sanji", &uniphier_pro4_2g_data, },
223 { "socionext,ph1-pro4", &uniphier_pro4_data, },
225 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
226 { "socionext,ph1-sld8", &uniphier_sld8_data, },
228 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
229 { "socionext,ph1-pro5", &uniphier_pro5_data, },
231 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
232 { "socionext,proxstream2", &uniphier_pxs2_data, },
234 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
235 { "socionext,ph1-ld6b", &uniphier_ld6b_data, },
237 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
238 { "socionext,ph1-ld11", &uniphier_ld11_data, },
240 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
241 { "socionext,ph1-ld20", &uniphier_ld20_data, },
245 const struct uniphier_board_data *uniphier_get_board_param(void)
249 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
250 if (!fdt_node_check_compatible(gd->fdt_blob, 0,
251 uniphier_boards[i].compatible))
252 return uniphier_boards[i].param;