Lines Matching +full:- +full:- +full:init
5 * SPDX-License-Identifier: GPL-2.0+
13 #include <common.h> /* core U-Boot definitions */
14 #include <spartan3.h> /* Spartan-II device family */
46 /* ------------------------------------------------------------------------- */
47 /* Spartan-II Generic Implementation */
53 switch (desc->iface) { in spartan3_load()
66 __FUNCTION__, desc->iface); in spartan3_load()
76 switch (desc->iface) { in spartan3_dump()
89 __FUNCTION__, desc->iface); in spartan3_dump()
101 /* ------------------------------------------------------------------------- */
102 /* Spartan-II Slave Parallel Generic Implementation */
107 xilinx_spartan3_slave_parallel_fns *fn = desc->iface_fns; in spartan3_sp_load()
115 int cookie = desc->cookie; /* make a local copy */ in spartan3_sp_load()
123 "init:\t0x%p\n" in spartan3_sp_load()
133 __FUNCTION__, &fn, fn, fn->pre, fn->pgm, fn->init, fn->err, in spartan3_sp_load()
134 fn->clk, fn->cs, fn->wr, fn->rdata, fn->wdata, fn->busy, in spartan3_sp_load()
135 fn->abort, fn->post); in spartan3_sp_load()
140 * the Spartan-II Family. in spartan3_sp_load()
148 if (*fn->pre) { in spartan3_sp_load()
149 (*fn->pre) (cookie); in spartan3_sp_load()
153 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */ in spartan3_sp_load()
157 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */ in spartan3_sp_load()
160 /* Now wait for INIT and BUSY to go high */ in spartan3_sp_load()
164 puts ("** Timeout waiting for INIT to clear.\n"); in spartan3_sp_load()
165 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
168 } while ((*fn->init) (cookie) && (*fn->busy) (cookie)); in spartan3_sp_load()
170 (*fn->wr) (true, true, cookie); /* Assert write, commit */ in spartan3_sp_load()
171 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */ in spartan3_sp_load()
172 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
176 /* XXX - do we check for an Ctrl-C press in here ??? */ in spartan3_sp_load()
177 /* XXX - Check the error bit? */ in spartan3_sp_load()
179 (*fn->wdata) (data[bytecount++], true, cookie); /* write the data */ in spartan3_sp_load()
181 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
183 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
187 while ((*fn->busy) (cookie)) { in spartan3_sp_load()
188 /* XXX - we should have a check in here somewhere to in spartan3_sp_load()
192 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
194 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
198 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
211 (*fn->cs) (false, true, cookie); /* Deassert the chip select */ in spartan3_sp_load()
212 (*fn->wr) (false, true, cookie); /* Deassert the write pin */ in spartan3_sp_load()
221 while ((*fn->done) (cookie) == FPGA_FAIL) { in spartan3_sp_load()
222 /* XXX - we should have a check in here somewhere to in spartan3_sp_load()
226 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_load()
228 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_load()
232 (*fn->abort) (cookie); /* abort the burn */ in spartan3_sp_load()
241 if (*fn->post) in spartan3_sp_load()
242 (*fn->post) (cookie); in spartan3_sp_load()
261 xilinx_spartan3_slave_parallel_fns *fn = desc->iface_fns; in spartan3_sp_dump()
266 int cookie = desc->cookie; /* make a local copy */ in spartan3_sp_dump()
270 (*fn->cs) (true, true, cookie); /* Assert chip select, commit */ in spartan3_sp_dump()
271 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
275 /* XXX - do we check for an Ctrl-C press in here ??? */ in spartan3_sp_dump()
277 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_dump()
278 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
279 (*fn->rdata) (&(data[bytecount++]), cookie); /* read the data */ in spartan3_sp_dump()
286 (*fn->cs) (false, false, cookie); /* Deassert the chip select */ in spartan3_sp_dump()
287 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_sp_dump()
288 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_sp_dump()
295 /* XXX - checksum the data? */ in spartan3_sp_dump()
304 /* ------------------------------------------------------------------------- */
309 xilinx_spartan3_slave_serial_fns *fn = desc->iface_fns; in spartan3_ss_load()
319 int cookie = desc->cookie; /* make a local copy */ in spartan3_ss_load()
326 "init:\t0x%p\n" in spartan3_ss_load()
330 __FUNCTION__, &fn, fn, fn->pgm, fn->init, in spartan3_ss_load()
331 fn->clk, fn->wr, fn->done); in spartan3_ss_load()
339 if (*fn->pre) { in spartan3_ss_load()
340 (*fn->pre) (cookie); in spartan3_ss_load()
344 (*fn->pgm) (true, true, cookie); /* Assert the program, commit */ in spartan3_ss_load()
346 /* Wait for INIT state (init low) */ in spartan3_ss_load()
351 puts ("** Timeout waiting for INIT to start.\n"); in spartan3_ss_load()
352 if (*fn->abort) in spartan3_ss_load()
353 (*fn->abort) (cookie); in spartan3_ss_load()
356 } while (!(*fn->init) (cookie)); in spartan3_ss_load()
360 (*fn->pgm) (false, true, cookie); /* Deassert the program, commit */ in spartan3_ss_load()
363 /* Now wait for INIT to go high */ in spartan3_ss_load()
367 puts ("** Timeout waiting for INIT to clear.\n"); in spartan3_ss_load()
368 if (*fn->abort) in spartan3_ss_load()
369 (*fn->abort) (cookie); in spartan3_ss_load()
372 } while ((*fn->init) (cookie)); in spartan3_ss_load()
375 if(*fn->bwr) in spartan3_ss_load()
376 (*fn->bwr) (data, bsize, true, cookie); in spartan3_ss_load()
380 /* Xilinx detects an error if INIT goes low (active) in spartan3_ss_load()
382 if ((*fn->done) (cookie) == 0 && (*fn->init) (cookie)) { in spartan3_ss_load()
384 if (*fn->abort) in spartan3_ss_load()
385 (*fn->abort) (cookie); in spartan3_ss_load()
392 (*fn->clk) (false, true, cookie); in spartan3_ss_load()
395 (*fn->wr) ((val & 0x80), true, cookie); in spartan3_ss_load()
398 (*fn->clk) (true, true, cookie); in spartan3_ss_load()
401 i --; in spartan3_ss_load()
420 (*fn->wr) (true, true, cookie); in spartan3_ss_load()
422 while (! (*fn->done) (cookie)) { in spartan3_ss_load()
423 /* XXX - we should have a check in here somewhere to in spartan3_ss_load()
427 (*fn->clk) (false, true, cookie); /* Deassert the clock pin */ in spartan3_ss_load()
429 (*fn->clk) (true, true, cookie); /* Assert the clock pin */ in spartan3_ss_load()
444 if (*fn->post) in spartan3_ss_load()
445 (*fn->post) (cookie); in spartan3_ss_load()
464 /* boundary-scan interfaces. */ in spartan3_ss_dump()