blob: 47692e32076b39fd6f9608055bbbefb65b5553a3 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
wdenke2211742002-11-02 23:30:20 +00002/*
3 * (C) Copyright 2002
4 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
wdenke2211742002-11-02 23:30:20 +00005 */
6
7#include <common.h> /* core U-Boot definitions */
8#include <spartan2.h> /* Spartan-II device family */
9
wdenke2211742002-11-02 23:30:20 +000010/* Define FPGA_DEBUG to get debug printf's */
11#ifdef FPGA_DEBUG
12#define PRINTF(fmt,args...) printf (fmt ,##args)
13#else
14#define PRINTF(fmt,args...)
15#endif
16
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020017#undef CONFIG_SYS_FPGA_CHECK_BUSY
wdenke2211742002-11-02 23:30:20 +000018
19/* Note: The assumption is that we cannot possibly run fast enough to
20 * overrun the device (the Slave Parallel mode can free run at 50MHz).
21 * If there is a need to operate slower, define CONFIG_FPGA_DELAY in
22 * the board config file to slow things down.
23 */
24#ifndef CONFIG_FPGA_DELAY
25#define CONFIG_FPGA_DELAY()
26#endif
27
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020028#ifndef CONFIG_SYS_FPGA_WAIT
29#define CONFIG_SYS_FPGA_WAIT CONFIG_SYS_HZ/100 /* 10 ms */
wdenke2211742002-11-02 23:30:20 +000030#endif
31
Michal Simek25e1e2e2014-03-13 12:49:21 +010032static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize);
33static int spartan2_sp_dump(xilinx_desc *desc, const void *buf, size_t bsize);
34/* static int spartan2_sp_info(xilinx_desc *desc ); */
wdenke2211742002-11-02 23:30:20 +000035
Michal Simek25e1e2e2014-03-13 12:49:21 +010036static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize);
37static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize);
38/* static int spartan2_ss_info(xilinx_desc *desc ); */
wdenke2211742002-11-02 23:30:20 +000039
40/* ------------------------------------------------------------------------- */
41/* Spartan-II Generic Implementation */
Michal Simek14663652014-05-02 14:09:30 +020042static int spartan2_load(xilinx_desc *desc, const void *buf, size_t bsize,
Oleksandr Suvorovc0806cc2022-07-22 17:16:10 +030043 bitstream_type bstype, int flags)
wdenke2211742002-11-02 23:30:20 +000044{
45 int ret_val = FPGA_FAIL;
46
47 switch (desc->iface) {
48 case slave_serial:
49 PRINTF ("%s: Launching Slave Serial Load\n", __FUNCTION__);
Michal Simek5206cca2014-03-13 11:23:43 +010050 ret_val = spartan2_ss_load(desc, buf, bsize);
wdenke2211742002-11-02 23:30:20 +000051 break;
52
53 case slave_parallel:
54 PRINTF ("%s: Launching Slave Parallel Load\n", __FUNCTION__);
Michal Simek5206cca2014-03-13 11:23:43 +010055 ret_val = spartan2_sp_load(desc, buf, bsize);
wdenke2211742002-11-02 23:30:20 +000056 break;
57
58 default:
59 printf ("%s: Unsupported interface type, %d\n",
60 __FUNCTION__, desc->iface);
61 }
62
63 return ret_val;
64}
65
Michal Simek75fafac2014-03-13 13:07:57 +010066static int spartan2_dump(xilinx_desc *desc, const void *buf, size_t bsize)
wdenke2211742002-11-02 23:30:20 +000067{
68 int ret_val = FPGA_FAIL;
69
70 switch (desc->iface) {
71 case slave_serial:
72 PRINTF ("%s: Launching Slave Serial Dump\n", __FUNCTION__);
Michal Simek5206cca2014-03-13 11:23:43 +010073 ret_val = spartan2_ss_dump(desc, buf, bsize);
wdenke2211742002-11-02 23:30:20 +000074 break;
75
76 case slave_parallel:
77 PRINTF ("%s: Launching Slave Parallel Dump\n", __FUNCTION__);
Michal Simek5206cca2014-03-13 11:23:43 +010078 ret_val = spartan2_sp_dump(desc, buf, bsize);
wdenke2211742002-11-02 23:30:20 +000079 break;
80
81 default:
82 printf ("%s: Unsupported interface type, %d\n",
83 __FUNCTION__, desc->iface);
84 }
85
86 return ret_val;
87}
88
Michal Simek75fafac2014-03-13 13:07:57 +010089static int spartan2_info(xilinx_desc *desc)
wdenke2211742002-11-02 23:30:20 +000090{
91 return FPGA_SUCCESS;
92}
93
94
wdenke2211742002-11-02 23:30:20 +000095/* ------------------------------------------------------------------------- */
96/* Spartan-II Slave Parallel Generic Implementation */
97
Michal Simek25e1e2e2014-03-13 12:49:21 +010098static int spartan2_sp_load(xilinx_desc *desc, const void *buf, size_t bsize)
wdenke2211742002-11-02 23:30:20 +000099{
100 int ret_val = FPGA_FAIL; /* assume the worst */
Michal Simek5206cca2014-03-13 11:23:43 +0100101 xilinx_spartan2_slave_parallel_fns *fn = desc->iface_fns;
wdenke2211742002-11-02 23:30:20 +0000102
103 PRINTF ("%s: start with interface functions @ 0x%p\n",
104 __FUNCTION__, fn);
105
106 if (fn) {
107 size_t bytecount = 0;
108 unsigned char *data = (unsigned char *) buf;
109 int cookie = desc->cookie; /* make a local copy */
110 unsigned long ts; /* timestamp */
111
112 PRINTF ("%s: Function Table:\n"
113 "ptr:\t0x%p\n"
114 "struct: 0x%p\n"
115 "pre: 0x%p\n"
116 "pgm:\t0x%p\n"
117 "init:\t0x%p\n"
118 "err:\t0x%p\n"
119 "clk:\t0x%p\n"
120 "cs:\t0x%p\n"
121 "wr:\t0x%p\n"
122 "read data:\t0x%p\n"
123 "write data:\t0x%p\n"
124 "busy:\t0x%p\n"
125 "abort:\t0x%p\n",
126 "post:\t0x%p\n\n",
127 __FUNCTION__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err,
128 fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, fn->busy,
129 fn->abort, fn->post);
130
131 /*
132 * This code is designed to emulate the "Express Style"
133 * Continuous Data Loading in Slave Parallel Mode for
134 * the Spartan-II Family.
135 */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200136#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenke2211742002-11-02 23:30:20 +0000137 printf ("Loading FPGA Device %d...\n", cookie);
138#endif
139 /*
140 * Run the pre configuration function if there is one.
141 */
142 if (*fn->pre) {
143 (*fn->pre) (cookie);
144 }
145
146 /* Establish the initial state */
York Sun4a598092013-04-01 11:29:11 -0700147 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */
wdenke2211742002-11-02 23:30:20 +0000148
149 /* Get ready for the burn */
150 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700151 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */
wdenke2211742002-11-02 23:30:20 +0000152
153 ts = get_timer (0); /* get current time */
154 /* Now wait for INIT and BUSY to go high */
155 do {
156 CONFIG_FPGA_DELAY ();
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200157 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenke2211742002-11-02 23:30:20 +0000158 puts ("** Timeout waiting for INIT to clear.\n");
159 (*fn->abort) (cookie); /* abort the burn */
160 return FPGA_FAIL;
161 }
162 } while ((*fn->init) (cookie) && (*fn->busy) (cookie));
163
York Sun4a598092013-04-01 11:29:11 -0700164 (*fn->wr) (true, true, cookie); /* Assert write, commit */
165 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
166 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000167
168 /* Load the data */
169 while (bytecount < bsize) {
170 /* XXX - do we check for an Ctrl-C press in here ??? */
171 /* XXX - Check the error bit? */
172
York Sun4a598092013-04-01 11:29:11 -0700173 (*fn->wdata) (data[bytecount++], true, cookie); /* write the data */
wdenke2211742002-11-02 23:30:20 +0000174 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700175 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000176 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700177 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000178
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200179#ifdef CONFIG_SYS_FPGA_CHECK_BUSY
wdenke2211742002-11-02 23:30:20 +0000180 ts = get_timer (0); /* get current time */
181 while ((*fn->busy) (cookie)) {
182 /* XXX - we should have a check in here somewhere to
183 * make sure we aren't busy forever... */
184
185 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700186 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000187 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700188 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000189
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200190 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenke2211742002-11-02 23:30:20 +0000191 puts ("** Timeout waiting for BUSY to clear.\n");
192 (*fn->abort) (cookie); /* abort the burn */
193 return FPGA_FAIL;
194 }
195 }
196#endif
197
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200198#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenke2211742002-11-02 23:30:20 +0000199 if (bytecount % (bsize / 40) == 0)
200 putc ('.'); /* let them know we are alive */
201#endif
202 }
203
204 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700205 (*fn->cs) (false, true, cookie); /* Deassert the chip select */
206 (*fn->wr) (false, true, cookie); /* Deassert the write pin */
wdenke2211742002-11-02 23:30:20 +0000207
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200208#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenke2211742002-11-02 23:30:20 +0000209 putc ('\n'); /* terminate the dotted line */
210#endif
211
212 /* now check for done signal */
213 ts = get_timer (0); /* get current time */
214 ret_val = FPGA_SUCCESS;
215 while ((*fn->done) (cookie) == FPGA_FAIL) {
wdenke2211742002-11-02 23:30:20 +0000216
217 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700218 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000219 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700220 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000221
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200222 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenke2211742002-11-02 23:30:20 +0000223 puts ("** Timeout waiting for DONE to clear.\n");
224 (*fn->abort) (cookie); /* abort the burn */
225 ret_val = FPGA_FAIL;
226 break;
227 }
228 }
229
wdenke2211742002-11-02 23:30:20 +0000230 /*
231 * Run the post configuration function if there is one.
232 */
Matthias Fuchsf73e0ed2009-02-15 22:28:36 +0100233 if (*fn->post)
wdenke2211742002-11-02 23:30:20 +0000234 (*fn->post) (cookie);
wdenke2211742002-11-02 23:30:20 +0000235
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200236#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
Matthias Fuchsf73e0ed2009-02-15 22:28:36 +0100237 if (ret_val == FPGA_SUCCESS)
238 puts ("Done.\n");
239 else
wdenke2211742002-11-02 23:30:20 +0000240 puts ("Fail.\n");
241#endif
wdenke2211742002-11-02 23:30:20 +0000242
243 } else {
244 printf ("%s: NULL Interface function table!\n", __FUNCTION__);
245 }
246
247 return ret_val;
248}
249
Michal Simek25e1e2e2014-03-13 12:49:21 +0100250static int spartan2_sp_dump(xilinx_desc *desc, const void *buf, size_t bsize)
wdenke2211742002-11-02 23:30:20 +0000251{
252 int ret_val = FPGA_FAIL; /* assume the worst */
Michal Simek5206cca2014-03-13 11:23:43 +0100253 xilinx_spartan2_slave_parallel_fns *fn = desc->iface_fns;
wdenke2211742002-11-02 23:30:20 +0000254
255 if (fn) {
256 unsigned char *data = (unsigned char *) buf;
257 size_t bytecount = 0;
258 int cookie = desc->cookie; /* make a local copy */
259
260 printf ("Starting Dump of FPGA Device %d...\n", cookie);
261
York Sun4a598092013-04-01 11:29:11 -0700262 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */
263 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000264
265 /* dump the data */
266 while (bytecount < bsize) {
267 /* XXX - do we check for an Ctrl-C press in here ??? */
268
York Sun4a598092013-04-01 11:29:11 -0700269 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
270 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000271 (*fn->rdata) (&(data[bytecount++]), cookie); /* read the data */
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200272#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenke2211742002-11-02 23:30:20 +0000273 if (bytecount % (bsize / 40) == 0)
274 putc ('.'); /* let them know we are alive */
275#endif
276 }
277
York Sun4a598092013-04-01 11:29:11 -0700278 (*fn->cs) (false, false, cookie); /* Deassert the chip select */
279 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
280 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenke2211742002-11-02 23:30:20 +0000281
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200282#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenke2211742002-11-02 23:30:20 +0000283 putc ('\n'); /* terminate the dotted line */
284#endif
285 puts ("Done.\n");
286
287 /* XXX - checksum the data? */
288 } else {
289 printf ("%s: NULL Interface function table!\n", __FUNCTION__);
290 }
291
292 return ret_val;
293}
294
wdenke2211742002-11-02 23:30:20 +0000295
296/* ------------------------------------------------------------------------- */
297
Michal Simek25e1e2e2014-03-13 12:49:21 +0100298static int spartan2_ss_load(xilinx_desc *desc, const void *buf, size_t bsize)
wdenke2211742002-11-02 23:30:20 +0000299{
wdenk57b2d802003-06-27 21:31:46 +0000300 int ret_val = FPGA_FAIL; /* assume the worst */
Michal Simek5206cca2014-03-13 11:23:43 +0100301 xilinx_spartan2_slave_serial_fns *fn = desc->iface_fns;
wdenk57b2d802003-06-27 21:31:46 +0000302 int i;
Matthias Fuchsb845b1e2007-12-27 17:13:05 +0100303 unsigned char val;
wdenk57b2d802003-06-27 21:31:46 +0000304
wdenk1272e232002-11-10 22:06:23 +0000305 PRINTF ("%s: start with interface functions @ 0x%p\n",
306 __FUNCTION__, fn);
307
308 if (fn) {
309 size_t bytecount = 0;
310 unsigned char *data = (unsigned char *) buf;
311 int cookie = desc->cookie; /* make a local copy */
312 unsigned long ts; /* timestamp */
313
314 PRINTF ("%s: Function Table:\n"
315 "ptr:\t0x%p\n"
316 "struct: 0x%p\n"
317 "pgm:\t0x%p\n"
318 "init:\t0x%p\n"
319 "clk:\t0x%p\n"
320 "wr:\t0x%p\n"
321 "done:\t0x%p\n\n",
wdenk57b2d802003-06-27 21:31:46 +0000322 __FUNCTION__, &fn, fn, fn->pgm, fn->init,
323 fn->clk, fn->wr, fn->done);
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200324#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenk1272e232002-11-10 22:06:23 +0000325 printf ("Loading FPGA Device %d...\n", cookie);
326#endif
327
328 /*
329 * Run the pre configuration function if there is one.
330 */
331 if (*fn->pre) {
332 (*fn->pre) (cookie);
333 }
334
335 /* Establish the initial state */
York Sun4a598092013-04-01 11:29:11 -0700336 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */
wdenk1272e232002-11-10 22:06:23 +0000337
wdenk57b2d802003-06-27 21:31:46 +0000338 /* Wait for INIT state (init low) */
wdenk1272e232002-11-10 22:06:23 +0000339 ts = get_timer (0); /* get current time */
340 do {
341 CONFIG_FPGA_DELAY ();
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200342 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenk1272e232002-11-10 22:06:23 +0000343 puts ("** Timeout waiting for INIT to start.\n");
344 return FPGA_FAIL;
345 }
346 } while (!(*fn->init) (cookie));
wdenk57b2d802003-06-27 21:31:46 +0000347
wdenk1272e232002-11-10 22:06:23 +0000348 /* Get ready for the burn */
349 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700350 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */
wdenk1272e232002-11-10 22:06:23 +0000351
352 ts = get_timer (0); /* get current time */
353 /* Now wait for INIT to go high */
354 do {
355 CONFIG_FPGA_DELAY ();
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200356 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenk1272e232002-11-10 22:06:23 +0000357 puts ("** Timeout waiting for INIT to clear.\n");
358 return FPGA_FAIL;
359 }
360 } while ((*fn->init) (cookie));
361
362 /* Load the data */
363 while (bytecount < bsize) {
wdenk57b2d802003-06-27 21:31:46 +0000364
365 /* Xilinx detects an error if INIT goes low (active)
366 while DONE is low (inactive) */
367 if ((*fn->done) (cookie) == 0 && (*fn->init) (cookie)) {
368 puts ("** CRC error during FPGA load.\n");
369 return (FPGA_FAIL);
370 }
371 val = data [bytecount ++];
372 i = 8;
373 do {
374 /* Deassert the clock */
York Sun4a598092013-04-01 11:29:11 -0700375 (*fn->clk) (false, true, cookie);
wdenk57b2d802003-06-27 21:31:46 +0000376 CONFIG_FPGA_DELAY ();
377 /* Write data */
York Sun4a598092013-04-01 11:29:11 -0700378 (*fn->wr) ((val & 0x80), true, cookie);
wdenk57b2d802003-06-27 21:31:46 +0000379 CONFIG_FPGA_DELAY ();
380 /* Assert the clock */
York Sun4a598092013-04-01 11:29:11 -0700381 (*fn->clk) (true, true, cookie);
wdenk57b2d802003-06-27 21:31:46 +0000382 CONFIG_FPGA_DELAY ();
383 val <<= 1;
384 i --;
385 } while (i > 0);
386
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200387#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenk1272e232002-11-10 22:06:23 +0000388 if (bytecount % (bsize / 40) == 0)
389 putc ('.'); /* let them know we are alive */
390#endif
391 }
392
393 CONFIG_FPGA_DELAY ();
394
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200395#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
wdenk1272e232002-11-10 22:06:23 +0000396 putc ('\n'); /* terminate the dotted line */
397#endif
398
399 /* now check for done signal */
400 ts = get_timer (0); /* get current time */
401 ret_val = FPGA_SUCCESS;
York Sun4a598092013-04-01 11:29:11 -0700402 (*fn->wr) (true, true, cookie);
wdenk1272e232002-11-10 22:06:23 +0000403
404 while (! (*fn->done) (cookie)) {
wdenk1272e232002-11-10 22:06:23 +0000405
406 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700407 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */
wdenk1272e232002-11-10 22:06:23 +0000408 CONFIG_FPGA_DELAY ();
York Sun4a598092013-04-01 11:29:11 -0700409 (*fn->clk) (true, true, cookie); /* Assert the clock pin */
wdenk1272e232002-11-10 22:06:23 +0000410
wdenk57b2d802003-06-27 21:31:46 +0000411 putc ('*');
412
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200413 if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */
wdenk1272e232002-11-10 22:06:23 +0000414 puts ("** Timeout waiting for DONE to clear.\n");
415 ret_val = FPGA_FAIL;
416 break;
417 }
418 }
419 putc ('\n'); /* terminate the dotted line */
420
Matthias Fuchs518e2e142007-12-27 17:12:43 +0100421 /*
422 * Run the post configuration function if there is one.
423 */
Matthias Fuchsf73e0ed2009-02-15 22:28:36 +0100424 if (*fn->post)
Matthias Fuchs518e2e142007-12-27 17:12:43 +0100425 (*fn->post) (cookie);
Matthias Fuchs518e2e142007-12-27 17:12:43 +0100426
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +0200427#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
Matthias Fuchsf73e0ed2009-02-15 22:28:36 +0100428 if (ret_val == FPGA_SUCCESS)
wdenk1272e232002-11-10 22:06:23 +0000429 puts ("Done.\n");
Matthias Fuchsf73e0ed2009-02-15 22:28:36 +0100430 else
wdenk1272e232002-11-10 22:06:23 +0000431 puts ("Fail.\n");
wdenk1272e232002-11-10 22:06:23 +0000432#endif
433
434 } else {
435 printf ("%s: NULL Interface function table!\n", __FUNCTION__);
436 }
437
438 return ret_val;
wdenke2211742002-11-02 23:30:20 +0000439}
440
Michal Simek25e1e2e2014-03-13 12:49:21 +0100441static int spartan2_ss_dump(xilinx_desc *desc, const void *buf, size_t bsize)
wdenke2211742002-11-02 23:30:20 +0000442{
wdenk57b2d802003-06-27 21:31:46 +0000443 /* Readback is only available through the Slave Parallel and */
444 /* boundary-scan interfaces. */
wdenk1272e232002-11-10 22:06:23 +0000445 printf ("%s: Slave Serial Dumping is unavailable\n",
wdenke2211742002-11-02 23:30:20 +0000446 __FUNCTION__);
447 return FPGA_FAIL;
448}
Michal Simek75fafac2014-03-13 13:07:57 +0100449
450struct xilinx_fpga_op spartan2_op = {
451 .load = spartan2_load,
452 .dump = spartan2_dump,
453 .info = spartan2_info,
454};