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