summaryrefslogtreecommitdiff
path: root/drivers/fpga/spartan2.c
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2009-02-23 15:42:44 -0600
committerKim Phillips <kim.phillips@freescale.com>2009-02-23 15:42:44 -0600
commit741a1ea97335c88747a2de6677b92458d6ada00b (patch)
tree83ee5d31a46d2f1132eb0c968874b765704bd7df /drivers/fpga/spartan2.c
parent7511835b29f2074ebfa8ea794f0303ec8e49542b (diff)
parent32688e572ff96715b41420e9a7f280db6c399b65 (diff)
downloadu-boot-imx-741a1ea97335c88747a2de6677b92458d6ada00b.zip
u-boot-imx-741a1ea97335c88747a2de6677b92458d6ada00b.tar.gz
u-boot-imx-741a1ea97335c88747a2de6677b92458d6ada00b.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot
Diffstat (limited to 'drivers/fpga/spartan2.c')
-rw-r--r--drivers/fpga/spartan2.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/fpga/spartan2.c b/drivers/fpga/spartan2.c
index f5ba7fc..d745334 100644
--- a/drivers/fpga/spartan2.c
+++ b/drivers/fpga/spartan2.c
@@ -260,8 +260,6 @@ static int Spartan2_sp_load (Xilinx_desc * desc, void *buf, size_t bsize)
ts = get_timer (0); /* get current time */
ret_val = FPGA_SUCCESS;
while ((*fn->done) (cookie) == FPGA_FAIL) {
- /* XXX - we should have a check in here somewhere to
- * make sure we aren't busy forever... */
CONFIG_FPGA_DELAY ();
(*fn->clk) (FALSE, TRUE, cookie); /* Deassert the clock pin */
@@ -276,23 +274,18 @@ static int Spartan2_sp_load (Xilinx_desc * desc, void *buf, size_t bsize)
}
}
- if (ret_val == FPGA_SUCCESS) {
-#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
- puts ("Done.\n");
-#endif
- }
/*
* Run the post configuration function if there is one.
*/
- if (*fn->post) {
+ if (*fn->post)
(*fn->post) (cookie);
- }
- else {
#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
+ if (ret_val == FPGA_SUCCESS)
+ puts ("Done.\n");
+ else
puts ("Fail.\n");
#endif
- }
} else {
printf ("%s: NULL Interface function table!\n", __FUNCTION__);
@@ -412,8 +405,10 @@ static int Spartan2_sp_reloc (Xilinx_desc * desc, ulong reloc_offset)
addr = (ulong) (fn->abort) + reloc_offset;
fn_r->abort = (Xilinx_abort_fn) addr;
- addr = (ulong) (fn->post) + reloc_offset;
- fn_r->post = (Xilinx_post_fn) addr;
+ if (fn->post) {
+ addr = (ulong) (fn->post) + reloc_offset;
+ fn_r->post = (Xilinx_post_fn) addr;
+ }
fn_r->relocated = TRUE;
@@ -541,8 +536,6 @@ static int Spartan2_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
(*fn->wr) (TRUE, TRUE, cookie);
while (! (*fn->done) (cookie)) {
- /* XXX - we should have a check in here somewhere to
- * make sure we aren't busy forever... */
CONFIG_FPGA_DELAY ();
(*fn->clk) (FALSE, TRUE, cookie); /* Deassert the clock pin */
@@ -562,17 +555,14 @@ static int Spartan2_ss_load (Xilinx_desc * desc, void *buf, size_t bsize)
/*
* Run the post configuration function if there is one.
*/
- if (*fn->post) {
+ if (*fn->post)
(*fn->post) (cookie);
- }
#ifdef CONFIG_SYS_FPGA_PROG_FEEDBACK
- if (ret_val == FPGA_SUCCESS) {
+ if (ret_val == FPGA_SUCCESS)
puts ("Done.\n");
- }
- else {
+ else
puts ("Fail.\n");
- }
#endif
} else {