xilinx.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * (C) Copyright 2002
  3. * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #include <fpga.h>
  8. #ifndef _XILINX_H_
  9. #define _XILINX_H_
  10. /* Xilinx types
  11. *********************************************************************/
  12. typedef enum { /* typedef Xilinx_iface */
  13. min_xilinx_iface_type, /* low range check value */
  14. slave_serial, /* serial data and external clock */
  15. master_serial, /* serial data w/ internal clock (not used) */
  16. slave_parallel, /* parallel data w/ external latch */
  17. jtag_mode, /* jtag/tap serial (not used ) */
  18. master_selectmap, /* master SelectMap (virtex2) */
  19. slave_selectmap, /* slave SelectMap (virtex2) */
  20. devcfg, /* devcfg interface (zynq) */
  21. max_xilinx_iface_type /* insert all new types before this */
  22. } Xilinx_iface; /* end, typedef Xilinx_iface */
  23. typedef enum { /* typedef Xilinx_Family */
  24. min_xilinx_type, /* low range check value */
  25. xilinx_spartan2, /* Spartan-II Family */
  26. Xilinx_VirtexE, /* Virtex-E Family */
  27. Xilinx_Virtex2, /* Virtex2 Family */
  28. Xilinx_Spartan3, /* Spartan-III Family */
  29. xilinx_zynq, /* Zynq Family */
  30. max_xilinx_type /* insert all new types before this */
  31. } Xilinx_Family; /* end, typedef Xilinx_Family */
  32. typedef struct { /* typedef Xilinx_desc */
  33. Xilinx_Family family; /* part type */
  34. Xilinx_iface iface; /* interface type */
  35. size_t size; /* bytes of data part can accept */
  36. void *iface_fns; /* interface function table */
  37. int cookie; /* implementation specific cookie */
  38. char *name; /* device name in bitstream */
  39. } Xilinx_desc; /* end, typedef Xilinx_desc */
  40. /* Generic Xilinx Functions
  41. *********************************************************************/
  42. extern int xilinx_load(Xilinx_desc *desc, const void *image, size_t size);
  43. extern int xilinx_dump(Xilinx_desc *desc, const void *buf, size_t bsize);
  44. extern int xilinx_info(Xilinx_desc *desc);
  45. /* Board specific implementation specific function types
  46. *********************************************************************/
  47. typedef int (*Xilinx_pgm_fn)( int assert_pgm, int flush, int cookie );
  48. typedef int (*Xilinx_init_fn)( int cookie );
  49. typedef int (*Xilinx_err_fn)( int cookie );
  50. typedef int (*Xilinx_done_fn)( int cookie );
  51. typedef int (*Xilinx_clk_fn)( int assert_clk, int flush, int cookie );
  52. typedef int (*Xilinx_cs_fn)( int assert_cs, int flush, int cookie );
  53. typedef int (*Xilinx_wr_fn)( int assert_write, int flush, int cookie );
  54. typedef int (*Xilinx_rdata_fn)( unsigned char *data, int cookie );
  55. typedef int (*Xilinx_wdata_fn)( unsigned char data, int flush, int cookie );
  56. typedef int (*Xilinx_busy_fn)( int cookie );
  57. typedef int (*Xilinx_abort_fn)( int cookie );
  58. typedef int (*Xilinx_pre_fn)( int cookie );
  59. typedef int (*Xilinx_post_fn)( int cookie );
  60. typedef int (*Xilinx_bwr_fn)( void *buf, size_t len, int flush, int cookie );
  61. #endif /* _XILINX_H_ */