diff options
author | Wolfgang Wegner <w.wegner@astro-kom.de> | 2010-04-23 11:08:05 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-12-09 10:24:10 +0100 |
commit | 9d8461cc696c99cbf2378d07d87198a732fa03ba (patch) | |
tree | df376e1948b1ab8e8b96dae32de08f9eff88d15e /drivers | |
parent | 3f7cfeea2dc200cc54081df91decb2ca14afceca (diff) | |
download | u-boot-imx-9d8461cc696c99cbf2378d07d87198a732fa03ba.zip u-boot-imx-9d8461cc696c99cbf2378d07d87198a732fa03ba.tar.gz u-boot-imx-9d8461cc696c99cbf2378d07d87198a732fa03ba.tar.bz2 |
add Xilinx_abort_fn to Xilinx_Spartan3_Slave_Serial_fns
Currently the hardware was left in an undefined state in case Spartan3
serial load failed. This patch adds Xilinx_abort_fn to give the board
a possibility to clean up in this case.
Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/fpga/spartan3.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/fpga/spartan3.c b/drivers/fpga/spartan3.c index 7a89b56..1dd6f26 100644 --- a/drivers/fpga/spartan3.c +++ b/drivers/fpga/spartan3.c @@ -366,6 +366,8 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize) CONFIG_FPGA_DELAY (); if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */ puts ("** Timeout waiting for INIT to start.\n"); + if (*fn->abort) + (*fn->abort) (cookie); return FPGA_FAIL; } } while (!(*fn->init) (cookie)); @@ -380,6 +382,8 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize) CONFIG_FPGA_DELAY (); if (get_timer (ts) > CONFIG_SYS_FPGA_WAIT) { /* check the time */ puts ("** Timeout waiting for INIT to clear.\n"); + if (*fn->abort) + (*fn->abort) (cookie); return FPGA_FAIL; } } while ((*fn->init) (cookie)); @@ -394,6 +398,8 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize) while DONE is low (inactive) */ if ((*fn->done) (cookie) == 0 && (*fn->init) (cookie)) { puts ("** CRC error during FPGA load.\n"); + if (*fn->abort) + (*fn->abort) (cookie); return (FPGA_FAIL); } val = data [bytecount ++]; |