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