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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [include/] [linux/] [zorro.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *  linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
3
 *
4
 *  Copyright (C) 1995--2000 Geert Uytterhoeven
5
 *
6
 *  This file is subject to the terms and conditions of the GNU General Public
7
 *  License.  See the file COPYING in the main directory of this archive
8
 *  for more details.
9
 */
10
 
11
#ifndef _LINUX_ZORRO_H
12
#define _LINUX_ZORRO_H
13
 
14
#ifndef __ASSEMBLY__
15
 
16
    /*
17
     *  Each Zorro board has a 32-bit ID of the form
18
     *
19
     *      mmmmmmmmmmmmmmmmppppppppeeeeeeee
20
     *
21
     *  with
22
     *
23
     *      mmmmmmmmmmmmmmmm    16-bit Manufacturer ID (assigned by CBM (sigh))
24
     *      pppppppp            8-bit Product ID (assigned by manufacturer)
25
     *      eeeeeeee            8-bit Extended Product ID (currently only used
26
     *                          for some GVP boards)
27
     */
28
 
29
 
30
#define ZORRO_MANUF(id)         ((id) >> 16)
31
#define ZORRO_PROD(id)          (((id) >> 8) & 0xff)
32
#define ZORRO_EPC(id)           ((id) & 0xff)
33
 
34
#define ZORRO_ID(manuf, prod, epc) \
35
    ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
36
 
37
typedef __u32 zorro_id;
38
 
39
 
40
#define ZORRO_WILDCARD          (0xffffffff)    /* not official */
41
 
42
/* Include the ID list */
43
#include <linux/zorro_ids.h>
44
 
45
 
46
    /*
47
     *  GVP identifies most of its products through the 'extended product code'
48
     *  (epc). The epc has to be ANDed with the GVP_PRODMASK before the
49
     *  identification.
50
     */
51
 
52
#define GVP_PRODMASK                    (0xf8)
53
#define GVP_SCSICLKMASK                 (0x01)
54
 
55
enum GVP_flags {
56
    GVP_IO              = 0x01,
57
    GVP_ACCEL           = 0x02,
58
    GVP_SCSI            = 0x04,
59
    GVP_24BITDMA        = 0x08,
60
    GVP_25BITDMA        = 0x10,
61
    GVP_NOBANK          = 0x20,
62
    GVP_14MHZ           = 0x40,
63
};
64
 
65
 
66
struct Node {
67
    struct  Node *ln_Succ;      /* Pointer to next (successor) */
68
    struct  Node *ln_Pred;      /* Pointer to previous (predecessor) */
69
    __u8    ln_Type;
70
    __s8    ln_Pri;             /* Priority, for sorting */
71
    __s8    *ln_Name;           /* ID string, null terminated */
72
} __attribute__ ((packed));
73
 
74
struct ExpansionRom {
75
    /* -First 16 bytes of the expansion ROM */
76
    __u8  er_Type;              /* Board type, size and flags */
77
    __u8  er_Product;           /* Product number, assigned by manufacturer */
78
    __u8  er_Flags;             /* Flags */
79
    __u8  er_Reserved03;        /* Must be zero ($ff inverted) */
80
    __u16 er_Manufacturer;      /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
81
    __u32 er_SerialNumber;      /* Available for use by manufacturer */
82
    __u16 er_InitDiagVec;       /* Offset to optional "DiagArea" structure */
83
    __u8  er_Reserved0c;
84
    __u8  er_Reserved0d;
85
    __u8  er_Reserved0e;
86
    __u8  er_Reserved0f;
87
} __attribute__ ((packed));
88
 
89
/* er_Type board type bits */
90
#define ERT_TYPEMASK    0xc0
91
#define ERT_ZORROII     0xc0
92
#define ERT_ZORROIII    0x80
93
 
94
/* other bits defined in er_Type */
95
#define ERTB_MEMLIST    5               /* Link RAM into free memory list */
96
#define ERTF_MEMLIST    (1<<5)
97
 
98
struct ConfigDev {
99
    struct Node         cd_Node;
100
    __u8                cd_Flags;       /* (read/write) */
101
    __u8                cd_Pad;         /* reserved */
102
    struct ExpansionRom cd_Rom;         /* copy of board's expansion ROM */
103
    void                *cd_BoardAddr;  /* where in memory the board was placed */
104
    __u32               cd_BoardSize;   /* size of board in bytes */
105
    __u16               cd_SlotAddr;    /* which slot number (PRIVATE) */
106
    __u16               cd_SlotSize;    /* number of slots (PRIVATE) */
107
    void                *cd_Driver;     /* pointer to node of driver */
108
    struct ConfigDev    *cd_NextCD;     /* linked list of drivers to config */
109
    __u32               cd_Unused[4];   /* for whatever the driver wants */
110
} __attribute__ ((packed));
111
 
112
#else /* __ASSEMBLY__ */
113
 
114
LN_Succ         = 0
115
LN_Pred         = LN_Succ+4
116
LN_Type         = LN_Pred+4
117
LN_Pri          = LN_Type+1
118
LN_Name         = LN_Pri+1
119
LN_sizeof       = LN_Name+4
120
 
121
ER_Type         = 0
122
ER_Product      = ER_Type+1
123
ER_Flags        = ER_Product+1
124
ER_Reserved03   = ER_Flags+1
125
ER_Manufacturer = ER_Reserved03+1
126
ER_SerialNumber = ER_Manufacturer+2
127
ER_InitDiagVec  = ER_SerialNumber+4
128
ER_Reserved0c   = ER_InitDiagVec+2
129
ER_Reserved0d   = ER_Reserved0c+1
130
ER_Reserved0e   = ER_Reserved0d+1
131
ER_Reserved0f   = ER_Reserved0e+1
132
ER_sizeof       = ER_Reserved0f+1
133
 
134
CD_Node         = 0
135
CD_Flags        = CD_Node+LN_sizeof
136
CD_Pad          = CD_Flags+1
137
CD_Rom          = CD_Pad+1
138
CD_BoardAddr    = CD_Rom+ER_sizeof
139
CD_BoardSize    = CD_BoardAddr+4
140
CD_SlotAddr     = CD_BoardSize+4
141
CD_SlotSize     = CD_SlotAddr+2
142
CD_Driver       = CD_SlotSize+2
143
CD_NextCD       = CD_Driver+4
144
CD_Unused       = CD_NextCD+4
145
CD_sizeof       = CD_Unused+(4*4)
146
 
147
#endif /* __ASSEMBLY__ */
148
 
149
#ifndef __ASSEMBLY__
150
 
151
#define ZORRO_NUM_AUTO          16
152
 
153
#ifdef __KERNEL__
154
 
155
#include <linux/init.h>
156
#include <linux/ioport.h>
157
 
158
#include <asm/zorro.h>
159
 
160
struct zorro_dev {
161
    struct ExpansionRom rom;
162
    zorro_id id;
163
    u16 slotaddr;
164
    u16 slotsize;
165
    char name[64];
166
    struct resource resource;
167
};
168
 
169
extern unsigned int zorro_num_autocon;  /* # of autoconfig devices found */
170
extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO];
171
 
