blob: e2e96d2947f5a0fefc1d631a69d67ad2fd134fa1 [file] [log] [blame]
wdenk9b7f3842003-10-09 20:09:04 +00001/*
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
Wolfgang Denk74f9b382011-07-30 13:33:49 +000033extern int ACEX1K_load(Altera_desc *desc, const void *image, size_t size);
34extern int ACEX1K_dump(Altera_desc *desc, const void *buf, size_t bsize);
35extern int ACEX1K_info(Altera_desc *desc);
wdenk9b7f3842003-10-09 20:09:04 +000036
Wolfgang Denk74f9b382011-07-30 13:33:49 +000037extern int CYC2_load(Altera_desc *desc, const void *image, size_t size);
38extern int CYC2_dump(Altera_desc *desc, const void *buf, size_t bsize);
39extern int CYC2_info(Altera_desc *desc);
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020040
wdenk9b7f3842003-10-09 20:09:04 +000041/* Slave Serial Implementation function table */
42typedef struct {
43 Altera_pre_fn pre;
44 Altera_config_fn config;
45 Altera_clk_fn clk;
46 Altera_status_fn status;
47 Altera_done_fn done;
48 Altera_data_fn data;
49 Altera_abort_fn abort;
50 Altera_post_fn post;
wdenk9b7f3842003-10-09 20:09:04 +000051} Altera_ACEX1K_Passive_Serial_fns;
52
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020053/* Slave Serial Implementation function table */
54typedef struct {
55 Altera_pre_fn pre;
56 Altera_config_fn config;
57 Altera_status_fn status;
58 Altera_done_fn done;
59 Altera_write_fn write;
60 Altera_abort_fn abort;
61 Altera_post_fn post;
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020062} Altera_CYC2_Passive_Serial_fns;
63
wdenk9b7f3842003-10-09 20:09:04 +000064/* Device Image Sizes
65 *********************************************************************/
66/* ACEX1K */
67/* FIXME: Which size do we mean?
68 * Datasheet says 1337000/8=167125Bytes,
69 * Filesize of an *.rbf file is 166965 Bytes
70 */
71#if 0
Wolfgang Denka1be4762008-05-20 16:00:29 +020072#define Altera_EP1K100_SIZE 1337000/8 /* 167125 Bytes */
wdenk9b7f3842003-10-09 20:09:04 +000073#endif
Wolfgang Denka1be4762008-05-20 16:00:29 +020074#define Altera_EP1K100_SIZE (166965*8)
wdenk9b7f3842003-10-09 20:09:04 +000075
Andre Schwarz68bfa162008-05-27 10:25:39 +020076#define Altera_EP2C8_SIZE 247942
77#define Altera_EP2C20_SIZE 586562
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020078#define Altera_EP2C35_SIZE 883905
Michael Jones19601d52011-07-14 23:09:40 +000079#define Altera_EP3C5_SIZE 368011 /* .rbf size in bytes */
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020080
wdenk9b7f3842003-10-09 20:09:04 +000081/* Descriptor Macros
82 *********************************************************************/
83/* ACEX1K devices */
84#define Altera_EP1K100_DESC(iface, fn_table, cookie) \
85{ Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie }
86
87#endif /* _ACEX1K_H_ */