act2000_isa.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* $Id: act2000_isa.h,v 1.4.6.1 2001/09/23 22:24:32 kai Exp $
  2. *
  3. * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version).
  4. *
  5. * Author Fritz Elfert
  6. * Copyright by Fritz Elfert <fritz@isdn4linux.de>
  7. *
  8. * This software may be used and distributed according to the terms
  9. * of the GNU General Public License, incorporated herein by reference.
  10. *
  11. * Thanks to Friedemann Baitinger and IBM Germany
  12. *
  13. */
  14. #ifndef act2000_isa_h
  15. #define act2000_isa_h
  16. #define ISA_POLL_LOOP 40 /* Try to read-write before give up */
  17. typedef enum {
  18. INT_NO_CHANGE = 0, /* Do not change the Mask */
  19. INT_ON = 1, /* Set to Enable */
  20. INT_OFF = 2, /* Set to Disable */
  21. } ISA_INT_T;
  22. /**************************************************************************/
  23. /* Configuration Register COR (RW) */
  24. /**************************************************************************/
  25. /* 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */
  26. /* Soft Res| IRQM | IRQ Select | N/A | WAIT |Proc err */
  27. /**************************************************************************/
  28. #define ISA_COR 0 /* Offset for ISA config register */
  29. #define ISA_COR_PERR 0x01 /* Processor Error Enabled */
  30. #define ISA_COR_WS 0x02 /* Insert Wait State if 1 */
  31. #define ISA_COR_IRQOFF 0x38 /* No Interrupt */
  32. #define ISA_COR_IRQ07 0x30 /* IRQ 7 Enable */
  33. #define ISA_COR_IRQ05 0x28 /* IRQ 5 Enable */
  34. #define ISA_COR_IRQ03 0x20 /* IRQ 3 Enable */
  35. #define ISA_COR_IRQ10 0x18 /* IRQ 10 Enable */
  36. #define ISA_COR_IRQ11 0x10 /* IRQ 11 Enable */
  37. #define ISA_COR_IRQ12 0x08 /* IRQ 12 Enable */
  38. #define ISA_COR_IRQ15 0x00 /* IRQ 15 Enable */
  39. #define ISA_COR_IRQPULSE 0x40 /* 0 = Level 1 = Pulse Interrupt */
  40. #define ISA_COR_RESET 0x80 /* Soft Reset for Transputer */
  41. /**************************************************************************/
  42. /* Interrupt Source Register ISR (RO) */
  43. /**************************************************************************/
  44. /* 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */
  45. /* N/A | N/A | N/A |Err sig |Ser ID |IN Intr |Out Intr| Error */
  46. /**************************************************************************/
  47. #define ISA_ISR 1 /* Offset for Interrupt Register */
  48. #define ISA_ISR_ERR 0x01 /* Error Interrupt */
  49. #define ISA_ISR_OUT 0x02 /* Output Interrupt */
  50. #define ISA_ISR_INP 0x04 /* Input Interrupt */
  51. #define ISA_ISR_SERIAL 0x08 /* Read out Serial ID after Reset */
  52. #define ISA_ISR_ERRSIG 0x10 /* Error Signal Input */
  53. #define ISA_ISR_ERR_MASK 0xfe /* Mask Error Interrupt */
  54. #define ISA_ISR_OUT_MASK 0xfd /* Mask Output Interrupt */
  55. #define ISA_ISR_INP_MASK 0xfb /* Mask Input Interrupt */
  56. /* Signature delivered after Reset at ISA_ISR_SERIAL (LSB first) */
  57. #define ISA_SER_ID 0x0201 /* ID for ISA Card */
  58. /**************************************************************************/
  59. /* EEPROM Register EPR (RW) */
  60. /**************************************************************************/
  61. /* 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */
  62. /* N/A | N/A | N/A |ROM Hold| ROM CS |ROM CLK | ROM IN |ROM Out */
  63. /**************************************************************************/
  64. #define ISA_EPR 2 /* Offset for this Register */
  65. #define ISA_EPR_OUT 0x01 /* Rome Register Out (RO) */
  66. #define ISA_EPR_IN 0x02 /* Rom Register In (WR) */
  67. #define ISA_EPR_CLK 0x04 /* Rom Clock (WR) */
  68. #define ISA_EPR_CS 0x08 /* Rom Cip Select (WR) */
  69. #define ISA_EPR_HOLD 0x10 /* Rom Hold Signal (WR) */
  70. /**************************************************************************/
  71. /* EEPROM enable Register EER (unused) */
  72. /**************************************************************************/
  73. #define ISA_EER 3 /* Offset for this Register */
  74. /**************************************************************************/
  75. /* SLC Data Input SDI (RO) */
  76. /**************************************************************************/
  77. #define ISA_SDI 4 /* Offset for this Register */
  78. /**************************************************************************/
  79. /* SLC Data Output SDO (WO) */
  80. /**************************************************************************/
  81. #define ISA_SDO 5 /* Offset for this Register */
  82. /**************************************************************************/
  83. /* IMS C011 Mode 2 Input Status Register for INMOS CPU SIS (RW) */
  84. /**************************************************************************/
  85. /* 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */
  86. /* N/A | N/A | N/A | N/A | N/A | N/A |Int Ena |Data Pre */
  87. /**************************************************************************/
  88. #define ISA_SIS 6 /* Offset for this Register */
  89. #define ISA_SIS_READY 0x01 /* If 1 : data is available */
  90. #define ISA_SIS_INT 0x02 /* Enable Interrupt for READ */
  91. /**************************************************************************/
  92. /* IMS C011 Mode 2 Output Status Register from INMOS CPU SOS (RW) */
  93. /**************************************************************************/
  94. /* 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 */
  95. /* N/A | N/A | N/A | N/A | N/A | N/A |Int Ena |Out Rdy */
  96. /**************************************************************************/
  97. #define ISA_SOS 7 /* Offset for this Register */
  98. #define ISA_SOS_READY 0x01 /* If 1 : we can write Data */
  99. #define ISA_SOS_INT 0x02 /* Enable Interrupt for WRITE */
  100. #define ISA_REGION 8 /* Number of Registers */
  101. /* Macros for accessing ports */
  102. #define ISA_PORT_COR (card->port+ISA_COR)
  103. #define ISA_PORT_ISR (card->port+ISA_ISR)
  104. #define ISA_PORT_EPR (card->port+ISA_EPR)
  105. #define ISA_PORT_EER (card->port+ISA_EER)
  106. #define ISA_PORT_SDI (card->port+ISA_SDI)
  107. #define ISA_PORT_SDO (card->port+ISA_SDO)
  108. #define ISA_PORT_SIS (card->port+ISA_SIS)
  109. #define ISA_PORT_SOS (card->port+ISA_SOS)
  110. /* Prototypes */
  111. extern int act2000_isa_detect(unsigned short portbase);
  112. extern int act2000_isa_config_irq(act2000_card * card, short irq);
  113. extern int act2000_isa_config_port(act2000_card * card, unsigned short portbase);
  114. extern int act2000_isa_download(act2000_card * card, act2000_ddef __user * cb);
  115. extern void act2000_isa_release(act2000_card * card);
  116. extern void act2000_isa_receive(act2000_card *card);
  117. extern void act2000_isa_send(act2000_card *card);
  118. #endif /* act2000_isa_h */