source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/zorro.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 4.2 KB
Line 
1/*
2 *  linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
3 *
4 *  Copyright (C) 1995--2003 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#include <asm/types.h>
15
16#ifndef __ASSEMBLY__
17
18#include <linux/device.h>
19
20
21    /*
22     *  Each Zorro board has a 32-bit ID of the form
23     *
24     *      mmmmmmmmmmmmmmmmppppppppeeeeeeee
25     *
26     *  with
27     *
28     *      mmmmmmmmmmmmmmmm    16-bit Manufacturer ID (assigned by CBM (sigh))
29     *      pppppppp            8-bit Product ID (assigned by manufacturer)
30     *      eeeeeeee            8-bit Extended Product ID (currently only used
31     *                          for some GVP boards)
32     */
33
34
35#define ZORRO_MANUF(id)         ((id) >> 16)
36#define ZORRO_PROD(id)          (((id) >> 8) & 0xff)
37#define ZORRO_EPC(id)           ((id) & 0xff)
38
39#define ZORRO_ID(manuf, prod, epc) \
40    ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
41
42typedef __u32 zorro_id;
43
44
45#define ZORRO_WILDCARD          (0xffffffff)    /* not official */
46
47/* Include the ID list */
48#include <linux/zorro_ids.h>
49
50
51    /*
52     *  GVP identifies most of its products through the 'extended product code'
53     *  (epc). The epc has to be ANDed with the GVP_PRODMASK before the
54     *  identification.
55     */
56
57#define GVP_PRODMASK                    (0xf8)
58#define GVP_SCSICLKMASK                 (0x01)
59
60enum GVP_flags {
61    GVP_IO              = 0x01,
62    GVP_ACCEL           = 0x02,
63    GVP_SCSI            = 0x04,
64    GVP_24BITDMA        = 0x08,
65    GVP_25BITDMA        = 0x10,
66    GVP_NOBANK          = 0x20,
67    GVP_14MHZ           = 0x40,
68};
69
70
71struct Node {
72    struct  Node *ln_Succ;      /* Pointer to next (successor) */
73    struct  Node *ln_Pred;      /* Pointer to previous (predecessor) */
74    __u8    ln_Type;
75    __s8    ln_Pri;             /* Priority, for sorting */
76    __s8    *ln_Name;           /* ID string, null terminated */
77} __attribute__ ((packed));
78
79struct ExpansionRom {
80    /* -First 16 bytes of the expansion ROM */
81    __u8  er_Type;              /* Board type, size and flags */
82    __u8  er_Product;           /* Product number, assigned by manufacturer */
83    __u8  er_Flags;             /* Flags */
84    __u8  er_Reserved03;        /* Must be zero ($ff inverted) */
85    __u16 er_Manufacturer;      /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
86    __u32 er_SerialNumber;      /* Available for use by manufacturer */
87    __u16 er_InitDiagVec;       /* Offset to optional "DiagArea" structure */
88    __u8  er_Reserved0c;
89    __u8  er_Reserved0d;
90    __u8  er_Reserved0e;
91    __u8  er_Reserved0f;
92} __attribute__ ((packed));
93
94/* er_Type board type bits */
95#define ERT_TYPEMASK    0xc0
96#define ERT_ZORROII     0xc0
97#define ERT_ZORROIII    0x80
98
99/* other bits defined in er_Type */
100#define ERTB_MEMLIST    5               /* Link RAM into free memory list */
101#define ERTF_MEMLIST    (1<<5)
102
103struct ConfigDev {
104    struct Node         cd_Node;
105    __u8                cd_Flags;       /* (read/write) */
106    __u8                cd_Pad;         /* reserved */
107    struct ExpansionRom cd_Rom;         /* copy of board's expansion ROM */
108    void                *cd_BoardAddr;  /* where in memory the board was placed */
109    __u32               cd_BoardSize;   /* size of board in bytes */
110    __u16               cd_SlotAddr;    /* which slot number (PRIVATE) */
111    __u16               cd_SlotSize;    /* number of slots (PRIVATE) */
112    void                *cd_Driver;     /* pointer to node of driver */
113    struct ConfigDev    *cd_NextCD;     /* linked list of drivers to config */
114    __u32               cd_Unused[4];   /* for whatever the driver wants */
115} __attribute__ ((packed));
116
117#else /* __ASSEMBLY__ */
118
119LN_Succ         = 0
120LN_Pred         = LN_Succ+4
121LN_Type         = LN_Pred+4
122LN_Pri          = LN_Type+1
123LN_Name         = LN_Pri+1
124LN_sizeof       = LN_Name+4
125
126ER_Type         = 0
127ER_Product      = ER_Type+1
128ER_Flags        = ER_Product+1
129ER_Reserved03   = ER_Flags+1
130ER_Manufacturer = ER_Reserved03+1
131ER_SerialNumber = ER_Manufacturer+2
132ER_InitDiagVec  = ER_SerialNumber+4
133ER_Reserved0c   = ER_InitDiagVec+2
134ER_Reserved0d   = ER_Reserved0c+1
135ER_Reserved0e   = ER_Reserved0d+1
136ER_Reserved0f   = ER_Reserved0e+1
137ER_sizeof       = ER_Reserved0f+1
138
139CD_Node         = 0
140CD_Flags        = CD_Node+LN_sizeof
141CD_Pad          = CD_Flags+1
142CD_Rom          = CD_Pad+1
143CD_BoardAddr    = CD_Rom+ER_sizeof
144CD_BoardSize    = CD_BoardAddr+4
145CD_SlotAddr     = CD_BoardSize+4
146CD_SlotSize     = CD_SlotAddr+2
147CD_Driver       = CD_SlotSize+2
148CD_NextCD       = CD_Driver+4
149CD_Unused       = CD_NextCD+4
150CD_sizeof       = CD_Unused+(4*4)
151
152#endif /* __ASSEMBLY__ */
153
154#ifndef __ASSEMBLY__
155
156#define ZORRO_NUM_AUTO          16
157#endif
158
159#endif /* _LINUX_ZORRO_H */
Note: See TracBrowser for help on using the repository browser.