eisa_eeprom.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * eisa_eeprom.h - provide support for EISA adapters in PA-RISC machines
  4. *
  5. * Copyright (c) 2001, 2002 Daniel Engstrom <[email protected]>
  6. */
  7. #ifndef ASM_EISA_EEPROM_H
  8. #define ASM_EISA_EEPROM_H
  9. extern void __iomem *eisa_eeprom_addr;
  10. #define HPEE_MAX_LENGTH 0x2000 /* maximum eeprom length */
  11. #define HPEE_SLOT_INFO(slot) (20+(48*slot))
  12. struct eeprom_header
  13. {
  14. u_int32_t num_writes; /* number of writes */
  15. u_int8_t flags; /* flags, usage? */
  16. u_int8_t ver_maj;
  17. u_int8_t ver_min;
  18. u_int8_t num_slots; /* number of EISA slots in system */
  19. u_int16_t csum; /* checksum, I don't know how to calculate this */
  20. u_int8_t pad[10];
  21. } __attribute__ ((packed));
  22. struct eeprom_eisa_slot_info
  23. {
  24. u_int32_t eisa_slot_id;
  25. u_int32_t config_data_offset;
  26. u_int32_t num_writes;
  27. u_int16_t csum;
  28. u_int16_t num_functions;
  29. u_int16_t config_data_length;
  30. /* bits 0..3 are the duplicate slot id */
  31. #define HPEE_SLOT_INFO_EMBEDDED 0x10
  32. #define HPEE_SLOT_INFO_VIRTUAL 0x20
  33. #define HPEE_SLOT_INFO_NO_READID 0x40
  34. #define HPEE_SLOT_INFO_DUPLICATE 0x80
  35. u_int8_t slot_info;
  36. #define HPEE_SLOT_FEATURES_ENABLE 0x01
  37. #define HPEE_SLOT_FEATURES_IOCHK 0x02
  38. #define HPEE_SLOT_FEATURES_CFG_INCOMPLETE 0x80
  39. u_int8_t slot_features;
  40. u_int8_t ver_min;
  41. u_int8_t ver_maj;
  42. #define HPEE_FUNCTION_INFO_HAVE_TYPE 0x01
  43. #define HPEE_FUNCTION_INFO_HAVE_MEMORY 0x02
  44. #define HPEE_FUNCTION_INFO_HAVE_IRQ 0x04
  45. #define HPEE_FUNCTION_INFO_HAVE_DMA 0x08
  46. #define HPEE_FUNCTION_INFO_HAVE_PORT 0x10
  47. #define HPEE_FUNCTION_INFO_HAVE_PORT_INIT 0x20
  48. /* I think there are two slighty different
  49. * versions of the function_info field
  50. * one int the fixed header and one optional
  51. * in the parsed slot data area */
  52. #define HPEE_FUNCTION_INFO_HAVE_FUNCTION 0x01
  53. #define HPEE_FUNCTION_INFO_F_DISABLED 0x80
  54. #define HPEE_FUNCTION_INFO_CFG_FREE_FORM 0x40
  55. u_int8_t function_info;
  56. #define HPEE_FLAG_BOARD_IS_ISA 0x01 /* flag and minor version for isa board */
  57. u_int8_t flags;
  58. u_int8_t pad[24];
  59. } __attribute__ ((packed));
  60. #define HPEE_MEMORY_MAX_ENT 9
  61. /* memory descriptor: byte 0 */
  62. #define HPEE_MEMORY_WRITABLE 0x01
  63. #define HPEE_MEMORY_CACHABLE 0x02
  64. #define HPEE_MEMORY_TYPE_MASK 0x18
  65. #define HPEE_MEMORY_TYPE_SYS 0x00
  66. #define HPEE_MEMORY_TYPE_EXP 0x08
  67. #define HPEE_MEMORY_TYPE_VIR 0x10
  68. #define HPEE_MEMORY_TYPE_OTH 0x18
  69. #define HPEE_MEMORY_SHARED 0x20
  70. #define HPEE_MEMORY_MORE 0x80
  71. /* memory descriptor: byte 1 */
  72. #define HPEE_MEMORY_WIDTH_MASK 0x03
  73. #define HPEE_MEMORY_WIDTH_BYTE 0x00
  74. #define HPEE_MEMORY_WIDTH_WORD 0x01
  75. #define HPEE_MEMORY_WIDTH_DWORD 0x02
  76. #define HPEE_MEMORY_DECODE_MASK 0x0c
  77. #define HPEE_MEMORY_DECODE_20BITS 0x00
  78. #define HPEE_MEMORY_DECODE_24BITS 0x04
  79. #define HPEE_MEMORY_DECODE_32BITS 0x08
  80. /* byte 2 and 3 are a 16bit LE value
  81. * containing the memory size in kilobytes */
  82. /* byte 4,5,6 are a 24bit LE value
  83. * containing the memory base address */
  84. #define HPEE_IRQ_MAX_ENT 7
  85. /* Interrupt entry: byte 0 */
  86. #define HPEE_IRQ_CHANNEL_MASK 0xf
  87. #define HPEE_IRQ_TRIG_LEVEL 0x20
  88. #define HPEE_IRQ_MORE 0x80
  89. /* byte 1 seems to be unused */
  90. #define HPEE_DMA_MAX_ENT 4
  91. /* dma entry: byte 0 */
  92. #define HPEE_DMA_CHANNEL_MASK 7
  93. #define HPEE_DMA_SIZE_MASK 0xc
  94. #define HPEE_DMA_SIZE_BYTE 0x0
  95. #define HPEE_DMA_SIZE_WORD 0x4
  96. #define HPEE_DMA_SIZE_DWORD 0x8
  97. #define HPEE_DMA_SHARED 0x40
  98. #define HPEE_DMA_MORE 0x80
  99. /* dma entry: byte 1 */
  100. #define HPEE_DMA_TIMING_MASK 0x30
  101. #define HPEE_DMA_TIMING_ISA 0x0
  102. #define HPEE_DMA_TIMING_TYPEA 0x10
  103. #define HPEE_DMA_TIMING_TYPEB 0x20
  104. #define HPEE_DMA_TIMING_TYPEC 0x30
  105. #define HPEE_PORT_MAX_ENT 20
  106. /* port entry byte 0 */
  107. #define HPEE_PORT_SIZE_MASK 0x1f
  108. #define HPEE_PORT_SHARED 0x40
  109. #define HPEE_PORT_MORE 0x80
  110. /* byte 1 and 2 is a 16bit LE value
  111. * containing the start port number */
  112. #define HPEE_PORT_INIT_MAX_LEN 60 /* in bytes here */
  113. /* port init entry byte 0 */
  114. #define HPEE_PORT_INIT_WIDTH_MASK 0x3
  115. #define HPEE_PORT_INIT_WIDTH_BYTE 0x0
  116. #define HPEE_PORT_INIT_WIDTH_WORD 0x1
  117. #define HPEE_PORT_INIT_WIDTH_DWORD 0x2
  118. #define HPEE_PORT_INIT_MASK 0x4
  119. #define HPEE_PORT_INIT_MORE 0x80
  120. #define HPEE_SELECTION_MAX_ENT 26
  121. #define HPEE_TYPE_MAX_LEN 80
  122. #endif