summaryrefslogtreecommitdiff
path: root/drivers/fpga/fpga.c
diff options
context:
space:
mode:
authorStefano Babic <sbabic@denx.de>2010-06-29 11:47:48 +0200
committerStefano Babic <sbabic@denx.de>2010-10-13 18:09:31 +0200
commit3b8ac464f25581a7d22b303a9154c05e0c7f40a8 (patch)
tree47f8c1789a5667ef0d31daed228b9b70386138ed /drivers/fpga/fpga.c
parentf8f8acd7249d224ed5f9704a5738c469b137bc8e (diff)
downloadu-boot-imx-3b8ac464f25581a7d22b303a9154c05e0c7f40a8.zip
u-boot-imx-3b8ac464f25581a7d22b303a9154c05e0c7f40a8.tar.gz
u-boot-imx-3b8ac464f25581a7d22b303a9154c05e0c7f40a8.tar.bz2
FPGA: add support for downloading Lattice bitstream
The patch adds support to load a Lattice's bitstream image (called VME file) into a Lattice FPGA. The code containing the state machine delivered as part of Lattice's ispVMtools is integrated. The FPGA is programmed using the JTAG interface. The board maintainer must provide accessors to drive the JTAG signals TCK, TMS, TDI and to get the value of the input signal TDO. Signed-off-by: Stefano Babic <sbabic@denx.de>
Diffstat (limited to 'drivers/fpga/fpga.c')
-rw-r--r--drivers/fpga/fpga.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/fpga/fpga.c b/drivers/fpga/fpga.c
index 5659517..e41e728 100644
--- a/drivers/fpga/fpga.c
+++ b/drivers/fpga/fpga.c
@@ -28,6 +28,7 @@
#include <common.h> /* core U-Boot definitions */
#include <xilinx.h> /* xilinx specific definitions */
#include <altera.h> /* altera specific definitions */
+#include <lattice.h>
#if 0
#define FPGA_DEBUG /* define FPGA_DEBUG to get debug messages */
@@ -139,6 +140,10 @@ static int fpga_dev_info( int devnum )
fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
#endif
break;
+ case fpga_lattice:
+ printf("Lattice Device\nDescriptor @ 0x%p\n", desc);
+ ret_val = lattice_info(desc->devdesc);
+ break;
default:
printf( "%s: Invalid or unsupported device type %d\n",
__FUNCTION__, desc->devtype );
@@ -224,6 +229,9 @@ int fpga_load( int devnum, void *buf, size_t bsize )
fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
#endif
break;
+ case fpga_lattice:
+ ret_val = lattice_load(desc->devdesc, buf, bsize);
+ break;
default:
printf( "%s: Invalid or unsupported device type %d\n",
__FUNCTION__, desc->devtype );
@@ -257,6 +265,9 @@ int fpga_dump( int devnum, void *buf, size_t bsize )
fpga_no_sup( (char *)__FUNCTION__, "Altera devices" );
#endif
break;
+ case fpga_lattice:
+ ret_val = lattice_dump(desc->devdesc, buf, bsize);
+ break;
default:
printf( "%s: Invalid or unsupported device type %d\n",
__FUNCTION__, desc->devtype );