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 | * |
| 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 | |
| 28 | #ifndef _ACEX1K_H_ |
| 29 | #define _ACEX1K_H_ |
| 30 | |
| 31 | #include <altera.h> |
| 32 | |
| 33 | extern int ACEX1K_load( Altera_desc *desc, void *image, size_t size ); |
| 34 | extern int ACEX1K_dump( Altera_desc *desc, void *buf, size_t bsize ); |
| 35 | extern int ACEX1K_info( Altera_desc *desc ); |
| 36 | extern int ACEX1K_reloc( Altera_desc *desc, ulong reloc_off ); |
| 37 | |
Stefan Roese | 5f1cf2d | 2006-08-15 14:15:51 +0200 | [diff] [blame] | 38 | extern int CYC2_load( Altera_desc *desc, void *image, size_t size ); |
| 39 | extern int CYC2_dump( Altera_desc *desc, void *buf, size_t bsize ); |
| 40 | extern int CYC2_info( Altera_desc *desc ); |
| 41 | extern int CYC2_reloc( Altera_desc *desc, ulong reloc_off ); |
| 42 | |
wdenk | 9b7f384 | 2003-10-09 20:09:04 +0000 | [diff] [blame] | 43 | /* Slave Serial Implementation function table */ |
| 44 | typedef struct { |
| 45 | Altera_pre_fn pre; |
| 46 | Altera_config_fn config; |
| 47 | Altera_clk_fn clk; |
| 48 | Altera_status_fn status; |
| 49 | Altera_done_fn done; |
| 50 | Altera_data_fn data; |
| 51 | Altera_abort_fn abort; |
| 52 | Altera_post_fn post; |
| 53 | int relocated; |
| 54 | } Altera_ACEX1K_Passive_Serial_fns; |
| 55 | |
Stefan Roese | 5f1cf2d | 2006-08-15 14:15:51 +0200 | [diff] [blame] | 56 | /* Slave Serial Implementation function table */ |
| 57 | typedef struct { |
| 58 | Altera_pre_fn pre; |
| 59 | Altera_config_fn config; |
| 60 | Altera_status_fn status; |
| 61 | Altera_done_fn done; |
| 62 | Altera_write_fn write; |
| 63 | Altera_abort_fn abort; |
| 64 | Altera_post_fn post; |
| 65 | int relocated; |
| 66 | } Altera_CYC2_Passive_Serial_fns; |
| 67 | |
wdenk | 9b7f384 | 2003-10-09 20:09:04 +0000 | [diff] [blame] | 68 | /* Device Image Sizes |
| 69 | *********************************************************************/ |
| 70 | /* ACEX1K */ |
| 71 | /* FIXME: Which size do we mean? |
| 72 | * Datasheet says 1337000/8=167125Bytes, |
| 73 | * Filesize of an *.rbf file is 166965 Bytes |
| 74 | */ |
| 75 | #if 0 |
| 76 | #define Altera_EP1K100_SIZE 1337000/8 /* 167125 Bytes */ |
| 77 | #endif |
| 78 | #define Altera_EP1K100_SIZE (166965*8) |
| 79 | |
Stefan Roese | 5f1cf2d | 2006-08-15 14:15:51 +0200 | [diff] [blame] | 80 | #define Altera_EP2C35_SIZE 883905 |
| 81 | |
wdenk | 9b7f384 | 2003-10-09 20:09:04 +0000 | [diff] [blame] | 82 | /* Descriptor Macros |
| 83 | *********************************************************************/ |
| 84 | /* ACEX1K devices */ |
| 85 | #define Altera_EP1K100_DESC(iface, fn_table, cookie) \ |
| 86 | { Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie } |
| 87 | |
| 88 | #endif /* _ACEX1K_H_ */ |