172
 
173
    /*
174
     *  Zorro Functions
175
     */
176
 
177
extern void zorro_init(void);
178
extern void zorro_name_device(struct zorro_dev *dev);
179
 
180
extern struct zorro_dev *zorro_find_device(zorro_id id,
181
                                           struct zorro_dev *from);
182
 
183
#define zorro_request_device(z, name) \
184
    request_mem_region((z)->resource.start, \
185
                       (z)->resource.end-(z)->resource.start+1, (name))
186
#define zorro_check_device(z) \
187
    check_mem_region((z)->resource.start, \
188
                     (z)->resource.end-(z)->resource.start+1)
189
#define zorro_release_device(z) \
190
    release_mem_region((z)->resource.start, \
191
                       (z)->resource.end-(z)->resource.start+1)
192
 
193
 
194
    /*
195
     *  Bitmask indicating portions of available Zorro II RAM that are unused
196
     *  by the system. Every bit represents a 64K chunk, for a maximum of 8MB
197
     *  (128 chunks, physical 0x00200000-0x009fffff).
198
     *
199
     *  If you want to use (= allocate) portions of this RAM, you should clear
200
     *  the corresponding bits.
201
     */
202
 
203
extern __u32 zorro_unused_z2ram[4];
204
 
205
#define Z2RAM_START             (0x00200000)
206
#define Z2RAM_END               (0x00a00000)
207
#define Z2RAM_SIZE              (0x00800000)
208
#define Z2RAM_CHUNKSIZE         (0x00010000)
209
#define Z2RAM_CHUNKMASK         (0x0000ffff)
210
#define Z2RAM_CHUNKSHIFT        (16)
211
 
212
 
213
#endif /* !__ASSEMBLY__ */
214
#endif /* __KERNEL__ */
215
 
216
#endif /* _LINUX_ZORRO_H */

powered by: WebSVN 2.1.0

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