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,
207 static const struct uniphier_board_data uniphier_ld21_data = {
220 .flags = UNIPHIER_BD_PACKAGE_LD21,
224 struct uniphier_board_id {
225 const char *compatible;
226 const struct uniphier_board_data *param;
229 static const struct uniphier_board_id uniphier_boards[] = {
230 #if defined(CONFIG_ARCH_UNIPHIER_SLD3)
231 { "socionext,ph1-sld3", &uniphier_sld3_data, },
233 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
234 { "socionext,ph1-ld4", &uniphier_ld4_data, },
236 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
237 { "socionext,ph1-pro4-ace", &uniphier_pro4_2g_data, },
238 { "socionext,ph1-pro4-sanji", &uniphier_pro4_2g_data, },
239 { "socionext,ph1-pro4", &uniphier_pro4_data, },
241 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
242 { "socionext,ph1-sld8", &uniphier_sld8_data, },
244 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
245 { "socionext,ph1-pro5", &uniphier_pro5_data, },
247 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
248 { "socionext,proxstream2", &uniphier_pxs2_data, },
250 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
251 { "socionext,ph1-ld6b", &uniphier_ld6b_data, },
253 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
254 { "socionext,ph1-ld11", &uniphier_ld11_data, },
256 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
257 { "socionext,ph1-ld21", &uniphier_ld21_data, },
258 { "socionext,ph1-ld20", &uniphier_ld20_data, },
262 const struct uniphier_board_data *uniphier_get_board_param(void)
266 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
267 if (!fdt_node_check_compatible(gd->fdt_blob, 0,
268 uniphier_boards[i].compatible))
269 return uniphier_boards[i].param;