Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  *  linux/zorro.h -- Amiga AutoConfig (Zorro) Bus Definitions
0004  *
0005  *  Copyright (C) 1995--2003 Geert Uytterhoeven
0006  *
0007  *  This file is subject to the terms and conditions of the GNU General Public
0008  *  License.  See the file COPYING in the main directory of this archive
0009  *  for more details.
0010  */
0011 
0012 #ifndef _UAPI_LINUX_ZORRO_H
0013 #define _UAPI_LINUX_ZORRO_H
0014 
0015 #include <linux/types.h>
0016 
0017 
0018     /*
0019      *  Each Zorro board has a 32-bit ID of the form
0020      *
0021      *      mmmmmmmmmmmmmmmmppppppppeeeeeeee
0022      *
0023      *  with
0024      *
0025      *      mmmmmmmmmmmmmmmm    16-bit Manufacturer ID (assigned by CBM (sigh))
0026      *      pppppppp        8-bit Product ID (assigned by manufacturer)
0027      *      eeeeeeee        8-bit Extended Product ID (currently only used
0028      *              for some GVP boards)
0029      */
0030 
0031 
0032 #define ZORRO_MANUF(id)     ((id) >> 16)
0033 #define ZORRO_PROD(id)      (((id) >> 8) & 0xff)
0034 #define ZORRO_EPC(id)       ((id) & 0xff)
0035 
0036 #define ZORRO_ID(manuf, prod, epc) \
0037     ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
0038 
0039 typedef __u32 zorro_id;
0040 
0041 
0042 /* Include the ID list */
0043 #include <linux/zorro_ids.h>
0044 
0045 
0046     /*
0047      *  GVP identifies most of its products through the 'extended product code'
0048      *  (epc). The epc has to be ANDed with the GVP_PRODMASK before the
0049      *  identification.
0050      */
0051 
0052 #define GVP_PRODMASK        (0xf8)
0053 #define GVP_SCSICLKMASK     (0x01)
0054 
0055 enum GVP_flags {
0056     GVP_IO          = 0x01,
0057     GVP_ACCEL       = 0x02,
0058     GVP_SCSI        = 0x04,
0059     GVP_24BITDMA        = 0x08,
0060     GVP_25BITDMA        = 0x10,
0061     GVP_NOBANK      = 0x20,
0062     GVP_14MHZ       = 0x40,
0063 };
0064 
0065 
0066 struct Node {
0067     __be32 ln_Succ;     /* Pointer to next (successor) */
0068     __be32 ln_Pred;     /* Pointer to previous (predecessor) */
0069     __u8   ln_Type;
0070     __s8   ln_Pri;      /* Priority, for sorting */
0071     __be32 ln_Name;     /* ID string, null terminated */
0072 } __packed;
0073 
0074 struct ExpansionRom {
0075     /* -First 16 bytes of the expansion ROM */
0076     __u8   er_Type;     /* Board type, size and flags */
0077     __u8   er_Product;  /* Product number, assigned by manufacturer */
0078     __u8   er_Flags;        /* Flags */
0079     __u8   er_Reserved03;   /* Must be zero ($ff inverted) */
0080     __be16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
0081     __be32 er_SerialNumber; /* Available for use by manufacturer */
0082     __be16 er_InitDiagVec;  /* Offset to optional "DiagArea" structure */
0083     __u8   er_Reserved0c;
0084     __u8   er_Reserved0d;
0085     __u8   er_Reserved0e;
0086     __u8   er_Reserved0f;
0087 } __packed;
0088 
0089 /* er_Type board type bits */
0090 #define ERT_TYPEMASK    0xc0
0091 #define ERT_ZORROII 0xc0
0092 #define ERT_ZORROIII    0x80
0093 
0094 /* other bits defined in er_Type */
0095 #define ERTB_MEMLIST    5       /* Link RAM into free memory list */
0096 #define ERTF_MEMLIST    (1<<5)
0097 
0098 struct ConfigDev {
0099     struct Node cd_Node;
0100     __u8        cd_Flags;   /* (read/write) */
0101     __u8        cd_Pad;     /* reserved */
0102     struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */
0103     __be32      cd_BoardAddr;   /* where in memory the board was placed */
0104     __be32      cd_BoardSize;   /* size of board in bytes */
0105     __be16      cd_SlotAddr;    /* which slot number (PRIVATE) */
0106     __be16      cd_SlotSize;    /* number of slots (PRIVATE) */
0107     __be32      cd_Driver;  /* pointer to node of driver */
0108     __be32      cd_NextCD;  /* linked list of drivers to config */
0109     __be32      cd_Unused[4];   /* for whatever the driver wants */
0110 } __packed;
0111 
0112 #define ZORRO_NUM_AUTO      16
0113 
0114 #endif /* _UAPI_LINUX_ZORRO_H */