OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [ecard.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/ecard.h
3
 *
4
 * definitions for expansion cards
5
 *
6
 * Changelog:
7
 *  11-12-1996  RMK     Further minor improvements
8
 *  12-09-1997  RMK     Added interrupt enable/disable for card level
9
 *
10
 * Reference: Acorns Risc OS 3 Programmers Reference Manuals.
11
 */
12
 
13
#ifndef __ASM_ECARD_H
14
#define __ASM_ECARD_H
15
 
16
/*
17
 * Currently understood cards (but not necessarily
18
 * supported):
19
 *                        Manufacturer  Product ID
20
 */
21
#define MANU_ACORN              0x0000
22
#define PROD_ACORN_SCSI                 0x0002
23
#define PROD_ACORN_ETHER1               0x0003
24
#define PROD_ACORN_MFM                  0x000b
25
 
26
#define MANU_ANT2               0x0011
27
#define PROD_ANT_ETHER3                 0x00a4
28
 
29
#define MANU_ATOMWIDE           0x0017
30
#define PROD_ATOMWIDE_3PSERIAL          0x0090
31
 
32
#define MANU_IRLAM_INSTRUMENTS  0x001f
33
#define MANU_IRLAM_INSTRUMENTS_ETHERN   0x5678
34
 
35
#define MANU_OAK                0x0021
36
#define PROD_OAK_SCSI                   0x0058
37
 
38
#define MANU_MORLEY             0x002b
39
#define PROD_MORLEY_SCSI_UNCACHED       0x0067
40
 
41
#define MANU_CUMANA             0x003a
42
#define PROD_CUMANA_SCSI_1              0x00a0
43
#define PROD_CUMANA_SCSI_2              0x003a
44
 
45
#define MANU_ICS                0x003c
46
#define PROD_ICS_IDE                    0x00ae
47
 
48
#define MANU_ICS2               0x003d
49
#define PROD_ICS2_IDE                   0x00ae
50
 
51
#define MANU_SERPORT            0x003f
52
#define PROD_SERPORT_DSPORT             0x00b9
53
 
54
#define MANU_I3                 0x0046
55
#define PROD_I3_ETHERLAN500             0x00d4
56
#define PROD_I3_ETHERLAN600             0x00ec
57
#define PROD_I3_ETHERLAN600A            0x011e
58
 
59
#define MANU_ANT                0x0053
60
#define PROD_ANT_ETHERB                 0x00e4
61
 
62
#define MANU_ALSYSTEMS          0x005b
63
#define PROD_ALSYS_SCSIATAPI            0x0107
64
 
65
#define MANU_MCS                0x0063
66
#define PROD_MCS_CONNECT32              0x0125
67
 
68
#define MANU_EESOX              0x0064
69
#define PROD_EESOX_SCSI2                0x008c
70
 
71
#define MANU_YELLOWSTONE        0x0096
72
#define PROD_YELLOWSTONE_RAPIDE32       0x0120
73
 
74
#ifdef ECARD_C
75
#define CONST
76
#else
77
#define CONST const
78
#endif
79
 
80
#define MAX_ECARDS      8
81
 
82
typedef enum {                          /* Cards address space          */
83
        ECARD_IOC,
84
        ECARD_MEMC,
85
        ECARD_EASI
86
} card_type_t;
87
 
88
typedef enum {                          /* Speed for ECARD_IOC space    */
89
        ECARD_SLOW       = 0,
90
        ECARD_MEDIUM     = 1,
91
        ECARD_FAST       = 2,
92
        ECARD_SYNC       = 3
93
} card_speed_t;
94
 
95
typedef struct  {                       /* Card ID structure            */
96
        unsigned short manufacturer;
97
        unsigned short product;
98
} card_ids;
99
 
100
struct in_ecid {                        /* Packed card ID information   */
101
        unsigned short  product;        /* Product code                 */
102
        unsigned short  manufacturer;   /* Manufacturer code            */
103
        unsigned char   id:4;           /* Simple ID                    */
104
        unsigned char   cd:1;           /* Chunk dir present            */
105
        unsigned char   is:1;           /* Interrupt status pointers    */
106
        unsigned char   w:2;            /* Width                        */
107
        unsigned char   country;        /* Country                      */
108
        unsigned char   irqmask;        /* IRQ mask                     */
109
        unsigned char   fiqmask;        /* FIQ mask                     */
110
        unsigned long   irqoff;         /* IRQ offset                   */
111
        unsigned long   fiqoff;         /* FIQ offset                   */
112
};
113
 
114
typedef struct expansion_card ecard_t;
115
typedef unsigned long *loader_t;
116
 
117
typedef struct {                        /* Card handler routines        */
118
        void (*irqenable)(ecard_t *ec, int irqnr);
119
        void (*irqdisable)(ecard_t *ec, int irqnr);
120
        int  (*irqpending)(ecard_t *ec);
121
        void (*fiqenable)(ecard_t *ec, int fiqnr);
122
        void (*fiqdisable)(ecard_t *ec, int fiqnr);
123
        int  (*fiqpending)(ecard_t *ec);
124
} expansioncard_ops_t;
125
 
126
/*
127
 * This contains all the info needed on an expansion card
128
 */
129
struct expansion_card {
130
        struct expansion_card   *next;
131
 
132
        /* Public data */
133
        volatile unsigned char *irqaddr;        /* address of IRQ register      */
134
        volatile unsigned char *fiqaddr;        /* address of FIQ register      */
135
        unsigned char           irqmask;        /* IRQ mask                     */
136
        unsigned char           fiqmask;        /* FIQ mask                     */
137
        unsigned char           claimed;        /* Card claimed?                */
138
 
139
        void                    *irq_data;      /* Data for use for IRQ by card */
140
        void                    *fiq_data;      /* Data for use for FIQ by card */
141
        expansioncard_ops_t     *ops;           /* Enable/Disable Ops for card  */
142
 
143
        CONST unsigned char     slot_no;        /* Slot number                  */
144
        CONST unsigned char     dma;            /* DMA number (for request_dma) */
145
        CONST unsigned char     irq;            /* IRQ number (for request_irq) */
146
        CONST unsigned char     fiq;            /* FIQ number (for request_irq) */
147
        CONST card_type_t       type;           /* Type of card                 */
148
        CONST struct in_ecid    cid;            /* Card Identification          */
149
 
150
        /* Private internal data */
151
        const char              *card_desc;     /* description of card          */
152
        CONST unsigned int      podaddr;        /* Base Linux address for card  */
153
        CONST loader_t          loader;         /* loader program               */
154
};
155
 
156
struct in_chunk_dir {
157
        unsigned int start_offset;
158
        union {
159
                unsigned char string[256];
160
                unsigned char data[1];
161
        } d;
162
};
163
 
164
/*
165
 * ecard_claim: claim an expansion card entry
166
 */
167
#define ecard_claim(ec) ((ec)->claimed = 1)
168
 
169
/*
170
 * ecard_release: release an expansion card entry
171
 */
172
#define ecard_release(ec) ((ec)->claimed = 0)
173
 
174
/*
175
 * Start finding cards from the top of the list
176
 */
177
extern void ecard_startfind (void);
178
 
179
/*
180
 * Find an expansion card with the correct cid, product and manufacturer code
181
 */
182
extern struct expansion_card *ecard_find (int cid, const card_ids *ids);
183
 
184
/*
185
 * Read a chunk from an expansion card
186
 * cd : where to put read data
187
 * ec : expansion card info struct
188
 * id : id number to find
189
 * num: (n+1)'th id to find.
190
 */
191
extern int ecard_readchunk (struct in_chunk_dir *cd, struct expansion_card *ec, int id, int num);
192
 
193
/*
194
 * Obtain the address of a card
195
 */
196
extern unsigned int ecard_address (struct expansion_card *ec, card_type_t card_type, card_speed_t speed);
197
 
198
#ifdef ECARD_C
199
/* Definitions internal to ecard.c - for it's use only!!
200
 *
201
 * External expansion card header as read from the card
202
 */
203
struct ex_ecid {
204
        unsigned char   r_irq:1;
205
        unsigned char   r_zero:1;
206
        unsigned char   r_fiq:1;
207
        unsigned char   r_id:4;
208
        unsigned char   r_a:1;
209
 
210
        unsigned char   r_cd:1;
211
        unsigned char   r_is:1;
212
        unsigned char   r_w:2;
213
        unsigned char   r_r1:4;
214
 
215
        unsigned char   r_r2:8;
216
 
217
        unsigned char   r_prod[2];
218
 
219
        unsigned char   r_manu[2];
220
 
221
        unsigned char   r_country;
222
 
223
        unsigned char   r_irqmask;
224
        unsigned char   r_irqoff[3];
225
 
226
        unsigned char   r_fiqmask;
227
        unsigned char   r_fiqoff[3];
228
};
229
 
230
/*
231
 * Chunk directory entry as read from the card
232
 */
233
struct ex_chunk_dir {
234
        unsigned char r_id;
235
        unsigned char r_len[3];
236
        unsigned long r_start;
237
        union {
238
                char string[256];
239
                char data[1];
240
        } d;
241
#define c_id(x)         ((x)->r_id)
242
#define c_len(x)        ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
243
#define c_start(x)      ((x)->r_start)
244
};
245
 
246
#endif
247
 
248
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.