averageLiquidLevel.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. * 6522 Versatile Interface Adapter (VIA)
  3. *
  4. * There are two of these on the Mac II. Some IRQ's are vectored
  5. * via them as are assorted bits and bobs - eg rtc, adb. The picture
  6. * is a bit incomplete as the Mac documentation doesn't cover this well
  7. */
  8. #ifndef _ASM_MAC_VIA_H_
  9. #define _ASM_MAC_VIA_H_
  10. /*
  11. * Base addresses for the VIAs. There are two in every machine,
  12. * although on some machines the second is an RBV or an OSS.
  13. * The OSS is different enough that it's handled separately.
  14. *
  15. * Do not use these values directly; use the via1 and via2 variables
  16. * instead (and don't forget to check rbv_present when using via2!)
  17. */
  18. #define VIA1_BASE (0x50F00000)
  19. #define VIA2_BASE (0x50F02000)
  20. #define RBV_BASE (0x50F26000)
  21. /*
  22. * Not all of these are true post MacII I think.
  23. * CSA: probably the ones CHRP marks as 'unused' change purposes
  24. * when the IWM becomes the SWIM.
  25. * http://www.rs6000.ibm.com/resource/technology/chrpio/via5.mak.html
  26. * ftp://ftp.austin.ibm.com/pub/technology/spec/chrp/inwork/CHRP_IORef_1.0.pdf
  27. *
  28. * also, http://developer.apple.com/technotes/hw/hw_09.html claims the
  29. * following changes for IIfx:
  30. * VIA1A_vSccWrReq not available and that VIA1A_vSync has moved to an IOP.
  31. * Also, "All of the functionality of VIA2 has been moved to other chips".
  32. */
  33. #define VIA1A_vSccWrReq 0x80 /* SCC write. (input)
  34. * [CHRP] SCC WREQ: Reflects the state of the
  35. * Wait/Request pins from the SCC.
  36. * [Macintosh Family Hardware]
  37. * as CHRP on SE/30,II,IIx,IIcx,IIci.
  38. * on IIfx, "0 means an active request"
  39. */
  40. #define VIA1A_vRev8 0x40 /* Revision 8 board ???
  41. * [CHRP] En WaitReqB: Lets the WaitReq_L
  42. * signal from port B of the SCC appear on
  43. * the PA7 input pin. Output.
  44. * [Macintosh Family] On the SE/30, this
  45. * is the bit to flip screen buffers.
  46. * 0=alternate, 1=main.
  47. * on II,IIx,IIcx,IIci,IIfx this is a bit
  48. * for Rev ID. 0=II,IIx, 1=IIcx,IIci,IIfx
  49. */
  50. #define VIA1A_vHeadSel 0x20 /* Head select for IWM.
  51. * [CHRP] unused.
  52. * [Macintosh Family] "Floppy disk
  53. * state-control line SEL" on all but IIfx
  54. */
  55. #define VIA1A_vOverlay 0x10 /* [Macintosh Family] On SE/30,II,IIx,IIcx
  56. * this bit enables the "Overlay" address
  57. * map in the address decoders as it is on
  58. * reset for mapping the ROM over the reset
  59. * vector. 1=use overlay map.
  60. * On the IIci,IIfx it is another bit of the
  61. * CPU ID: 0=normal IIci, 1=IIci with parity
  62. * feature or IIfx.
  63. * [CHRP] En WaitReqA: Lets the WaitReq_L
  64. * signal from port A of the SCC appear
  65. * on the PA7 input pin (CHRP). Output.
  66. * [MkLinux] "Drive Select"
  67. * (with 0x20 being 'disk head select')
  68. */
  69. #define VIA1A_vSync 0x08 /* [CHRP] Sync Modem: modem clock select:
  70. * 1: select the external serial clock to
  71. * drive the SCC's /RTxCA pin.
  72. * 0: Select the 3.6864MHz clock to drive
  73. * the SCC cell.
  74. * [Macintosh Family] Correct on all but IIfx
  75. */
  76. /* Macintosh Family Hardware sez: bits 0-2 of VIA1A are volume control
  77. * on Macs which had the PWM sound hardware. Reserved on newer models.
  78. * On IIci,IIfx, bits 1-2 are the rest of the CPU ID:
  79. * bit 2: 1=IIci, 0=IIfx
  80. * bit 1: 1 on both IIci and IIfx.
  81. * MkLinux sez bit 0 is 'burnin flag' in this case.
  82. * CHRP sez: VIA1A bits 0-2 and 5 are 'unused': if programmed as
  83. * inputs, these bits will read 0.
  84. */
  85. #define VIA1A_vVolume 0x07 /* Audio volume mask for PWM */
  86. #define VIA1A_CPUID0 0x02 /* CPU id bit 0 on RBV, others */
  87. #define VIA1A_CPUID1 0x04 /* CPU id bit 0 on RBV, others */
  88. #define VIA1A_CPUID2 0x10 /* CPU id bit 0 on RBV, others */
  89. #define VIA1A_CPUID3 0x40 /* CPU id bit 0 on RBV, others */
  90. /* Info on VIA1B is from Macintosh Family Hardware & MkLinux.
  91. * CHRP offers no info. */
  92. #define VIA1B_vSound 0x80 /* Sound enable (for compatibility with
  93. * PWM hardware) 0=enabled.
  94. * Also, on IIci w/parity, shows parity error
  95. * 0=error, 1=OK. */
  96. #define VIA1B_vMystery 0x40 /* On IIci, parity enable. 0=enabled,1=disabled
  97. * On SE/30, vertical sync interrupt enable.
  98. * 0=enabled. This vSync interrupt shows up
  99. * as a slot $E interrupt. */
  100. #define VIA1B_vADBS2 0x20 /* ADB state input bit 1 (unused on IIfx) */
  101. #define VIA1B_vADBS1 0x10 /* ADB state input bit 0 (unused on IIfx) */
  102. #define VIA1B_vADBInt 0x08 /* ADB interrupt 0=interrupt (unused on IIfx)*/
  103. #define VIA1B_vRTCEnb 0x04 /* Enable Real time clock. 0=enabled. */
  104. #define VIA1B_vRTCClk 0x02 /* Real time clock serial-clock line. */
  105. #define VIA1B_vRTCData 0x01 /* Real time clock serial-data line. */
  106. /* MkLinux defines the following "VIA1 Register B contents where they
  107. * differ from standard VIA1". From the naming scheme, we assume they
  108. * correspond to a VIA work-alike named 'EVR'. */
  109. #define EVRB_XCVR 0x08 /* XCVR_SESSION* */
  110. #define EVRB_FULL 0x10 /* VIA_FULL */
  111. #define EVRB_SYSES 0x20 /* SYS_SESSION */
  112. #define EVRB_AUXIE 0x00 /* Enable A/UX Interrupt Scheme */
  113. #define EVRB_AUXID 0x40 /* Disable A/UX Interrupt Scheme */
  114. #define EVRB_SFTWRIE 0x00 /* Software Interrupt ReQuest */
  115. #define EVRB_SFTWRID 0x80 /* Software Interrupt ReQuest */
  116. /*
  117. * VIA2 A register is the interrupt lines raised off the nubus
  118. * slots.
  119. * The below info is from 'Macintosh Family Hardware.'
  120. * MkLinux calls the 'IIci internal video IRQ' below the 'RBV slot 0 irq.'
  121. * It also notes that the slot $9 IRQ is the 'Ethernet IRQ' and
  122. * defines the 'Video IRQ' as 0x40 for the 'EVR' VIA work-alike.
  123. * Perhaps OSS uses vRAM1 and vRAM2 for ADB.
  124. */
  125. #define VIA2A_vRAM1 0x80 /* RAM size bit 1 (IIci: reserved) */
  126. #define VIA2A_vRAM0 0x40 /* RAM size bit 0 (IIci: internal video IRQ) */
  127. #define VIA2A_vIRQE 0x20 /* IRQ from slot $E */
  128. #define VIA2A_vIRQD 0x10 /* IRQ from slot $D */
  129. #define VIA2A_vIRQC 0x08 /* IRQ from slot $C */
  130. #define VIA2A_vIRQB 0x04 /* IRQ from slot $B */
  131. #define VIA2A_vIRQA 0x02 /* IRQ from slot $A */
  132. #define VIA2A_vIRQ9 0x01 /* IRQ from slot $9 */
  133. /* RAM size bits decoded as follows:
  134. * bit1 bit0 size of ICs in bank A
  135. * 0 0 256 kbit
  136. * 0 1 1 Mbit
  137. * 1 0 4 Mbit
  138. * 1 1 16 Mbit
  139. */
  140. /*
  141. * Register B has the fun stuff in it
  142. */
  143. #define VIA2B_vVBL 0x80 /* VBL output to VIA1 (60.15Hz) driven by
  144. * timer T1.
  145. * on IIci, parity test: 0=test mode.
  146. * [MkLinux] RBV_PARODD: 1=odd,0=even. */
  147. #define VIA2B_vSndJck 0x40 /* External sound jack status.
  148. * 0=plug is inserted. On SE/30, always 0 */
  149. #define VIA2B_vTfr0 0x20 /* Transfer mode bit 0 ack from NuBus */
  150. #define VIA2B_vTfr1 0x10 /* Transfer mode bit 1 ack from NuBus */
  151. #define VIA2B_vMode32 0x08 /* 24/32bit switch - doubles as cache flush
  152. * on II, AMU/PMMU control.
  153. * if AMU, 0=24bit to 32bit translation
  154. * if PMMU, 1=PMMU is accessing page table.
  155. * on SE/30 tied low.
  156. * on IIx,IIcx,IIfx, unused.
  157. * on IIci/RBV, cache control. 0=flush cache.
  158. */
  159. #define VIA2B_vPower 0x04 /* Power off, 0=shut off power.
  160. * on SE/30 this signal sent to PDS card. */
  161. #define VIA2B_vBusLk 0x02 /* Lock NuBus transactions, 0=locked.
  162. * on SE/30 sent to PDS card. */
  163. #define VIA2B_vCDis 0x01 /* Cache control. On IIci, 1=disable cache card
  164. * on others, 0=disable processor's instruction
  165. * and data caches. */
  166. /* Apple sez: http://developer.apple.com/technotes/ov/ov_04.html
  167. * Another example of a valid function that has no ROM support is the use
  168. * of the alternate video page for page-flipping animation. Since there
  169. * is no ROM call to flip pages, it is necessary to go play with the
  170. * right bit in the VIA chip (6522 Versatile Interface Adapter).