zorro.h 3.2 KB

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