1 /* GRLIB Memory controller setup. The register values are used
2 * from the associated low level assembler routine implemented
5 * (C) Copyright 2010, 2015
8 * SPDX-License-Identifier: GPL-2.0+
15 #ifdef CONFIG_SYS_GRLIB_ESA_MCTRL1
16 struct mctrl_setup esa_mctrl1_cfg = {
21 .value = CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG1,
25 .value = CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG2,
29 .value = CONFIG_SYS_GRLIB_ESA_MCTRL1_CFG3,
33 #ifdef CONFIG_SYS_GRLIB_ESA_MCTRL2
34 struct mctrl_setup esa_mctrl2_cfg = {
39 .value = CONFIG_SYS_GRLIB_ESA_MCTRL2_CFG1,
43 .value = CONFIG_SYS_GRLIB_ESA_MCTRL2_CFG2,
47 .value = CONFIG_SYS_GRLIB_ESA_MCTRL2_CFG3,
54 #ifdef CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
55 struct mctrl_setup gaisler_ftmctrl1_cfg = {
60 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG1,
64 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG2,
68 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1_CFG3,
72 #ifdef CONFIG_SYS_GRLIB_GAISLER_FTMCTRL2
73 struct mctrl_setup gaisler_ftmctrl2_cfg = {
78 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL2_CFG1,
82 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL2_CFG2,
86 .value = CONFIG_SYS_GRLIB_GAISLER_FTMCTRL2_CFG3,
93 #ifdef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
94 struct mctrl_setup gaisler_sdctrl1_cfg = {
99 .value = CONFIG_SYS_GRLIB_GAISLER_SDCTRL1_CTRL,
103 #ifdef CONFIG_SYS_GRLIB_GAISLER_SDCTRL2
104 struct mctrl_setup gaisler_sdctrl2_cfg = {
109 .value = CONFIG_SYS_GRLIB_GAISLER_SDCTRL2_CTRL,
116 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
117 struct ahbmctrl_setup gaisler_ddr2spa1_cfg = {
123 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1_CFG1,
128 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1_CFG3,
132 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1_CFG4,
136 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA2
137 struct ahbmctrl_setup gaisler_ddr2spa2_cfg = {
143 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA2_CFG1,
148 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA2_CFG3,
152 .value = CONFIG_SYS_GRLIB_GAISLER_DDR2SPA2_CFG4,
159 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
160 struct ahbmctrl_setup gaisler_ddrspa1_cfg = {
166 .value = CONFIG_SYS_GRLIB_GAISLER_DDRSPA1_CTRL,
170 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDRSPA2
171 struct ahbmctrl_setup gaisler_ddrspa2_cfg = {
177 .value = CONFIG_SYS_GRLIB_GAISLER_DDRSPA2_CTRL,
184 struct grlib_mctrl_handler grlib_mctrl_handlers[] = {
185 /* ESA MCTRL (PROM/FLASH/IO/SRAM/SDRAM) */
186 #ifdef CONFIG_SYS_GRLIB_ESA_MCTRL1
187 {DEV_APB_SLV, 0, MH_UNUSED, AMBA_PNP_ID(VENDOR_ESA, ESA_MCTRL),
188 _nomem_mctrl_init, (void *)&esa_mctrl1_cfg},
189 #ifdef CONFIG_SYS_GRLIB_ESA_MCTRL2
190 {DEV_APB_SLV, 1, MH_UNUSED, AMBA_PNP_ID(VENDOR_ESA, ESA_MCTRL),
191 _nomem_mctrl_init, (void *)&esa_mctrl2_cfg},
195 /* GAISLER Fault Tolerant Memory controller (PROM/FLASH/IO/SRAM/SDRAM) */
196 #ifdef CONFIG_SYS_GRLIB_GAISLER_FTMCTRL1
197 {DEV_APB_SLV, 0, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_FTMCTRL),
198 _nomem_mctrl_init, (void *)&gaisler_ftmctrl1_cfg},
199 #ifdef CONFIG_SYS_GRLIB_GAISLER_FTMCTRL2
200 {DEV_APB_SLV, 1, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_FTMCTRL),
201 _nomem_mctrl_init, (void *)&gaisler_ftmctrl2_cfg},
205 /* GAISLER SDRAM-only Memory controller (SDRAM) */
206 #ifdef CONFIG_SYS_GRLIB_GAISLER_SDCTRL1
207 {DEV_APB_SLV, 0, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_SDCTRL),
208 _nomem_mctrl_init, (void *)&gaisler_sdctrl1_cfg},
209 #ifdef CONFIG_SYS_GRLIB_GAISLER_SDCTRL2
210 {DEV_APB_SLV, 1, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_SDCTRL),
211 _nomem_mctrl_init, (void *)&gaisler_sdctrl2_cfg},
215 /* GAISLER DDR Memory controller (DDR) */
216 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDRSPA1
217 {DEV_AHB_SLV, 0, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_DDRSP),
218 _nomem_ahbmctrl_init, (void *)&gaisler_ddrspa1_cfg},
219 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDRSPA2
220 {DEV_AHB_SLV, 1, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_DDRSP),
221 _nomem_ahbmctrl_init, (void *)&gaisler_ddrspa2_cfg},
225 /* GAISLER DDR2 Memory controller (DDR2) */
226 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA1
227 {DEV_AHB_SLV, 0, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_DDR2SP),
228 _nomem_ahbmctrl_init, (void *)&gaisler_ddr2spa1_cfg},
229 #ifdef CONFIG_SYS_GRLIB_GAISLER_DDR2SPA2
230 {DEV_AHB_SLV, 1, MH_UNUSED, AMBA_PNP_ID(VENDOR_GAISLER, GAISLER_DDR2SP),
231 _nomem_ahbmctrl_init, (void *)&gaisler_ddr2spa2_cfg},