diff options
author | Stefan Roese <sr@denx.de> | 2008-01-13 15:04:37 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2008-01-13 15:04:37 +0100 |
commit | 8d79953d03e6c5b24215609997dafe4daa623cd6 (patch) | |
tree | cb9a4246cde2d32fa600461da008c7d59b57cf4b /common/spartan3.c | |
parent | 47cc23cbe9a669c510183f4f049bf703ef445f3b (diff) | |
parent | 2b2f43ed6a30ece77f76191c845ac95267daa31a (diff) | |
download | u-boot-imx-8d79953d03e6c5b24215609997dafe4daa623cd6.zip u-boot-imx-8d79953d03e6c5b24215609997dafe4daa623cd6.tar.gz u-boot-imx-8d79953d03e6c5b24215609997dafe4daa623cd6.tar.bz2 |
Merge branch 'master' of /home/stefan/git/u-boot/u-boot
Diffstat (limited to 'common/spartan3.c')
-rw-r--r-- | common/spartan3.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/common/spartan3.c b/common/spartan3.c index f7c4f8c..d329e70 100644 --- a/common/spartan3.c +++ b/common/spartan3.c @@ -30,7 +30,7 @@ #include <common.h> /* core U-Boot definitions */ #include <spartan3.h> /* Spartan-II device family */ -#if (CONFIG_FPGA & (CFG_XILINX | CFG_SPARTAN3)) +#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_SPARTAN3) /* Define FPGA_DEBUG to get debug printf's */ #ifdef FPGA_DEBUG @@ -446,7 +446,7 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize) int ret_val = FPGA_FAIL; /* assume the worst */ Xilinx_Spartan3_Slave_Serial_fns *fn = desc->iface_fns; int i; - char val; + unsigned char val; PRINTF ("%s: start with interface functions @ 0x%p\n", __FUNCTION__, fn); @@ -566,6 +566,13 @@ static int Spartan3_ss_load (Xilinx_desc * desc, void *buf, size_t bsize) } putc ('\n'); /* terminate the dotted line */ + /* + * Run the post configuration function if there is one. + */ + if (*fn->post) { + (*fn->post) (cookie); + } + #ifdef CFG_FPGA_PROG_FEEDBACK if (ret_val == FPGA_SUCCESS) { puts ("Done.\n"); @@ -620,8 +627,10 @@ static int Spartan3_ss_reloc (Xilinx_desc * desc, ulong reloc_offset) PRINTF ("%s: Relocating descriptor at 0x%p\n", __FUNCTION__, desc); - addr = (ulong) (fn->pre) + reloc_offset; - fn_r->pre = (Xilinx_pre_fn) addr; + if (fn->pre) { + addr = (ulong) (fn->pre) + reloc_offset; + fn_r->pre = (Xilinx_pre_fn) addr; + } addr = (ulong) (fn->pgm) + reloc_offset; fn_r->pgm = (Xilinx_pgm_fn) addr; @@ -638,6 +647,11 @@ static int Spartan3_ss_reloc (Xilinx_desc * desc, ulong reloc_offset) addr = (ulong) (fn->wr) + reloc_offset; fn_r->wr = (Xilinx_wr_fn) addr; + if (fn->post) { + addr = (ulong) (fn->post) + reloc_offset; + fn_r->post = (Xilinx_post_fn) addr; + } + fn_r->relocated = TRUE; } else { |