blob: 7c5253c66ccada689407466d6c8acbae67dcf14b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenk9b7f3842003-10-09 20:09:04 +00002/*
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.
wdenk9b7f3842003-10-09 20:09:04 +00008 */
9
10#ifndef _ACEX1K_H_
11#define _ACEX1K_H_
12
13#include <altera.h>
14
Wolfgang Denk74f9b382011-07-30 13:33:49 +000015extern int ACEX1K_load(Altera_desc *desc, const void *image, size_t size);
16extern int ACEX1K_dump(Altera_desc *desc, const void *buf, size_t bsize);
17extern int ACEX1K_info(Altera_desc *desc);
wdenk9b7f3842003-10-09 20:09:04 +000018
Wolfgang Denk74f9b382011-07-30 13:33:49 +000019extern int CYC2_load(Altera_desc *desc, const void *image, size_t size);
20extern int CYC2_dump(Altera_desc *desc, const void *buf, size_t bsize);
21extern int CYC2_info(Altera_desc *desc);
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020022
wdenk9b7f3842003-10-09 20:09:04 +000023/* Slave Serial Implementation function table */
24typedef 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;
wdenk9b7f3842003-10-09 20:09:04 +000033} Altera_ACEX1K_Passive_Serial_fns;
34
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020035/* Slave Serial Implementation function table */
36typedef 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;
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020044} Altera_CYC2_Passive_Serial_fns;
45
wdenk9b7f3842003-10-09 20:09:04 +000046/* 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
Wolfgang Denka1be4762008-05-20 16:00:29 +020054#define Altera_EP1K100_SIZE 1337000/8 /* 167125 Bytes */
wdenk9b7f3842003-10-09 20:09:04 +000055#endif
Wolfgang Denka1be4762008-05-20 16:00:29 +020056#define Altera_EP1K100_SIZE (166965*8)
wdenk9b7f3842003-10-09 20:09:04 +000057
Andre Schwarz68bfa162008-05-27 10:25:39 +020058#define Altera_EP2C8_SIZE 247942
59#define Altera_EP2C20_SIZE 586562
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020060#define Altera_EP2C35_SIZE 883905
Michael Jones19601d52011-07-14 23:09:40 +000061#define Altera_EP3C5_SIZE 368011 /* .rbf size in bytes */
Stefan Roese5f1cf2d2006-08-15 14:15:51 +020062
Alexander Dahl6b953572019-06-28 14:41:20 +020063#define ALTERA_EP4CE6_SIZE 368011 /* 2944088 Bits */
64#define ALTERA_EP4CE10_SIZE 368011 /* 2944088 Bits */
65#define ALTERA_EP4CE15_SIZE 510856 /* 4086848 Bits */
66#define ALTERA_EP4CE22_SIZE 718569 /* 5748552 Bits */
67#define ALTERA_EP4CE30_SIZE 1191788 /* 9534304 Bits */
68#define ALTERA_EP4CE40_SIZE 1191788 /* 9534304 Bits */
69#define ALTERA_EP4CE55_SIZE 1861195 /* 14889560 Bits */
70#define ALTERA_EP4CE75_SIZE 2495719 /* 19965752 Bits */
71#define ALTERA_EP4CE115_SIZE 3571462 /* 28571696 Bits */
72
wdenk9b7f3842003-10-09 20:09:04 +000073/* Descriptor Macros
74 *********************************************************************/
75/* ACEX1K devices */
76#define Altera_EP1K100_DESC(iface, fn_table, cookie) \
77{ Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie }
78
79#endif /* _ACEX1K_H_ */