2 * linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
4 * Copyright (C) 1995--2000 Geert Uytterhoeven
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
11 #ifndef _LINUX_ZORRO_H
12 #define _LINUX_ZORRO_H
17 * Each Zorro board has a 32-bit ID of the form
19 * mmmmmmmmmmmmmmmmppppppppeeeeeeee
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)
30 #define ZORRO_MANUF(id) ((id) >> 16)
31 #define ZORRO_PROD(id) (((id) >> 8) & 0xff)
32 #define ZORRO_EPC(id) ((id) & 0xff)
34 #define ZORRO_ID(manuf, prod, epc) \
35 ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
37 typedef __u32 zorro_id;
40 #define ZORRO_WILDCARD (0xffffffff) /* not official */
42 /* Include the ID list */
43 #include <linux/zorro_ids.h>
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
52 #define GVP_PRODMASK (0xf8)
53 #define GVP_SCSICLKMASK (0x01)
67 struct Node *ln_Succ; /* Pointer to next (successor) */
68 struct Node *ln_Pred; /* Pointer to previous (predecessor) */
70 __s8 ln_Pri; /* Priority, for sorting */
71 __s8 *ln_Name; /* ID string, null terminated */
72 } __attribute__ ((packed));
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 */
87 } __attribute__ ((packed));
89 /* er_Type board type bits */
90 #define ERT_TYPEMASK 0xc0
91 #define ERT_ZORROII 0xc0
92 #define ERT_ZORROIII 0x80
94 /* other bits defined in er_Type */
95 #define ERTB_MEMLIST 5 /* Link RAM into free memory list */
96 #define ERTF_MEMLIST (1<<5)
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));
112 #else /* __ASSEMBLY__ */
119 LN_sizeof = LN_Name+4
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
135 CD_Flags = CD_Node+LN_sizeof
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)
147 #endif /* __ASSEMBLY__ */
151 #define ZORRO_NUM_AUTO 16
155 #include <linux/init.h>
156 #include <linux/ioport.h>
158 #include <asm/zorro.h>
161 struct ExpansionRom rom;
166 struct resource resource;
169 extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */
170 extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO];
177 extern void zorro_init(void);
178 extern void zorro_name_device(struct zorro_dev *dev);
180 extern struct zorro_dev *zorro_find_device(zorro_id id,
181 struct zorro_dev *from);
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)
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).
199 * If you want to use (= allocate) portions of this RAM, you should clear
200 * the corresponding bits.
203 extern __u32 zorro_unused_z2ram[4];
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)
213 #endif /* !__ASSEMBLY__ */
214 #endif /* __KERNEL__ */
216 #endif /* _LINUX_ZORRO_H */