2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/kernel.h>
10 #include <mach/init.h>
12 DECLARE_GLOBAL_DATA_PTR;
14 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
15 static const struct uniphier_board_data ph1_sld3_data = {
16 .dram_ch0_base = 0x80000000,
17 .dram_ch0_size = 0x20000000,
19 .dram_ch1_base = 0xc0000000,
20 .dram_ch1_size = 0x20000000,
22 .dram_ch2_base = 0xc0000000,
23 .dram_ch2_size = 0x10000000,
29 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
30 static const struct uniphier_board_data ph1_ld4_data = {
31 .dram_ch0_base = 0x80000000,
32 .dram_ch0_size = 0x10000000,
34 .dram_ch1_base = 0x90000000,
35 .dram_ch1_size = 0x10000000,
41 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
42 static const struct uniphier_board_data ph1_pro4_data = {
43 .dram_ch0_base = 0x80000000,
44 .dram_ch0_size = 0x20000000,
46 .dram_ch1_base = 0xa0000000,
47 .dram_ch1_size = 0x20000000,
53 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
54 static const struct uniphier_board_data ph1_sld8_data = {
55 .dram_ch0_base = 0x80000000,
56 .dram_ch0_size = 0x10000000,
58 .dram_ch1_base = 0x90000000,
59 .dram_ch1_size = 0x10000000,
65 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
66 static const struct uniphier_board_data ph1_pro5_data = {
67 .dram_ch0_base = 0x80000000,
68 .dram_ch0_size = 0x20000000,
70 .dram_ch1_base = 0xa0000000,
71 .dram_ch1_size = 0x20000000,
77 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2) || \
78 defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
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 struct uniphier_board_id {
94 const char *compatible;
95 const struct uniphier_board_data *param;
98 static const struct uniphier_board_id uniphier_boards[] = {
99 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
100 { "socionext,ph1-sld3", &ph1_sld3_data, },
102 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
103 { "socionext,ph1-ld4", &ph1_ld4_data, },
105 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
106 { "socionext,ph1-pro4", &ph1_pro4_data, },
108 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
109 { "socionext,ph1-sld8", &ph1_sld8_data, },
111 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
112 { "socionext,ph1-pro5", &ph1_pro5_data, },
114 #if defined(CONFIG_ARCH_UNIPHIER_PROXSTREAM2)
115 { "socionext,proxstream2", &proxstream2_data, },
117 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD6B)
118 { "socionext,ph1-ld6b", &proxstream2_data, },
122 const struct uniphier_board_data *uniphier_get_board_param(void)
126 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
127 if (!fdt_node_check_compatible(gd->fdt_blob, 0,
128 uniphier_boards[i].compatible))
129 return uniphier_boards[i].param;