xilinx.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * (C) Copyright 2002
  3. * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. *
  23. */
  24. #include <fpga.h>
  25. #ifndef _XILINX_H_
  26. #define _XILINX_H_
  27. /* Xilinx types
  28. *********************************************************************/
  29. typedef enum { /* typedef Xilinx_iface */
  30. min_xilinx_iface_type, /* low range check value */
  31. slave_serial, /* serial data and external clock */
  32. master_serial, /* serial data w/ internal clock (not used) */
  33. slave_parallel, /* parallel data w/ external latch */
  34. jtag_mode, /* jtag/tap serial (not used ) */
  35. master_selectmap, /* master SelectMap (virtex2) */
  36. slave_selectmap, /* slave SelectMap (virtex2) */
  37. devcfg, /* devcfg interface (zynq) */
  38. max_xilinx_iface_type /* insert all new types before this */
  39. } Xilinx_iface; /* end, typedef Xilinx_iface */
  40. typedef enum { /* typedef Xilinx_Family */
  41. min_xilinx_type, /* low range check value */
  42. Xilinx_Spartan2, /* Spartan-II Family */
  43. Xilinx_VirtexE, /* Virtex-E Family */
  44. Xilinx_Virtex2, /* Virtex2 Family */
  45. Xilinx_Spartan3, /* Spartan-III Family */
  46. xilinx_zynq, /* Zynq Family */
  47. max_xilinx_type /* insert all new types before this */
  48. } Xilinx_Family; /* end, typedef Xilinx_Family */
  49. typedef struct { /* typedef Xilinx_desc */
  50. Xilinx_Family family; /* part type */
  51. Xilinx_iface iface; /* interface type */
  52. size_t size; /* bytes of data part can accept */
  53. void *iface_fns; /* interface function table */
  54. int cookie; /* implementation specific cookie */
  55. char *name; /* device name in bitstream */
  56. } Xilinx_desc; /* end, typedef Xilinx_desc */
  57. /* Generic Xilinx Functions
  58. *********************************************************************/
  59. extern int xilinx_load(Xilinx_desc *desc, const void *image, size_t size);
  60. extern int xilinx_dump(Xilinx_desc *desc, const void *buf, size_t bsize);
  61. extern int xilinx_info(Xilinx_desc *desc);
  62. /* Board specific implementation specific function types
  63. *********************************************************************/
  64. typedef int (*Xilinx_pgm_fn)( int assert_pgm, int flush, int cookie );
  65. typedef int (*Xilinx_init_fn)( int cookie );
  66. typedef int (*Xilinx_err_fn)( int cookie );
  67. typedef int (*Xilinx_done_fn)( int cookie );
  68. typedef int (*Xilinx_clk_fn)( int assert_clk, int flush, int cookie );
  69. typedef int (*Xilinx_cs_fn)( int assert_cs, int flush, int cookie );
  70. typedef int (*Xilinx_wr_fn)( int assert_write, int flush, int cookie );
  71. typedef int (*Xilinx_rdata_fn)( unsigned char *data, int cookie );
  72. typedef int (*Xilinx_wdata_fn)( unsigned char data, int flush, int cookie );
  73. typedef int (*Xilinx_busy_fn)( int cookie );
  74. typedef int (*Xilinx_abort_fn)( int cookie );
  75. typedef int (*Xilinx_pre_fn)( int cookie );
  76. typedef int (*Xilinx_post_fn)( int cookie );
  77. typedef int (*Xilinx_bwr_fn)( void *buf, size_t len, int flush, int cookie );
  78. #endif /* _XILINX_H_ */