README.buddha 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. The Amiga Buddha and Catweasel IDE Driver (part of ide.c) was written by
  2. Geert Uytterhoeven based on the following specifications:
  3. ------------------------------------------------------------------------
  4. Register map of the Buddha IDE controller and the
  5. Buddha-part of the Catweasel Zorro-II version
  6. The Autoconfiguration has been implemented just as Commodore
  7. described in their manuals, no tricks have been used (for
  8. example leaving some address lines out of the equations...).
  9. If you want to configure the board yourself (for example let
  10. a Linux kernel configure the card), look at the Commodore
  11. Docs. Reading the nibbles should give this information:
  12. Vendor number: 4626 ($1212)
  13. product number: 0 (42 for Catweasel Z-II)
  14. Serial number: 0
  15. Rom-vector: $1000
  16. The card should be a Z-II board, size 64K, not for freemem
  17. list, Rom-Vektor is valid, no second Autoconfig-board on the
  18. same card, no space preference, supports "Shutup_forever".
  19. Setting the base address should be done in two steps, just
  20. as the Amiga Kickstart does: The lower nibble of the 8-Bit
  21. address is written to $4a, then the whole Byte is written to
  22. $48, while it doesn't matter how often you're writing to $4a
  23. as long as $48 is not touched. After $48 has been written,
  24. the whole card disappears from $e8 and is mapped to the new
  25. address just written. Make sure $4a is written before $48,
  26. otherwise your chance is only 1:16 to find the board :-).
  27. The local memory-map is even active when mapped to $e8:
  28. $0-$7e Autokonfig-space, see Z-II docs.
  29. $80-$7fd reserved
  30. $7fe Speed-select Register: Read & Write
  31. (description see further down)
  32. $800-$8ff IDE-Select 0 (Port 0, Register set 0)
  33. $900-$9ff IDE-Select 1 (Port 0, Register set 1)
  34. $a00-$aff IDE-Select 2 (Port 1, Register set 0)
  35. $b00-$bff IDE-Select 3 (Port 1, Register set 1)
  36. $c00-$cff IDE-Select 4 (Port 2, Register set 0,
  37. Catweasel only!)
  38. $d00-$dff IDE-Select 5 (Port 3, Register set 1,
  39. Catweasel only!)
  40. $e00-$eff local expansion port, on Catweasel Z-II the
  41. Catweasel registers are also mapped here.
  42. Never touch, use multidisk.device!
  43. $f00 read only, Byte-access: Bit 7 shows the
  44. level of the IRQ-line of IDE port 0.
  45. $f01-$f3f mirror of $f00
  46. $f40 read only, Byte-access: Bit 7 shows the
  47. level of the IRQ-line of IDE port 1.
  48. $f41-$f7f mirror of $f40
  49. $f80 read only, Byte-access: Bit 7 shows the
  50. level of the IRQ-line of IDE port 2.
  51. (Catweasel only!)
  52. $f81-$fbf mirror of $f80
  53. $fc0 write-only: Writing any value to this
  54. register enables IRQs to be passed from the
  55. IDE ports to the Zorro bus. This mechanism
  56. has been implemented to be compatible with
  57. harddisks that are either defective or have
  58. a buggy firmware and pull the IRQ line up
  59. while starting up. If interrupts would
  60. always be passed to the bus, the computer
  61. might not start up. Once enabled, this flag
  62. can not be disabled again. The level of the
  63. flag can not be determined by software
  64. (what for? Write to me if it's necessary!).
  65. $fc1-$fff mirror of $fc0
  66. $1000-$ffff Buddha-Rom with offset $1000 in the rom
  67. chip. The addresses $0 to $fff of the rom
  68. chip cannot be read. Rom is Byte-wide and
  69. mapped to even addresses.
  70. The IDE ports issue an INT2. You can read the level of the
  71. IRQ-lines of the IDE-ports by reading from the three (two
  72. for Buddha-only) registers $f00, $f40 and $f80. This way
  73. more than one I/O request can be handled and you can easily
  74. determine what driver has to serve the INT2. Buddha and
  75. Catweasel expansion boards can issue an INT6. A separate
  76. memory map is available for the I/O module and the sysop's
  77. I/O module.
  78. The IDE ports are fed by the address lines A2 to A4, just as
  79. the Amiga 1200 and Amiga 4000 IDE ports are. This way
  80. existing drivers can be easily ported to Buddha. A move.l
  81. polls two words out of the same address of IDE port since
  82. every word is mirrored once. movem is not possible, but
  83. it's not necessary either, because you can only speedup
  84. 68000 systems with this technique. A 68020 system with
  85. fastmem is faster with move.l.
  86. If you're using the mirrored registers of the IDE-ports with
  87. A6=1, the Buddha doesn't care about the speed that you have
  88. selected in the speed register (see further down). With
  89. A6=1 (for example $840 for port 0, register set 0), a 780ns
  90. access is being made. These registers should be used for a
  91. command access to the harddisk/CD-Rom, since command
  92. accesses are Byte-wide and have to be made slower according
  93. to the ATA-X3T9 manual.
  94. Now for the speed-register: The register is byte-wide, and
  95. only the upper three bits are used (Bits 7 to 5). Bit 4
  96. must always be set to 1 to be compatible with later Buddha
  97. versions (if I'll ever update this one). I presume that
  98. I'll never use the lower four bits, but they have to be set
  99. to 1 by definition.
  100. The values in this table have to be shifted 5 bits to the
  101. left and or'd with $1f (this sets the lower 5 bits).
  102. All the timings have in common: Select and IOR/IOW rise at
  103. the same time. IOR and IOW have a propagation delay of
  104. about 30ns to the clocks on the Zorro bus, that's why the
  105. values are no multiple of 71. One clock-cycle is 71ns long
  106. (exactly 70,5 at 14,18 Mhz on PAL systems).
  107. value 0 (Default after reset)
  108. 497ns Select (7 clock cycles) , IOR/IOW after 172ns (2 clock cycles)
  109. (same timing as the Amiga 1200 does on it's IDE port without
  110. accelerator card)
  111. value 1
  112. 639ns Select (9 clock cycles), IOR/IOW after 243ns (3 clock cycles)
  113. value 2
  114. 781ns Select (11 clock cycles), IOR/IOW after 314ns (4 clock cycles)
  115. value 3
  116. 355ns Select (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
  117. value 4
  118. 355ns Select (5 clock cycles), IOR/IOW after 172ns (2 clock cycles)
  119. value 5
  120. 355ns Select (5 clock cycles), IOR/IOW after 243ns (3 clock cycles)
  121. value 6
  122. 1065ns Select (15 clock cycles), IOR/IOW after 314ns (4 clock cycles)
  123. value 7
  124. 355ns Select, (5 clock cycles), IOR/IOW after 101ns (1 clock cycle)
  125. When accessing IDE registers with A6=1 (for example $84x),
  126. the timing will always be mode 0 8-bit compatible, no matter
  127. what you have selected in the speed register:
  128. 781ns select, IOR/IOW after 4 clock cycles (=314ns) aktive.
  129. All the timings with a very short select-signal (the 355ns
  130. fast accesses) depend on the accelerator card used in the
  131. system: Sometimes two more clock cycles are inserted by the
  132. bus interface, making the whole access 497ns long. This
  133. doesn't affect the reliability of the controller nor the
  134. performance of the card, since this doesn't happen very
  135. often.
  136. All the timings are calculated and only confirmed by
  137. measurements that allowed me to count the clock cycles. If
  138. the system is clocked by an oscillator other than 28,37516
  139. Mhz (for example the NTSC-frequency 28,63636 Mhz), each
  140. clock cycle is shortened to a bit less than 70ns (not worth
  141. mentioning). You could think of a small performance boost
  142. by overclocking the system, but you would either need a
  143. multisync monitor, or a graphics card, and your internal
  144. diskdrive would go crazy, that's why you shouldn't tune your
  145. Amiga this way.
  146. Giving you the possibility to write software that is
  147. compatible with both the Buddha and the Catweasel Z-II, The
  148. Buddha acts just like a Catweasel Z-II with no device
  149. connected to the third IDE-port. The IRQ-register $f80
  150. always shows a "no IRQ here" on the Buddha, and accesses to
  151. the third IDE port are going into data's Nirwana on the
  152. Buddha.
  153. Jens Schönfeld february 19th, 1997
  154. updated may 27th, 1997
  155. eMail: sysop@nostlgic.tng.oche.de