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 = {
17 .dram_ch0_base = 0x80000000,
18 .dram_ch0_size = 0x20000000,
20 .dram_ch1_base = 0xc0000000,
21 .dram_ch1_size = 0x20000000,
23 .dram_ch2_base = 0xc0000000,
24 .dram_ch2_size = 0x10000000,
30 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
31 static const struct uniphier_board_data ph1_ld4_data = {
32 .dram_ch0_base = 0x80000000,
33 .dram_ch0_size = 0x10000000,
35 .dram_ch1_base = 0x90000000,
36 .dram_ch1_size = 0x10000000,
42 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
43 static const struct uniphier_board_data ph1_pro4_data = {
44 .dram_ch0_base = 0x80000000,
45 .dram_ch0_size = 0x20000000,
47 .dram_ch1_base = 0xa0000000,
48 .dram_ch1_size = 0x20000000,
54 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
55 static const struct uniphier_board_data ph1_sld8_data = {
56 .dram_ch0_base = 0x80000000,
57 .dram_ch0_size = 0x10000000,
59 .dram_ch1_base = 0x90000000,
60 .dram_ch1_size = 0x10000000,
66 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
67 static const struct uniphier_board_data ph1_pro5_data = {
68 .dram_ch0_base = 0x80000000,
69 .dram_ch0_size = 0x20000000,
71 .dram_ch1_base = 0xa0000000,
72 .dram_ch1_size = 0x20000000,
78 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
79 static const struct uniphier_board_data proxstream2_data = {
80 .dram_ch0_base = 0x80000000,
81 .dram_ch0_size = 0x40000000,
83 .dram_ch1_base = 0xc0000000,
84 .dram_ch1_size = 0x20000000,
86 .dram_ch2_base = 0xe0000000,
87 .dram_ch2_size = 0x20000000,
93 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
94 static const struct uniphier_board_data ph1_ld6b_data = {
95 .dram_ch0_base = 0x80000000,
96 .dram_ch0_size = 0x40000000,
98 .dram_ch1_base = 0xc0000000,
99 .dram_ch1_size = 0x20000000,
100 .dram_ch1_width = 32,
101 .dram_ch2_base = 0xe0000000,
102 .dram_ch2_size = 0x20000000,
103 .dram_ch2_width = 16,
108 struct uniphier_board_id {
109 const char *compatible;
110 const struct uniphier_board_data *param;
113 static const struct uniphier_board_id uniphier_boards[] = {
114 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
115 { "socionext,ph1-sld3", &ph1_sld3_data, },
117 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
118 { "socionext,ph1-ld4", &ph1_ld4_data, },
120 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
121 { "socionext,ph1-pro4", &ph1_pro4_data, },
123 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
124 { "socionext,ph1-sld8", &ph1_sld8_data, },
126 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
127 { "socionext,ph1-pro5", &ph1_pro5_data, },
129 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
130 { "socionext,proxstream2", &proxstream2_data, },
132 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
133 { "socionext,ph1-ld6b", &ph1_ld6b_data, },
137 const struct uniphier_board_data *uniphier_get_board_param(void)
141 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
142 if (!fdt_node_check_compatible(gd->fdt_blob, 0,
143 uniphier_boards[i].compatible))
144 return uniphier_boards[i].param;