zorro.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #ifndef _LINUX_ZORRO_H
  11. #define _LINUX_ZORRO_H
  12. #include <linux/types.h>
  13. /*
  14. * Each Zorro board has a 32-bit ID of the form
  15. *
  16. * mmmmmmmmmmmmmmmmppppppppeeeeeeee
  17. *
  18. * with
  19. *
  20. * mmmmmmmmmmmmmmmm 16-bit Manufacturer ID (assigned by CBM (sigh))
  21. * pppppppp 8-bit Product ID (assigned by manufacturer)
  22. * eeeeeeee 8-bit Extended Product ID (currently only used
  23. * for some GVP boards)
  24. */
  25. #define ZORRO_MANUF(id) ((id) >> 16)
  26. #define ZORRO_PROD(id) (((id) >> 8) & 0xff)
  27. #define ZORRO_EPC(id) ((id) & 0xff)
  28. #define ZORRO_ID(manuf, prod, epc) \
  29. ((ZORRO_MANUF_##manuf << 16) | ((prod) << 8) | (epc))
  30. typedef __u32 zorro_id;
  31. /* Include the ID list */
  32. #include <linux/zorro_ids.h>
  33. /*
  34. * GVP identifies most of its products through the 'extended product code'
  35. * (epc). The epc has to be ANDed with the GVP_PRODMASK before the
  36. * identification.
  37. */
  38. #define GVP_PRODMASK (0xf8)
  39. #define GVP_SCSICLKMASK (0x01)
  40. enum GVP_flags {
  41. GVP_IO = 0x01,
  42. GVP_ACCEL = 0x02,
  43. GVP_SCSI = 0x04,
  44. GVP_24BITDMA = 0x08,
  45. GVP_25BITDMA = 0x10,
  46. GVP_NOBANK = 0x20,
  47. GVP_14MHZ = 0x40,
  48. };
  49. struct Node {
  50. __be32 ln_Succ; /* Pointer to next (successor) */
  51. __be32 ln_Pred; /* Pointer to previous (predecessor) */
  52. __u8 ln_Type;
  53. __s8 ln_Pri; /* Priority, for sorting */
  54. __be32 ln_Name; /* ID string, null terminated */
  55. } __attribute__((packed));
  56. struct ExpansionRom {
  57. /* -First 16 bytes of the expansion ROM */
  58. __u8 er_Type; /* Board type, size and flags */
  59. __u8 er_Product; /* Product number, assigned by manufacturer */
  60. __u8 er_Flags; /* Flags */
  61. __u8 er_Reserved03; /* Must be zero ($ff inverted) */
  62. __be16 er_Manufacturer; /* Unique ID, ASSIGNED BY COMMODORE-AMIGA! */
  63. __be32 er_SerialNumber; /* Available for use by manufacturer */
  64. __be16 er_InitDiagVec; /* Offset to optional "DiagArea" structure */
  65. __u8 er_Reserved0c;
  66. __u8 er_Reserved0d;
  67. __u8 er_Reserved0e;
  68. __u8 er_Reserved0f;
  69. } __attribute__((packed));
  70. /* er_Type board type bits */
  71. #define ERT_TYPEMASK 0xc0
  72. #define ERT_ZORROII 0xc0
  73. #define ERT_ZORROIII 0x80
  74. /* other bits defined in er_Type */
  75. #define ERTB_MEMLIST 5 /* Link RAM into free memory list */
  76. #define ERTF_MEMLIST (1<<5)
  77. struct ConfigDev {
  78. struct Node cd_Node;
  79. __u8 cd_Flags; /* (read/write) */
  80. __u8 cd_Pad; /* reserved */
  81. struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */
  82. __be32 cd_BoardAddr; /* where in memory the board was placed */
  83. __be32 cd_BoardSize; /* size of board in bytes */
  84. __be16 cd_SlotAddr; /* which slot number (PRIVATE) */
  85. __be16 cd_SlotSize; /* number of slots (PRIVATE) */
  86. __be32 cd_Driver; /* pointer to node of driver */
  87. __be32 cd_NextCD; /* linked list of drivers to config */
  88. __be32 cd_Unused[4]; /* for whatever the driver wants */
  89. } __attribute__((packed));
  90. #define ZORRO_NUM_AUTO 16
  91. #endif /* _LINUX_ZORRO_H */