Lines Matching +full:timeout +full:- +full:press +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0+
12 #include <common.h> /* core U-Boot definitions */
13 #include <spartan3.h> /* Spartan-II device family */
34 #define CONFIG_SYS_FPGA_WAIT CONFIG_SYS_HZ/100 /* 10 ms */
45 /* ------------------------------------------------------------------------- */
46 /* Spartan-II Generic Implementation */
52 switch (desc->iface) { in spartan3_load()
65 __FUNCTION__, desc->iface); in spartan3_load()
75 switch (desc->iface) { in spartan3_dump()
88 __FUNCTION__, desc->iface); in spartan3_dump()
100 /* ------------------------------------------------------------------------- */
101 /* Spartan-II Slave Parallel Generic Implementation */
106 xilinx_spartan3_slave_parallel_fns *fn = desc->iface_fns; in spartan3_sp_load()
114 int cookie = desc->cookie; /* make a local copy */ in spartan3_sp_load()
132 __FUNCTION__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, in spartan3_sp_load()
133 fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, fn->busy, in spartan3_sp_load()
134 fn->abort, fn->post); in spartan3_sp_load()
139 * the Spartan-II Family. in spartan3_sp_load()
147 if (*fn->pre) { in spartan3_sp_load()
148 (*fn->pre) (cookie); in spartan3_sp_load()
152 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */ in spartan3_sp_load()
156 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */ in spartan3_sp_load()
163 puts ("** Timeout waiting for INIT to clear.\n"); in spartan3_sp_load()
164 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
167 } while ((*fn->init) (cookie) && (*fn->busy) (cookie)); in spartan3_sp_load()
169 (*fn->wr) (true, true, cookie); /* Assert write, commit */ in spartan3_sp_load()
170 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */ in spartan3_sp_load()
171 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
175 /* XXX - do we check for an Ctrl-C press in here ??? */ in spartan3_sp_load()
176 /* XXX - Check the error bit? */ in spartan3_sp_load()
178 (*fn->wdata) (data[bytecount++], true, cookie); /* write the data */ in spartan3_sp_load()
180 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
182 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
186 while ((*fn->busy) (cookie)) { in spartan3_sp_load()
187 /* XXX - we should have a check in here somewhere to in spartan3_sp_load()
191 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
193 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
196 puts ("** Timeout waiting for BUSY to clear.\n"); in spartan3_sp_load()
197 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
210 (*fn->cs) (false, true, cookie); /* Deassert the chip select */ in spartan3_sp_load()
211 (*fn->wr) (false, true, cookie); /* Deassert the write pin */ in spartan3_sp_load()
220 while ((*fn->done) (cookie) == FPGA_FAIL) { in spartan3_sp_load()
221 /* XXX - we should have a check in here somewhere to in spartan3_sp_load()
225 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
227 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
230 puts ("** Timeout waiting for DONE to clear.\n"); in spartan3_sp_load()
231 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
240 if (*fn->post) in spartan3_sp_load()
241 (*fn->post) (cookie); in spartan3_sp_load()
260 xilinx_spartan3_slave_parallel_fns *fn = desc->iface_fns; in spartan3_sp_dump()
265 int cookie = desc->cookie; /* make a local copy */ in spartan3_sp_dump()
269 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */ in spartan3_sp_dump()
270 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
274 /* XXX - do we check for an Ctrl-C press in here ??? */ in spartan3_sp_dump()
276 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_dump()
277 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
278 (*fn->rdata) (&(data[bytecount++]), cookie); /* read the data */ in spartan3_sp_dump()
285 (*fn->cs) (false, false, cookie); /* Deassert the chip select */ in spartan3_sp_dump()
286 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_dump()
287 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
294 /* XXX - checksum the data? */ in spartan3_sp_dump()
303 /* ------------------------------------------------------------------------- */
308 xilinx_spartan3_slave_serial_fns *fn = desc->iface_fns; in spartan3_ss_load()
318 int cookie = desc->cookie; /* make a local copy */ in spartan3_ss_load()
329 __FUNCTION__, &fn, fn, fn->pgm, fn->init, in spartan3_ss_load()
330 fn->clk, fn->wr, fn->done); in spartan3_ss_load()
338 if (*fn->pre) { in spartan3_ss_load()
339 (*fn->pre) (cookie); in spartan3_ss_load()
343 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */ in spartan3_ss_load()
350 puts ("** Timeout waiting for INIT to start.\n"); in spartan3_ss_load()
351 if (*fn->abort) in spartan3_ss_load()
352 (*fn->abort) (cookie); in spartan3_ss_load()
355 } while (!(*fn->init) (cookie)); in spartan3_ss_load()
359 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */ in spartan3_ss_load()
366 puts ("** Timeout waiting for INIT to clear.\n"); in spartan3_ss_load()
367 if (*fn->abort) in spartan3_ss_load()
368 (*fn->abort) (cookie); in spartan3_ss_load()
371 } while ((*fn->init) (cookie)); in spartan3_ss_load()
374 if(*fn->bwr) in spartan3_ss_load()
375 (*fn->bwr) (data, bsize, true, cookie); in spartan3_ss_load()
381 if ((*fn->done) (cookie) == 0 && (*fn->init) (cookie)) { in spartan3_ss_load()
383 if (*fn->abort) in spartan3_ss_load()
384 (*fn->abort) (cookie); in spartan3_ss_load()
391 (*fn->clk) (false, true, cookie); in spartan3_ss_load()
394 (*fn->wr) ((val & 0x80), true, cookie); in spartan3_ss_load()
397 (*fn->clk) (true, true, cookie); in spartan3_ss_load()
400 i --; in spartan3_ss_load()
419 (*fn->wr) (true, true, cookie); in spartan3_ss_load()
421 while (! (*fn->done) (cookie)) { in spartan3_ss_load()
422 /* XXX - we should have a check in here somewhere to in spartan3_ss_load()
426 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_ss_load()
428 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_ss_load()
433 puts ("** Timeout waiting for DONE to clear.\n"); in spartan3_ss_load()
443 if (*fn->post) in spartan3_ss_load()
444 (*fn->post) (cookie); in spartan3_ss_load()
463 /* boundary-scan interfaces. */ in spartan3_ss_dump()