home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / libraries / configregs.i < prev    next >
Text File  |  1993-10-15  |  9KB  |  245 lines

  1.     IFND    LIBRARIES_CONFIGREGS_I
  2. LIBRARIES_CONFIGREGS_I    SET    1
  3. **
  4. **    $VER: configregs.i 36.11 (3.11.90)
  5. **    Includes Release 40.15
  6. **
  7. **    AutoConfig (tm) hardware register and bit definitions
  8. **
  9. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13.     IFND    EXEC_TYPES_I
  14.     INCLUDE    "exec/types.i"
  15.     ENDC    ;EXEC_TYPES_I
  16.  
  17. **
  18. ** AutoConfig (tm) boards each contain a 32 byte "ExpansionRom" area that is
  19. ** read by the system software at configuration time.  Configuration of each
  20. ** board starts when the ConfigIn* signal is passed from the previous board
  21. ** (or from the system for the first board).  Each board will present it's
  22. ** ExpansionRom structure at location $00E80000 to be read by the system.
  23. ** This file defines the appearance of the ExpansionRom area.
  24. **
  25. ** Expansion boards are actually organized such that only one nybble per
  26. ** 16 bit word contains valid information.  The low nybbles of each
  27. ** word are combined to fill the structure below. (This table is structured
  28. ** as LOGICAL information.  This means that it never corresponds exactly
  29. ** with a physical implementation.)
  30. **
  31. ** The ExpansionRom space is further split into two regions:  The first 16
  32. ** bytes are read-only.  Except for the er_type field, this area is inverted
  33. ** by the system software when read in.  The second 16 bytes contain the
  34. ** control portion, where all read/write registers are located.
  35. **
  36. ** The system builds one "ConfigDev" structure for each board found.  The
  37. ** list of boards can be examined using the expansion.library/FindConfigDev
  38. ** function.
  39. **
  40. ** A special "hacker" Manufacturer ID number is reserved for test use:
  41. ** 2011 ($7DB).  When inverted this will look like $F824.
  42. **
  43.  
  44.  STRUCTURE ExpansionRom,0    ;-First 16 bytes of the expansion ROM
  45.     UBYTE    er_Type     ;Board type, size and flags
  46.     UBYTE    er_Product    ;Product number, assigned by manufacturer
  47.     UBYTE    er_Flags    ;Flags
  48.     UBYTE    er_Reserved03    ;Must be zero ($ff inverted)
  49.     UWORD    er_Manufacturer ;Unique ID,ASSIGNED BY COMMODORE-AMIGA!
  50.     ULONG    er_SerialNumber ;Available for use by manufacturer
  51.     UWORD    er_InitDiagVec    ;Offset to optional "DiagArea" structure
  52.     UBYTE    er_Reserved0c
  53.     UBYTE    er_Reserved0d
  54.     UBYTE    er_Reserved0e
  55.     UBYTE    er_Reserved0f
  56.     LABEL    ExpansionRom_SIZEOF
  57.  
  58.  
  59. **
  60. ** Note that use of the ec_BaseAddress register is tricky.  The system
  61. ** will actually write twice.  First the low order nybble is written
  62. ** to the ec_BaseAddress register+2 (D15-D12).  Then the entire byte is
  63. ** written to ec_BaseAddress (D15-D8).  This allows writing of a byte-wide
  64. ** address to nybble size registers.
  65. **
  66.  
  67.  STRUCTURE ExpansionControl,0    ;-Second 16 bytes of the expansion ROM
  68.     UBYTE    ec_Interrupt    ;Optional interrupt control register
  69.     UBYTE    ec_Z3_HighBase    ;Zorro III   : Bits 24-31 of config address
  70.     UBYTE    ec_BaseAddress    ;Zorro II/III: Bits 16-23 of config address
  71.     UBYTE    ec_Shutup    ;The system writes here to shut up a board
  72.     UBYTE    ec_Reserved14
  73.     UBYTE    ec_Reserved15
  74.     UBYTE    ec_Reserved16
  75.     UBYTE    ec_Reserved17
  76.     UBYTE    ec_Reserved18
  77.     UBYTE    ec_Reserved19
  78.     UBYTE    ec_Reserved1a
  79.     UBYTE    ec_Reserved1b
  80.     UBYTE    ec_Reserved1c
  81.     UBYTE    ec_Reserved1d
  82.     UBYTE    ec_Reserved1e
  83.     UBYTE    ec_Reserved1f
  84.     LABEL    ExpansionControl_SIZEOF
  85.  
  86. **
  87. ** many of the constants below consist of a triplet of equivalent
  88. ** definitions: xxMASK is a bit mask of those bits that matter.
  89. ** xxBIT is the starting bit number of the field.  xxSIZE is the
  90. ** number of bits that make up the definition.    This method is
  91. ** used when the field is larger than one bit.
  92. **
  93. ** If the field is only one bit wide then the xxB_xx and xxF_xx convention
  94. ** is used (xxB_xx is the bit number, and xxF_xx is mask of the bit).
  95. **
  96.  
  97. ** manifest constants **
  98. E_SLOTSIZE        EQU    $10000
  99. E_SLOTMASK        EQU    $ffff
  100. E_SLOTSHIFT        EQU    16
  101.  
  102.  
  103. ** these define the free regions of Zorro memory space.
  104. ** THESE MAY WELL CHANGE FOR FUTURE PRODUCTS!
  105. E_EXPANSIONBASE     EQU    $00e80000    ;Zorro II  config address
  106. EZ3_EXPANSIONBASE    EQU    $ff000000    ;Zorro III config address
  107.  
  108. E_EXPANSIONSIZE     EQU    $00080000    ;Zorro II  I/O type cards
  109. E_EXPANSIONSLOTS    EQU    8
  110.  
  111. E_MEMORYBASE        EQU    $00200000    ;Zorro II  8MB space
  112. E_MEMORYSIZE        EQU    $00800000
  113. E_MEMORYSLOTS        EQU    128
  114.  
  115. EZ3_CONFIGAREA        EQU    $40000000    ;Zorro III space
  116. EZ3_CONFIGAREAEND    EQU    $7FFFFFFF    ;Zorro III space
  117. EZ3_SIZEGRANULARITY    EQU    $00080000    ;512K increments
  118.  
  119.  
  120. ***** er_Type definitions (ttldcmmm) ****************************************
  121.  
  122. ** er_Type board type bits -- the OS ignores "old style" boards **
  123. ERT_TYPEMASK        EQU    $c0    ;Bits 7-6
  124. ERT_TYPEBIT        EQU    6
  125. ERT_TYPESIZE        EQU    2
  126. ERT_NEWBOARD        EQU    $c0
  127. ERT_ZORROII        EQU    ERT_NEWBOARD
  128. ERT_ZORROIII        EQU    $80
  129.  
  130. ** other bits defined in er_Type **
  131.     BITDEF    ERT,MEMLIST,5        ; Link RAM into free memory list
  132.     BITDEF    ERT,DIAGVALID,4     ; ROM vector is valid
  133.     BITDEF    ERT,CHAINEDCONFIG,3    ; Next config is part of the same card
  134.  
  135. ** er_Type field memory size bits **
  136. ERT_MEMMASK        EQU    $07    ;Bits 2-0
  137. ERT_MEMBIT        EQU    0
  138. ERT_MEMSIZE        EQU    3
  139.  
  140.  
  141.  
  142. ***** er_Flags byte -- for those things that didn't fit into the type byte ****
  143. ***** the hardware stores this byte in inverted form               ****
  144.     BITDEF    ERF,MEMSPACE,7        ; Wants to be in 8 meg space.
  145.                     ; (NOT IMPLEMENTED)
  146.  
  147.     BITDEF    ERF,NOSHUTUP,6        ; Board can't be shut up.
  148.  
  149.     BITDEF    ERF,EXTENDED,5        ; Zorro III: Use extended size table
  150.                     ;         for bits 0-2 of er_Type.
  151.                     ; Zorro II : Must be 0
  152.  
  153.     BITDEF    ERF,ZORRO_III,4     ; Zorro III: must be 1
  154.                     ; Zorro II : must be 0
  155.  
  156. ERT_Z3_SSMASK        EQU    $0F    ; Bits 3-0.  Zorro III Sub-Size.  How
  157. ERT_Z3_SSBIT        EQU    0    ; much space the card actually uses
  158. ERT_Z3_SSSIZE        EQU    4    ; (regardless of config granularity)
  159.                     ; Zorro II : must be 0
  160.  
  161.  
  162. ** ec_Interrupt register (unused) *********************************************
  163.     BITDEF    ECI,INTENA,1
  164.     BITDEF    ECI,RESET,3
  165.     BITDEF    ECI,INT2PEND,4
  166.     BITDEF    ECI,INT6PEND,5
  167.     BITDEF    ECI,INT7PEND,6
  168.     BITDEF    ECI,INTERRUPTING,7
  169.  
  170.  
  171. **************************************************************************
  172. **
  173. ** these are the specifications for the diagnostic area.  If the Diagnostic
  174. ** Address Valid bit is set in the Board Type byte (the first byte in
  175. ** expansion space) then the Diag Init vector contains a valid offset.
  176. **
  177. ** The Diag Init vector is actually a word offset from the base of the
  178. ** board.  The resulting address points to the base of the DiagArea
  179. ** structure.  The structure may be physically implemented either four,
  180. ** eight, or sixteen bits wide.  The code will be copied out into
  181. ** ram first before being called.
  182. **
  183. ** The da_Size field, and both code offsets (da_DiagPoint and da_BootPoint)
  184. ** are offsets from the diag area AFTER it has been copied into ram, and
  185. ** "de-nybbleized" (if needed). (In other words, the byte size is the size of
  186. ** the actual information, not how much address space is required to
  187. ** store it.)
  188. **
  189. ** All bits are encoded with uninverted logic (e.g. 5 volts on the bus
  190. ** is a logic one).
  191. **
  192. ** If your board is to make use of the boot facility then it must leave
  193. ** its config area available even after it has been configured.  Your
  194. ** boot vector will be called AFTER your board's final address has been
  195. ** set.
  196. **
  197. **************************************************************************
  198.  
  199.  STRUCTURE DiagArea,0
  200.     UBYTE    da_Config    ; see below for definitions
  201.     UBYTE    da_Flags    ; see below for definitions
  202.     UWORD    da_Size    ; the size (in bytes) of the total diag area
  203.     UWORD    da_DiagPoint    ; where to start for diagnostics, or zero
  204.     UWORD    da_BootPoint    ; where to start for booting
  205.     UWORD    da_Name    ; offset in diag area where a string
  206.                 ;   identifier can be found (or zero if no
  207.                 ;   identifier is present).
  208.  
  209.     UWORD    da_Reserved01    ; two words of reserved data.  must be zero.
  210.     UWORD    da_Reserved02
  211.     LABEL    DiagArea_SIZEOF
  212.  
  213. ; da_Config definitions
  214. **
  215. ** DAC_BYTEWIDE can be simulated using DAC_NIBBLEWIDE.
  216. **
  217. DAC_BUSWIDTH    EQU    $C0    ; two bits for bus width
  218. DAC_NIBBLEWIDE    EQU    $00    ; (indicates information is nybble wide)
  219. DAC_BYTEWIDE    EQU    $40    ; BUG: Will not work under V34 Kickstart!
  220. DAC_WORDWIDE    EQU    $80
  221.  
  222. DAC_BOOTTIME    EQU    $30    ; two bits for when to boot
  223. DAC_NEVER    EQU    $00    ; obvious
  224. DAC_CONFIGTIME    EQU    $10    ; call da_BootPoint when first configing
  225.                 ;   the device
  226. DAC_BINDTIME    EQU    $20    ; run when binding drivers to boards
  227.  
  228. **
  229. ** These are the calling conventions for the diagnostic callback
  230. ** (from da_DiagPoint).
  231. **
  232. ** A7 -- points to at least 2K of stack
  233. ** A6 -- ExecBase
  234. ** A5 -- ExpansionBase
  235. ** A3 -- your board's ConfigDev structure
  236. ** A2 -- Base of diag/init area that was copied
  237. ** A0 -- Base of your board
  238. **
  239. ** Your board must return a value in D0.  If this value is NULL, then
  240. ** the diag/init area that was copied in will be returned to the free
  241. ** memory pool.
  242. **
  243.  
  244.     ENDC    ;LIBRARIES_CONFIGREGS_I
  245.