eisa_eeprom.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:4k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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