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