blob: 1894a60f1a29ec4324684743380e3d213d4ae69a [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Vikas Manochabf1ae442017-04-10 15:02:51 -07002/*
Patrice Chotard3bc599c2017-10-23 09:53:58 +02003 * Copyright (C) 2017, STMicroelectronics - All Rights Reserved
4 * Author(s): Vikas Manocha, <vikas.manocha@st.com> for STMicroelectronics.
Vikas Manochabf1ae442017-04-10 15:02:51 -07005 */
6
7#include <common.h>
Vikas Manochad0b24c12017-04-10 15:02:55 -07008#include <clk.h>
Vikas Manocha910a52e2017-04-10 15:02:52 -07009#include <dm.h>
Simon Glass691d7192020-05-10 11:40:02 -060010#include <init.h>
Simon Glassf7ae49f2020-05-10 11:40:05 -060011#include <log.h>
Vikas Manocha910a52e2017-04-10 15:02:52 -070012#include <ram.h>
Vikas Manochabf1ae442017-04-10 15:02:51 -070013#include <asm/io.h>
Simon Glass336d4612020-02-03 07:36:16 -070014#include <dm/device_compat.h>
Simon Glassc05ed002020-05-10 11:40:11 -060015#include <linux/delay.h>
Vikas Manochabf1ae442017-04-10 15:02:51 -070016
Patrice Chotard0b3f7892017-12-12 09:49:41 +010017#define MEM_MODE_MASK GENMASK(2, 0)
Radoslaw Pietrzyk246a5e52018-05-16 17:27:11 +020018#define SWP_FMC_OFFSET 10
19#define SWP_FMC_MASK GENMASK(SWP_FMC_OFFSET+1, SWP_FMC_OFFSET)
Patrice Chotard0b3f7892017-12-12 09:49:41 +010020#define NOT_FOUND 0xff
21
Patrice Chotard9242ece2017-07-18 17:37:24 +020022struct stm32_fmc_regs {
Patrice Chotard1421e0a2017-07-18 17:37:25 +020023 /* 0x0 */
24 u32 bcr1; /* NOR/PSRAM Chip select control register 1 */
25 u32 btr1; /* SRAM/NOR-Flash Chip select timing register 1 */
26 u32 bcr2; /* NOR/PSRAM Chip select Control register 2 */
27 u32 btr2; /* SRAM/NOR-Flash Chip select timing register 2 */
28 u32 bcr3; /* NOR/PSRAMChip select Control register 3 */
29 u32 btr3; /* SRAM/NOR-Flash Chip select timing register 3 */
30 u32 bcr4; /* NOR/PSRAM Chip select Control register 4 */
31 u32 btr4; /* SRAM/NOR-Flash Chip select timing register 4 */
32 u32 reserved1[24];
Patrice Chotard9242ece2017-07-18 17:37:24 +020033
Patrice Chotard1421e0a2017-07-18 17:37:25 +020034 /* 0x80 */
35 u32 pcr; /* NAND Flash control register */
36 u32 sr; /* FIFO status and interrupt register */
37 u32 pmem; /* Common memory space timing register */
38 u32 patt; /* Attribute memory space timing registers */
39 u32 reserved2[1];
40 u32 eccr; /* ECC result registers */
41 u32 reserved3[27];
42
43 /* 0x104 */
44 u32 bwtr1; /* SRAM/NOR-Flash write timing register 1 */
45 u32 reserved4[1];
46 u32 bwtr2; /* SRAM/NOR-Flash write timing register 2 */
47 u32 reserved5[1];
48 u32 bwtr3; /* SRAM/NOR-Flash write timing register 3 */
49 u32 reserved6[1];
50 u32 bwtr4; /* SRAM/NOR-Flash write timing register 4 */
51 u32 reserved7[8];
52
53 /* 0x140 */
54 u32 sdcr1; /* SDRAM Control register 1 */
55 u32 sdcr2; /* SDRAM Control register 2 */
56 u32 sdtr1; /* SDRAM Timing register 1 */
57 u32 sdtr2; /* SDRAM Timing register 2 */
58 u32 sdcmr; /* SDRAM Mode register */
59 u32 sdrtr; /* SDRAM Refresh timing register */
60 u32 sdsr; /* SDRAM Status register */
61};
Patrice Chotard9242ece2017-07-18 17:37:24 +020062
Patrice Chotard70166512017-07-18 17:37:29 +020063/*
64 * NOR/PSRAM Control register BCR1
65 * FMC controller Enable, only availabe for H7
66 */
67#define FMC_BCR1_FMCEN BIT(31)
68
Patrice Chotard9242ece2017-07-18 17:37:24 +020069/* Control register SDCR */
70#define FMC_SDCR_RPIPE_SHIFT 13 /* RPIPE bit shift */
71#define FMC_SDCR_RBURST_SHIFT 12 /* RBURST bit shift */
72#define FMC_SDCR_SDCLK_SHIFT 10 /* SDRAM clock divisor shift */
73#define FMC_SDCR_WP_SHIFT 9 /* Write protection shift */
74#define FMC_SDCR_CAS_SHIFT 7 /* CAS latency shift */
75#define FMC_SDCR_NB_SHIFT 6 /* Number of banks shift */
76#define FMC_SDCR_MWID_SHIFT 4 /* Memory width shift */
77#define FMC_SDCR_NR_SHIFT 2 /* Number of row address bits shift */
78#define FMC_SDCR_NC_SHIFT 0 /* Number of col address bits shift */
79
80/* Timings register SDTR */
81#define FMC_SDTR_TMRD_SHIFT 0 /* Load mode register to active */
82#define FMC_SDTR_TXSR_SHIFT 4 /* Exit self-refresh time */
83#define FMC_SDTR_TRAS_SHIFT 8 /* Self-refresh time */
84#define FMC_SDTR_TRC_SHIFT 12 /* Row cycle delay */
85#define FMC_SDTR_TWR_SHIFT 16 /* Recovery delay */
86#define FMC_SDTR_TRP_SHIFT 20 /* Row precharge delay */
87#define FMC_SDTR_TRCD_SHIFT 24 /* Row-to-column delay */
88
89#define FMC_SDCMR_NRFS_SHIFT 5
90
91#define FMC_SDCMR_MODE_NORMAL 0
92#define FMC_SDCMR_MODE_START_CLOCK 1
93#define FMC_SDCMR_MODE_PRECHARGE 2
94#define FMC_SDCMR_MODE_AUTOREFRESH 3
95#define FMC_SDCMR_MODE_WRITE_MODE 4
96#define FMC_SDCMR_MODE_SELFREFRESH 5
97#define FMC_SDCMR_MODE_POWERDOWN 6
98
99#define FMC_SDCMR_BANK_1 BIT(4)
100#define FMC_SDCMR_BANK_2 BIT(3)
101
102#define FMC_SDCMR_MODE_REGISTER_SHIFT 9
103
104#define FMC_SDSR_BUSY BIT(5)
105
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200106#define FMC_BUSY_WAIT(regs) do { \
Patrice Chotard9242ece2017-07-18 17:37:24 +0200107 __asm__ __volatile__ ("dsb" : : : "memory"); \
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200108 while (regs->sdsr & FMC_SDSR_BUSY) \
Patrice Chotard9242ece2017-07-18 17:37:24 +0200109 ; \
110 } while (0)
111
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700112struct stm32_sdram_control {
113 u8 no_columns;
114 u8 no_rows;
115 u8 memory_width;
116 u8 no_banks;
117 u8 cas_latency;
Vikas Manochabfea69a2017-04-10 15:03:03 -0700118 u8 sdclk;
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700119 u8 rd_burst;
120 u8 rd_pipe_delay;
121};
122
123struct stm32_sdram_timing {
124 u8 tmrd;
125 u8 txsr;
126 u8 tras;
127 u8 trc;
128 u8 trp;
Vikas Manochabfea69a2017-04-10 15:03:03 -0700129 u8 twr;
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700130 u8 trcd;
131};
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200132enum stm32_fmc_bank {
133 SDRAM_BANK1,
134 SDRAM_BANK2,
135 MAX_SDRAM_BANK,
136};
137
Patrice Chotard70166512017-07-18 17:37:29 +0200138enum stm32_fmc_family {
139 STM32F7_FMC,
140 STM32H7_FMC,
141};
142
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200143struct bank_params {
Patrice Chotardf39b90d2017-07-18 17:37:26 +0200144 struct stm32_sdram_control *sdram_control;
145 struct stm32_sdram_timing *sdram_timing;
Vikas Manochabfea69a2017-04-10 15:03:03 -0700146 u32 sdram_ref_count;
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200147 enum stm32_fmc_bank target_bank;
148};
149
150struct stm32_sdram_params {
151 struct stm32_fmc_regs *base;
152 u8 no_sdram_banks;
153 struct bank_params bank_params[MAX_SDRAM_BANK];
Patrice Chotard70166512017-07-18 17:37:29 +0200154 enum stm32_fmc_family family;
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700155};
Vikas Manochabf1ae442017-04-10 15:02:51 -0700156
157#define SDRAM_MODE_BL_SHIFT 0
158#define SDRAM_MODE_CAS_SHIFT 4
159#define SDRAM_MODE_BL 0
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700160
161int stm32_sdram_init(struct udevice *dev)
Vikas Manochabf1ae442017-04-10 15:02:51 -0700162{
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700163 struct stm32_sdram_params *params = dev_get_platdata(dev);
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200164 struct stm32_sdram_control *control;
165 struct stm32_sdram_timing *timing;
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200166 struct stm32_fmc_regs *regs = params->base;
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200167 enum stm32_fmc_bank target_bank;
168 u32 ctb; /* SDCMR register: Command Target Bank */
169 u32 ref_count;
170 u8 i;
Vikas Manochabf1ae442017-04-10 15:02:51 -0700171
Patrice Chotard70166512017-07-18 17:37:29 +0200172 /* disable the FMC controller */
173 if (params->family == STM32H7_FMC)
174 clrbits_le32(&regs->bcr1, FMC_BCR1_FMCEN);
175
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200176 for (i = 0; i < params->no_sdram_banks; i++) {
177 control = params->bank_params[i].sdram_control;
178 timing = params->bank_params[i].sdram_timing;
179 target_bank = params->bank_params[i].target_bank;
180 ref_count = params->bank_params[i].sdram_ref_count;
Vikas Manochabf1ae442017-04-10 15:02:51 -0700181
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200182 writel(control->sdclk << FMC_SDCR_SDCLK_SHIFT
183 | control->cas_latency << FMC_SDCR_CAS_SHIFT
184 | control->no_banks << FMC_SDCR_NB_SHIFT
185 | control->memory_width << FMC_SDCR_MWID_SHIFT
186 | control->no_rows << FMC_SDCR_NR_SHIFT
187 | control->no_columns << FMC_SDCR_NC_SHIFT
188 | control->rd_pipe_delay << FMC_SDCR_RPIPE_SHIFT
189 | control->rd_burst << FMC_SDCR_RBURST_SHIFT,
190 &regs->sdcr1);
Vikas Manochabf1ae442017-04-10 15:02:51 -0700191
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200192 if (target_bank == SDRAM_BANK2)
193 writel(control->cas_latency << FMC_SDCR_CAS_SHIFT
194 | control->no_banks << FMC_SDCR_NB_SHIFT
195 | control->memory_width << FMC_SDCR_MWID_SHIFT
196 | control->no_rows << FMC_SDCR_NR_SHIFT
197 | control->no_columns << FMC_SDCR_NC_SHIFT,
198 &regs->sdcr2);
Vikas Manochabf1ae442017-04-10 15:02:51 -0700199
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200200 writel(timing->trcd << FMC_SDTR_TRCD_SHIFT
201 | timing->trp << FMC_SDTR_TRP_SHIFT
202 | timing->twr << FMC_SDTR_TWR_SHIFT
203 | timing->trc << FMC_SDTR_TRC_SHIFT
204 | timing->tras << FMC_SDTR_TRAS_SHIFT
205 | timing->txsr << FMC_SDTR_TXSR_SHIFT
206 | timing->tmrd << FMC_SDTR_TMRD_SHIFT,
207 &regs->sdtr1);
Vikas Manochabf1ae442017-04-10 15:02:51 -0700208
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200209 if (target_bank == SDRAM_BANK2)
210 writel(timing->trcd << FMC_SDTR_TRCD_SHIFT
211 | timing->trp << FMC_SDTR_TRP_SHIFT
212 | timing->twr << FMC_SDTR_TWR_SHIFT
213 | timing->trc << FMC_SDTR_TRC_SHIFT
214 | timing->tras << FMC_SDTR_TRAS_SHIFT
215 | timing->txsr << FMC_SDTR_TXSR_SHIFT
216 | timing->tmrd << FMC_SDTR_TMRD_SHIFT,
217 &regs->sdtr2);
Patrice Chotard70166512017-07-18 17:37:29 +0200218
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200219 if (target_bank == SDRAM_BANK1)
220 ctb = FMC_SDCMR_BANK_1;
221 else
222 ctb = FMC_SDCMR_BANK_2;
Vikas Manochabf1ae442017-04-10 15:02:51 -0700223
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200224 writel(ctb | FMC_SDCMR_MODE_START_CLOCK, &regs->sdcmr);
225 udelay(200); /* 200 us delay, page 10, "Power-Up" */
226 FMC_BUSY_WAIT(regs);
Vikas Manochabf1ae442017-04-10 15:02:51 -0700227
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200228 writel(ctb | FMC_SDCMR_MODE_PRECHARGE, &regs->sdcmr);
229 udelay(100);
230 FMC_BUSY_WAIT(regs);
Vikas Manochabf1ae442017-04-10 15:02:51 -0700231
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200232 writel((ctb | FMC_SDCMR_MODE_AUTOREFRESH | 7 << FMC_SDCMR_NRFS_SHIFT),
233 &regs->sdcmr);
234 udelay(100);
235 FMC_BUSY_WAIT(regs);
236
237 writel(ctb | (SDRAM_MODE_BL << SDRAM_MODE_BL_SHIFT
238 | control->cas_latency << SDRAM_MODE_CAS_SHIFT)
239 << FMC_SDCMR_MODE_REGISTER_SHIFT | FMC_SDCMR_MODE_WRITE_MODE,
240 &regs->sdcmr);
241 udelay(100);
242 FMC_BUSY_WAIT(regs);
243
244 writel(ctb | FMC_SDCMR_MODE_NORMAL, &regs->sdcmr);
245 FMC_BUSY_WAIT(regs);
246
247 /* Refresh timer */
248 writel(ref_count << 1, &regs->sdrtr);
249 }
Vikas Manochabf1ae442017-04-10 15:02:51 -0700250
Patrice Chotard70166512017-07-18 17:37:29 +0200251 /* enable the FMC controller */
252 if (params->family == STM32H7_FMC)
253 setbits_le32(&regs->bcr1, FMC_BCR1_FMCEN);
254
Vikas Manochabf1ae442017-04-10 15:02:51 -0700255 return 0;
256}
Vikas Manocha910a52e2017-04-10 15:02:52 -0700257
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700258static int stm32_fmc_ofdata_to_platdata(struct udevice *dev)
259{
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700260 struct stm32_sdram_params *params = dev_get_platdata(dev);
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200261 struct bank_params *bank_params;
Patrice Chotard0b3f7892017-12-12 09:49:41 +0100262 struct ofnode_phandle_args args;
263 u32 *syscfg_base;
264 u32 mem_remap;
Radoslaw Pietrzyk246a5e52018-05-16 17:27:11 +0200265 u32 swp_fmc;
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200266 ofnode bank_node;
267 char *bank_name;
268 u8 bank = 0;
Patrice Chotard0b3f7892017-12-12 09:49:41 +0100269 int ret;
270
Radoslaw Pietrzyk246a5e52018-05-16 17:27:11 +0200271 ret = dev_read_phandle_with_args(dev, "st,syscfg", NULL, 0, 0,
Patrice Chotard0b3f7892017-12-12 09:49:41 +0100272 &args);
Radoslaw Pietrzyk246a5e52018-05-16 17:27:11 +0200273 if (ret) {
274 dev_dbg(dev, "%s: can't find syscon device (%d)\n", __func__, ret);
275 } else {
Patrice Chotard0b3f7892017-12-12 09:49:41 +0100276 syscfg_base = (u32 *)ofnode_get_addr(args.node);
277
Radoslaw Pietrzyk246a5e52018-05-16 17:27:11 +0200278 mem_remap = dev_read_u32_default(dev, "st,mem_remap", NOT_FOUND);
279 if (mem_remap != NOT_FOUND) {
280 /* set memory mapping selection */
281 clrsetbits_le32(syscfg_base, MEM_MODE_MASK, mem_remap);
282 } else {
283 dev_dbg(dev, "%s: cannot find st,mem_remap property\n", __func__);
284 }
285
286 swp_fmc = dev_read_u32_default(dev, "st,swp_fmc", NOT_FOUND);
287 if (swp_fmc != NOT_FOUND) {
288 /* set fmc swapping selection */
289 clrsetbits_le32(syscfg_base, SWP_FMC_MASK, swp_fmc << SWP_FMC_OFFSET);
290 } else {
291 dev_dbg(dev, "%s: cannot find st,swp_fmc property\n", __func__);
292 }
293
294 dev_dbg(dev, "syscfg %x = %x\n", (u32)syscfg_base, *syscfg_base);
Patrice Chotard0b3f7892017-12-12 09:49:41 +0100295 }
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700296
Patrice Chotardf39b90d2017-07-18 17:37:26 +0200297 dev_for_each_subnode(bank_node, dev) {
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200298 /* extract the bank index from DT */
299 bank_name = (char *)ofnode_get_name(bank_node);
300 strsep(&bank_name, "@");
301 if (!bank_name) {
Masahiro Yamada9b643e32017-09-16 14:10:41 +0900302 pr_err("missing sdram bank index");
Patrice Chotardf39b90d2017-07-18 17:37:26 +0200303 return -EINVAL;
304 }
305
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200306 bank_params = &params->bank_params[bank];
307 strict_strtoul(bank_name, 10,
308 (long unsigned int *)&bank_params->target_bank);
Patrice Chotardf39b90d2017-07-18 17:37:26 +0200309
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200310 if (bank_params->target_bank >= MAX_SDRAM_BANK) {
Masahiro Yamada9b643e32017-09-16 14:10:41 +0900311 pr_err("Found bank %d , but only bank 0 and 1 are supported",
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200312 bank_params->target_bank);
Patrice Chotardf39b90d2017-07-18 17:37:26 +0200313 return -EINVAL;
314 }
315
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200316 debug("Find bank %s %u\n", bank_name, bank_params->target_bank);
317
318 params->bank_params[bank].sdram_control =
319 (struct stm32_sdram_control *)
320 ofnode_read_u8_array_ptr(bank_node,
321 "st,sdram-control",
322 sizeof(struct stm32_sdram_control));
323
324 if (!params->bank_params[bank].sdram_control) {
Masahiro Yamada9b643e32017-09-16 14:10:41 +0900325 pr_err("st,sdram-control not found for %s",
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200326 ofnode_get_name(bank_node));
327 return -EINVAL;
328 }
329
330
331 params->bank_params[bank].sdram_timing =
332 (struct stm32_sdram_timing *)
333 ofnode_read_u8_array_ptr(bank_node,
334 "st,sdram-timing",
335 sizeof(struct stm32_sdram_timing));
336
337 if (!params->bank_params[bank].sdram_timing) {
Masahiro Yamada9b643e32017-09-16 14:10:41 +0900338 pr_err("st,sdram-timing not found for %s",
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200339 ofnode_get_name(bank_node));
340 return -EINVAL;
341 }
342
343
344 bank_params->sdram_ref_count = ofnode_read_u32_default(bank_node,
Vikas Manochabfea69a2017-04-10 15:03:03 -0700345 "st,sdram-refcount", 8196);
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200346 bank++;
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700347 }
348
Patrice Chotardf303aaf2017-07-18 17:37:27 +0200349 params->no_sdram_banks = bank;
350 debug("%s, no of banks = %d\n", __func__, params->no_sdram_banks);
351
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700352 return 0;
353}
354
Vikas Manocha910a52e2017-04-10 15:02:52 -0700355static int stm32_fmc_probe(struct udevice *dev)
356{
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200357 struct stm32_sdram_params *params = dev_get_platdata(dev);
Vikas Manochad0b24c12017-04-10 15:02:55 -0700358 int ret;
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200359 fdt_addr_t addr;
360
361 addr = dev_read_addr(dev);
362 if (addr == FDT_ADDR_T_NONE)
363 return -EINVAL;
364
365 params->base = (struct stm32_fmc_regs *)addr;
Patrice Chotard70166512017-07-18 17:37:29 +0200366 params->family = dev_get_driver_data(dev);
Patrice Chotard1421e0a2017-07-18 17:37:25 +0200367
Patrice Chotard14a50e32017-05-30 15:06:31 +0200368#ifdef CONFIG_CLK
Vikas Manochad0b24c12017-04-10 15:02:55 -0700369 struct clk clk;
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700370
Vikas Manochad0b24c12017-04-10 15:02:55 -0700371 ret = clk_get_by_index(dev, 0, &clk);
372 if (ret < 0)
373 return ret;
374
375 ret = clk_enable(&clk);
376
377 if (ret) {
378 dev_err(dev, "failed to enable clock\n");
379 return ret;
380 }
381#endif
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700382 ret = stm32_sdram_init(dev);
383 if (ret)
384 return ret;
385
Vikas Manocha910a52e2017-04-10 15:02:52 -0700386 return 0;
387}
388
389static int stm32_fmc_get_info(struct udevice *dev, struct ram_info *info)
390{
Vikas Manocha910a52e2017-04-10 15:02:52 -0700391 return 0;
392}
393
394static struct ram_ops stm32_fmc_ops = {
395 .get_info = stm32_fmc_get_info,
396};
397
398static const struct udevice_id stm32_fmc_ids[] = {
Patrice Chotard70166512017-07-18 17:37:29 +0200399 { .compatible = "st,stm32-fmc", .data = STM32F7_FMC },
400 { .compatible = "st,stm32h7-fmc", .data = STM32H7_FMC },
Vikas Manocha910a52e2017-04-10 15:02:52 -0700401 { }
402};
403
404U_BOOT_DRIVER(stm32_fmc) = {
405 .name = "stm32_fmc",
406 .id = UCLASS_RAM,
407 .of_match = stm32_fmc_ids,
408 .ops = &stm32_fmc_ops,
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700409 .ofdata_to_platdata = stm32_fmc_ofdata_to_platdata,
Vikas Manocha910a52e2017-04-10 15:02:52 -0700410 .probe = stm32_fmc_probe,
Vikas Manocha6c9a1002017-04-10 15:02:56 -0700411 .platdata_auto_alloc_size = sizeof(struct stm32_sdram_params),
Vikas Manocha910a52e2017-04-10 15:02:52 -0700412};