ACEX1K.h 1.9 KB

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