Import 2.3.6
[davej-history.git] / include / linux / cycx_drv.h
blob3448b906611605458d1405a49b3a648b023e9373
1 /*
2 * cycx_drv.h CYCX Support Module. Kernel API Definitions.
4 * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
5 * Copyright: (c) 1998, 1999 Arnaldo Carvalho de Melo
7 * Based on sdladrv.h by Gene Kozin <genek@compuserve.com>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 * ============================================================================
14 * 1999/01/03 acme more judicious use of data types...
15 * uclong, ucchar, etc deleted, the u8, u16, u32
16 * types are the portable way to go.
17 * 1999/01/03 acme judicious use of data types... u16, u32, etc
18 * Dec 26, 1998 Arnaldo FIXED_BUFFERS, CONF_OFFSET,
19 * removal of cy_read{bwl}
20 * Aug 08, 1998 Arnaldo Initial version.
22 #ifndef _CYCX_DRV_H
23 #define _CYCX_DRV_H
25 #define CYCX_WINDOWSIZE 0x4000 /* default dual-port memory window size */
26 #define GEN_CYCX_INTR 0x02
27 #define RST_ENABLE 0x04
28 #define START_CPU 0x06
29 #define RST_DISABLE 0x08
30 #define FIXED_BUFFERS 0x08
31 #define TEST_PATTERN 0xaa55
32 #define CMD_OFFSET 0x20
33 #define CONF_OFFSET 0x0380
34 #define RESET_OFFSET 0x3c00 /* For reset file load */
35 #define DATA_OFFSET 0x0100 /* For code and data files load */
36 #define START_OFFSET 0x3ff0 /* 80186 starts here */
38 #ifndef MIN
39 #define MIN(a,b) ((a) < (b) ? (a) : (b))
40 #endif
42 /* Data Structures */
43 /* Adapter hardware configuration. Pointer to this structure is passed to all
44 * APIs. */
45 typedef struct cycxhw {
46 u32 type; /* adapter type */
47 u32 fwid; /* firmware ID */
48 int irq; /* interrupt request level */
49 u32 dpmbase; /* dual-port memory base */
50 u32 dpmsize; /* dual-port memory size */
51 u32 pclk; /* CPU clock rate, kHz */
52 u32 memory; /* memory size */
53 u32 reserved[5];
54 } cycxhw_t;
56 /* Function Prototypes */
57 extern int cycx_setup (cycxhw_t* hw, void* sfm, u32 len);
58 extern int cycx_down (cycxhw_t* hw);
59 extern int cycx_inten (cycxhw_t* hw);
60 extern int cycx_intde (cycxhw_t* hw);
61 extern int cycx_intack (cycxhw_t* hw);
62 extern int cycx_intr (cycxhw_t* hw);
63 extern int cycx_peek (cycxhw_t* hw, u32 addr, void* buf, u32 len);
64 extern int cycx_poke (cycxhw_t* hw, u32 addr, void* buf, u32 len);
65 extern int cycx_exec (u32 addr);
66 #endif /* _CYCX_DRV_H */