ACEX1K.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef _ACEX1K_H_
  11. #define _ACEX1K_H_
  12. #include <altera.h>
  13. extern int ACEX1K_load(Altera_desc *desc, const void *image, size_t size);
  14. extern int ACEX1K_dump(Altera_desc *desc, const void *buf, size_t bsize);
  15. extern int ACEX1K_info(Altera_desc *desc);
  16. extern int CYC2_load(Altera_desc *desc, const void *image, size_t size);
  17. extern int CYC2_dump(Altera_desc *desc, const void *buf, size_t bsize);
  18. extern int CYC2_info(Altera_desc *desc);
  19. /* Slave Serial Implementation function table */
  20. typedef struct {
  21. Altera_pre_fn pre;
  22. Altera_config_fn config;
  23. Altera_clk_fn clk;
  24. Altera_status_fn status;
  25. Altera_done_fn done;
  26. Altera_data_fn data;
  27. Altera_abort_fn abort;
  28. Altera_post_fn post;
  29. } Altera_ACEX1K_Passive_Serial_fns;
  30. /* Slave Serial Implementation function table */
  31. typedef struct {
  32. Altera_pre_fn pre;
  33. Altera_config_fn config;
  34. Altera_status_fn status;
  35. Altera_done_fn done;
  36. Altera_write_fn write;
  37. Altera_abort_fn abort;
  38. Altera_post_fn post;
  39. } Altera_CYC2_Passive_Serial_fns;
  40. /* Device Image Sizes
  41. *********************************************************************/
  42. /* ACEX1K */
  43. /* FIXME: Which size do we mean?
  44. * Datasheet says 1337000/8=167125Bytes,
  45. * Filesize of an *.rbf file is 166965 Bytes
  46. */
  47. #if 0
  48. #define Altera_EP1K100_SIZE 1337000/8 /* 167125 Bytes */
  49. #endif
  50. #define Altera_EP1K100_SIZE (166965*8)
  51. #define Altera_EP2C8_SIZE 247942
  52. #define Altera_EP2C20_SIZE 586562
  53. #define Altera_EP2C35_SIZE 883905
  54. #define Altera_EP3C5_SIZE 368011 /* .rbf size in bytes */
  55. /* Descriptor Macros
  56. *********************************************************************/
  57. /* ACEX1K devices */
  58. #define Altera_EP1K100_DESC(iface, fn_table, cookie) \
  59. { Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie }
  60. #endif /* _ACEX1K_H_ */