summaryrefslogtreecommitdiffstats
path: root/include/ACEX1K.h
blob: f75c463f332dd41fff1fb3ac3879e852ea6919ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * (C) Copyright 2003
 * Steven Scholz, imc Measurement & Control, steven.scholz@imc-berlin.de
 *
 * (C) Copyright 2002
 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
 *
 * See file CREDITS for list of people who contributed to this
 * project.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of
 * the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 * MA 02111-1307 USA
 *
 */

#ifndef _ACEX1K_H_
#define _ACEX1K_H_

#include <altera.h>

extern int ACEX1K_load( Altera_desc *desc, void *image, size_t size );
extern int ACEX1K_dump( Altera_desc *desc, void *buf, size_t bsize );
extern int ACEX1K_info( Altera_desc *desc );
extern int ACEX1K_reloc( Altera_desc *desc, ulong reloc_off );

/* Slave Serial Implementation function table */
typedef struct {
	Altera_pre_fn		pre;
	Altera_config_fn	config;
	Altera_clk_fn		clk;
	Altera_status_fn	status;
	Altera_done_fn		done;
	Altera_data_fn		data;
	Altera_abort_fn		abort;
	Altera_post_fn		post;
	int			relocated;
} Altera_ACEX1K_Passive_Serial_fns;

/* Device Image Sizes
 *********************************************************************/
/* ACEX1K */
/* FIXME: Which size do we mean?
 * Datasheet says 1337000/8=167125Bytes,
 * Filesize of an *.rbf file is 166965 Bytes
 */
#if 0
#define Altera_EP1K100_SIZE  	1337000/8	/* 167125 Bytes */
#endif
#define Altera_EP1K100_SIZE  	(166965*8)

/* Descriptor Macros
 *********************************************************************/
/* ACEX1K devices */
#define Altera_EP1K100_DESC(iface, fn_table, cookie) \
{ Altera_ACEX1K, iface, Altera_EP1K100_SIZE, fn_table, cookie }

#endif /* _ACEX1K_H_ */