2 * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
8 #include <linux/kernel.h>
11 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
12 static const struct uniphier_board_data ph1_sld3_data = {
13 .dram_ch0_base = 0x80000000,
14 .dram_ch0_size = 0x20000000,
16 .dram_ch1_base = 0xc0000000,
17 .dram_ch1_size = 0x20000000,
19 .dram_ch2_base = 0xc0000000,
20 .dram_ch2_size = 0x10000000,
26 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
27 static const struct uniphier_board_data ph1_ld4_data = {
28 .dram_ch0_base = 0x80000000,
29 .dram_ch0_size = 0x10000000,
31 .dram_ch1_base = 0x90000000,
32 .dram_ch1_size = 0x10000000,
38 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
39 static const struct uniphier_board_data ph1_pro4_data = {
40 .dram_ch0_base = 0x80000000,
41 .dram_ch0_size = 0x20000000,
43 .dram_ch1_base = 0xa0000000,
44 .dram_ch1_size = 0x20000000,
50 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
51 static const struct uniphier_board_data ph1_sld8_data = {
52 .dram_ch0_base = 0x80000000,
53 .dram_ch0_size = 0x10000000,
55 .dram_ch1_base = 0x90000000,
56 .dram_ch1_size = 0x10000000,
62 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
63 static const struct uniphier_board_data ph1_pro5_data = {
64 .dram_ch0_base = 0x80000000,
65 .dram_ch0_size = 0x20000000,
67 .dram_ch1_base = 0xa0000000,
68 .dram_ch1_size = 0x20000000,
74 struct uniphier_board_id {
75 const char *compatible;
76 const struct uniphier_board_data *param;
79 static const struct uniphier_board_id uniphier_boards[] = {
80 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD3)
81 { "socionext,ph1-sld3", &ph1_sld3_data, },
83 #if defined(CONFIG_ARCH_UNIPHIER_PH1_LD4)
84 { "socionext,ph1-ld4", &ph1_ld4_data, },
86 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO4)
87 { "socionext,ph1-pro4", &ph1_pro4_data, },
89 #if defined(CONFIG_ARCH_UNIPHIER_PH1_SLD8)
90 { "socionext,ph1-sld8", &ph1_sld8_data, },
92 #if defined(CONFIG_ARCH_UNIPHIER_PH1_PRO5)
93 { "socionext,ph1-pro5", &ph1_pro5_data, },
97 const struct uniphier_board_data *uniphier_get_board_param(const void *fdt)
101 for (i = 0; i < ARRAY_SIZE(uniphier_boards); i++) {
102 if (!fdt_node_check_compatible(fdt, 0,
103 uniphier_boards[i].compatible))
104 return uniphier_boards[i].param;