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 = {
31 .flags = UNIPHIER_BD_DRAM_SPARSE,
35 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
36 static const struct uniphier_board_data uniphier_ld4_data = {
46 .flags = UNIPHIER_BD_DDR3PLUS,
50 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
52 static const struct uniphier_board_data uniphier_pro4_data = {
65 static const struct uniphier_board_data uniphier_pro4_2g_data = {
78 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
79 static const struct uniphier_board_data uniphier_sld8_data = {
89 .flags = UNIPHIER_BD_DDR3PLUS,
93 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
94 static const struct uniphier_board_data uniphier_pro5_data = {
107 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
108 static const struct uniphier_board_data uniphier_pxs2_data = {
125 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
126 static const struct uniphier_board_data uniphier_ld6b_data = {
143 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
144 static const struct uniphier_board_data uniphier_ld11_data = {
157 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
158 static const struct uniphier_board_data uniphier_ld20_ref_data = {
172 .flags = UNIPHIER_BD_BOARD_LD20_REF,
175 static const struct uniphier_board_data uniphier_ld20_data = {
189 .flags = UNIPHIER_BD_BOARD_LD20_GLOBAL,
192 static const struct uniphier_board_data uniphier_ld21_data = {
202 .flags = UNIPHIER_BD_DRAM_SPARSE | UNIPHIER_BD_BOARD_LD21_GLOBAL,
206 struct uniphier_board_id {
207 const char *compatible;
208 const struct uniphier_board_data *param;
211 static const struct uniphier_board_id uniphier_boards[] = {
212 #if defined(CONFIG_ARCH_UNIPHIER_SLD3)
213 { "socionext,uniphier-sld3", &uniphier_sld3_data, },
215 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
216 { "socionext,uniphier-ld4", &uniphier_ld4_data, },
218 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
219 { "socionext,uniphier-pro4-ace", &uniphier_pro4_2g_data, },
220 { "socionext,uniphier-pro4-sanji", &uniphier_pro4_2g_data, },
221 { "socionext,uniphier-pro4", &uniphier_pro4_data, },
223 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
224 { "socionext,uniphier-sld8", &uniphier_sld8_data, },
226 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
227 { "socionext,uniphier-pro5", &uniphier_pro5_data, },
229 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
230 { "socionext,uniphier-pxs2", &uniphier_pxs2_data, },
232 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
233 { "socionext,uniphier-ld6b", &uniphier_ld6b_data, },
235 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
236 { "socionext,uniphier-ld11", &uniphier_ld11_data, },
238 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
239 { "socionext,uniphier-ld21", &uniphier_ld21_data, },
240 { "socionext,uniphier-ld20-ref", &uniphier_ld20_ref_data, },
241 { "socionext,uniphier-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;