]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/altera.h
ARM: zynq: Add MIO detection code
[people/ms/u-boot.git] / include / altera.h
CommitLineData
c609719b
WD
1/*
2 * (C) Copyright 2002
3 * Rich Ireland, Enterasys Networks, rireland@enterasys.com.
4 *
1a459660 5 * SPDX-License-Identifier: GPL-2.0+
c609719b
WD
6 */
7
8#include <fpga.h>
9
10#ifndef _ALTERA_H_
11#define _ALTERA_H_
12
5da627a4
WD
13typedef enum { /* typedef Altera_iface */
14 min_altera_iface_type, /* insert all new types after this */
15 passive_serial, /* serial data and external clock */
16 passive_parallel_synchronous, /* parallel data */
17 passive_parallel_asynchronous, /* parallel data */
18 passive_serial_asynchronous, /* serial data w/ internal clock (not used) */
19 altera_jtag_mode, /* jtag/tap serial (not used ) */
f9a78b8d 20 fast_passive_parallel, /* fast passive parallel (FPP) */
3c735e74 21 fast_passive_parallel_security, /* fast passive parallel with security (FPPS) */
5da627a4
WD
22 max_altera_iface_type /* insert all new types before this */
23} Altera_iface; /* end, typedef Altera_iface */
c609719b 24
5da627a4 25typedef enum { /* typedef Altera_Family */
f9a78b8d
MJ
26 min_altera_type, /* insert all new types after this */
27 Altera_ACEX1K, /* ACEX1K Family */
28 Altera_CYC2, /* CYCLONII Family */
3c735e74 29 Altera_StratixII, /* StratixII Familiy */
c609719b 30/* Add new models here */
f9a78b8d 31 max_altera_type /* insert all new types before this */
5da627a4 32} Altera_Family; /* end, typedef Altera_Family */
c609719b 33
5da627a4
WD
34typedef struct { /* typedef Altera_desc */
35 Altera_Family family; /* part type */
36 Altera_iface iface; /* interface type */
37 size_t size; /* bytes of data part can accept */
38 void * iface_fns;/* interface function table */
39 void * base; /* base interface address */
40 int cookie; /* implementation specific cookie */
41} Altera_desc; /* end, typedef Altera_desc */
c609719b 42
5da627a4
WD
43/* Generic Altera Functions
44 *********************************************************************/
e6a857da
WD
45extern int altera_load(Altera_desc *desc, const void *image, size_t size);
46extern int altera_dump(Altera_desc *desc, const void *buf, size_t bsize);
47extern int altera_info(Altera_desc *desc);
5da627a4
WD
48
49/* Board specific implementation specific function types
50 *********************************************************************/
51typedef int (*Altera_pre_fn)( int cookie );
52typedef int (*Altera_config_fn)( int assert_config, int flush, int cookie );
53typedef int (*Altera_status_fn)( int cookie );
54typedef int (*Altera_done_fn)( int cookie );
55typedef int (*Altera_clk_fn)( int assert_clk, int flush, int cookie );
56typedef int (*Altera_data_fn)( int assert_data, int flush, int cookie );
e6a857da 57typedef int(*Altera_write_fn)(const void *buf, size_t len, int flush, int cookie);
5da627a4
WD
58typedef int (*Altera_abort_fn)( int cookie );
59typedef int (*Altera_post_fn)( int cookie );
c609719b 60
3c735e74 61typedef struct {
62 Altera_pre_fn pre;
63 Altera_config_fn config;
64 Altera_status_fn status;
65 Altera_done_fn done;
66 Altera_clk_fn clk;
67 Altera_data_fn data;
68 Altera_abort_fn abort;
69 Altera_post_fn post;
70} altera_board_specific_func;
71
5da627a4 72#endif /* _ALTERA_H_ */