ACEX1K.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * (C) Copyright 2003
  3. * Steven Scholz, imc Measurement & Control, steven.scholz@imc-berlin.de
  4. *
  5. * (C) Copyright 2002
  6. * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
  7. *
  8. * See file CREDITS for list of people who contributed to this
  9. * project.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License as
  13. * published by the Free Software Foundation; either version 2 of
  14. * the License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  24. * MA 02111-1307 USA
  25. *
  26. */
  27. #ifndef _ACEX1K_H_
  28. #define _ACEX1K_H_
  29. #include <altera.h>
  30. extern int ACEX1K_load( Altera_desc *desc, void *image, size_t size );
  31. extern int ACEX1K_dump( Altera_desc *desc, void *buf, size_t bsize );
  32. extern int ACEX1K_info( Altera_desc *desc );
  33. extern int CYC2_load( Altera_desc *desc, void *image, size_t size );
  34. extern int CYC2_dump( Altera_desc *desc, void *buf, size_t bsize );
  35. extern int CYC2_info( Altera_desc *desc );
  36. /* Slave Serial Implementation function table */
  37. typedef struct {
  38. Altera_pre_fn pre;
  39. Altera_config_fn config;
  40. Altera_clk_fn clk;
  41. Altera_status_fn status;
  42. Altera_done_fn done;
  43. Altera_data_fn data;
  44. Altera_abort_fn abort;
  45. Altera_post_fn post;
  46. } Altera_ACEX1K_Passive_Serial_fns;
  47. /* Slave Serial Implementation function table */
  48. typedef struct {
  49. Altera_pre_fn pre;
  50. Altera_config_fn config;
  51. Altera_status_fn status;
  52. Altera_done_fn done;
  53. Altera_write_fn write;
  54. Altera_abort_fn abort;
  55. Altera_post_fn post;
  56. } Altera_CYC2_Passive_Serial_fns;
  57. /* Device Image Sizes
  58. *********************************************************************/
  59. /* ACEX1K */
  60. /* FIXME: Which size do we mean?
  61. * Datasheet says 1337000/8=167125Bytes,
  62. * Filesize of an *.rbf file is 166965 Bytes
  63. */
  64. #if 0
  65. #define Altera_EP1K100_SIZE 1337000/8 /* 167125 Bytes */
  66. #endif
  67. #define Altera_EP1K100_SIZE (166965*8)
  68. #define Altera_EP2C8_SIZE 247942
  69. #define Altera_EP2C20_SIZE 586562
  70. #define Altera_EP2C35_SIZE 883905
  71. /* Descriptor Macros
  72. *********************************************************************/
  73. /* ACEX1K devices */
  74. #define Altera_EP1K100_DESC(iface, fn_table, cookie) \
  75. { Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie }
  76. #endif /* _ACEX1K_H_ */