Changeset 361 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE


Ignore:
Timestamp:
Mar 20, 2012, 5:52:33 PM (13 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Added untested support for Fast XTIDE (CPLD v2 project).
  • Removed 8-bit single port device since there does not seem to be any need for one.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device/IDE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm

    r276 r361  
    4747;--------------------------------------------------------------------
    4848IdeDPT_StoreReversedAddressLinesFlagIfNecessary:
    49     cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
     49    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_XTIDE_REV2
     50    je      SHORT .SetFlagForSwappedA0andA3
     51    cmp     BYTE [cs:bp+IDEVARS.bDevice], DEVICE_FAST_XTIDE
    5052    jne     SHORT .EndDPT
     53.SetFlagForSwappedA0andA3:
    5154    or      BYTE [di+DPT.bFlagsHigh], FLGH_DPT_REVERSED_A0_AND_A3
    5255
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r294 r361  
    203203
    204204;--------------------------------------------------------------------
    205 ; DualByteReadForXtide      Dual port 8-bit XTIDE PIO read transfer
    206 ; SingleByteRead            Single port 8-bit PIO read transfer
    207 ; WordReadForXTIDEmod       8088/8086 compatible 16-bit IDE PIO read transfer
    208 ; WordReadForXTplusAndAT    Normal 16-bit IDE PIO read transfer
    209 ; DWordRead                 VLB/PCI 32-bit IDE PIO read transfer
     205; ReadBlockFromXtideRev1        XTIDE rev 1
     206; ReadBlockFromXtideRev2        XTIDE rev 2 or rev 1 with swapped A0 and A3 (chuck-mod)
     207; ReadBlockFrom16bitDataPort    Normal 16-bit IDE
     208; ReadBlockFrom32bitDataPort    VLB/PCI 32-bit IDE
    210209;   Parameters:
    211210;       CX:     Block size in WORDs
     
    218217;--------------------------------------------------------------------
    219218ALIGN JUMP_ALIGN
    220 DualByteReadForXtide:
     219ReadBlockFromXtideRev1:
    221220    eSHR_IM cx, 2       ; Loop unrolling
    222221    mov     bx, 8       ; Bit mask for toggling data low/high reg
     
    230229    ret
    231230
    232 ;----
    233 ALIGN JUMP_ALIGN
    234 SingleByteRead:
    235 %ifdef USE_186  ; INS instruction available
    236     shl     cx, 1       ; WORD count to BYTE count
    237     dec     cx          ; Fix for CX overflowing on a 128 sector transfer
    238     insb
    239     rep insb
    240 %else           ; If 8088/8086
    241     shr     cx, 1       ; WORD count to DWORD count
    242 ALIGN JUMP_ALIGN
    243 .InsdLoop:
    244     in      al, dx
    245     stosb               ; Store to [ES:DI]
    246     in      al, dx
    247     stosb
    248     in      al, dx
    249     stosb
    250     in      al, dx
    251     stosb
    252     loop    .InsdLoop
    253 %endif
    254     ret
    255 
    256 ;----
    257 %ifndef USE_186
    258 ALIGN JUMP_ALIGN
    259 WordReadForXTIDEmod:
     231;--------------------------------------------------------------------
     232%ifndef USE_186         ; 8086/8088 compatible WORD read
     233ALIGN JUMP_ALIGN
     234ReadBlockFromXtideRev2:
    260235    times 2 shr cx, 1   ; WORD count to QWORD count
    261236ALIGN JUMP_ALIGN
     
    273248%endif
    274249
    275 ;----
    276 ALIGN JUMP_ALIGN
    277 WordReadForXTplusAndAT:
     250;--------------------------------------------------------------------
     251ALIGN JUMP_ALIGN
     252ReadBlockFrom16bitDataPort:
    278253    rep
    279254    db      6Dh         ; INSW (we want this in XT build)
    280255    ret
    281256
    282 ;----
    283 ALIGN JUMP_ALIGN
    284 DWordRead:
     257;--------------------------------------------------------------------
     258ALIGN JUMP_ALIGN
     259ReadBlockFrom32bitDataPort:
    285260    shr     cx, 1       ; WORD count to DWORD count
    286261    rep
     
    291266
    292267;--------------------------------------------------------------------
    293 ; DualByteWriteForXtide     Dual port 8-bit XTIDE PIO write transfer
    294 ; SingleByteWrite           Single port 8-bit PIO write transfer
    295 ; WordWriteForXTIDEmod      8088/8086 compatible 16-bit IDE PIO read transfer
    296 ; WordWrite                 Normal 16-bit IDE PIO write transfer
    297 ; DWordWrite                VLB/PCI 32-bit IDE PIO write transfer
     268; WriteBlockToXtideRev1         XTIDE rev 1
     269; WriteBlockToXtideRev2         XTIDE rev 2 or rev 1 with swapped A0 and A3 (chuck-mod)
     270; WriteBlockToFastXtide         Fast XTIDE (CPLD v2 project)
     271; WriteBlockTo16bitDataPort     Normal 16-bit IDE
     272; WriteBlockTo32bitDataPort     VLB/PCI 32-bit IDE
    298273;   Parameters:
    299274;       CX:     Block size in WORDs
     
    306281;--------------------------------------------------------------------
    307282ALIGN JUMP_ALIGN
    308 DualByteWriteForXtide:
     283WriteBlockToXtideRev1:
    309284    push    ds
    310285    push    bx
     
    324299    ret
    325300
    326 ;----
    327 ALIGN JUMP_ALIGN
    328 SingleByteWrite:
    329 %ifdef USE_186  ; OUTS instruction available
    330     shl     cx, 1       ; WORD count to BYTE count
    331     dec     cx          ; Fix for CX overflowing on a 128 sector transfer
    332     es outsb            ; Source is ES segment
    333     rep es outsb
    334 %else           ; If 8088/8086
    335     shr     cx, 1       ; WORD count to DWORD count
    336     push    ds          ; Store DS
    337     push    es          ; Copy ES...
    338     pop     ds          ; ...to DS
    339 ALIGN JUMP_ALIGN
    340 .OutsdLoop:
    341     lodsb               ; Load from [DS:SI] to AL
    342     out     dx, al
    343     lodsb
    344     out     dx, al
    345     lodsb
    346     out     dx, al
    347     lodsb
    348     out     dx, al
    349     loop    .OutsdLoop
    350     pop     ds          ; Restore DS
    351 %endif
    352     ret
    353 
    354 ;---
    355 ALIGN JUMP_ALIGN
    356 WordWriteForXTIDEmod:
     301;--------------------------------------------------------------------
     302ALIGN JUMP_ALIGN
     303WriteBlockToXtideRev2:
    357304    push    ds
    358305    eSHR_IM cx, 2       ; Loop unrolling
     
    369316    ret
    370317
    371 ;----
    372 ALIGN JUMP_ALIGN
    373 WordWrite:
     318;--------------------------------------------------------------------
     319%ifndef USE_186         ; 8086/8088 compatible WORD write
     320ALIGN JUMP_ALIGN
     321WriteBlockToFastXtide:
     322    times 2 shr cx, 1   ; WORD count to QWORD count
     323    push    ds
     324    push    es
     325    pop     ds
     326ALIGN JUMP_ALIGN
     327.ReadNextQword:
     328    lodsw               ; Load 1st WORD from [DS:SI]
     329    out     dx, ax      ; Write 1st WORD
     330    lodsw
     331    out     dx, ax      ; 2nd
     332    lodsw
     333    out     dx, ax      ; 3rd
     334    lodsw
     335    out     dx, ax      ; 4th
     336    loop    .ReadNextQword
     337    pop     ds
     338    ret
     339%endif
     340
     341;--------------------------------------------------------------------
     342ALIGN JUMP_ALIGN
     343WriteBlockTo16bitDataPort:
    374344    es                  ; Source is ES segment
    375345    rep
     
    377347    ret
    378348
    379 ALIGN JUMP_ALIGN
    380 DWordWrite:
     349;--------------------------------------------------------------------
     350ALIGN JUMP_ALIGN
     351WriteBlockTo32bitDataPort:
    381352    shr     cx, 1       ; WORD count to DWORD count
    382353    es                  ; Source is ES segment
     
    387358
    388359
     360
    389361; Lookup tables to get transfer function based on bus type
    390362ALIGN WORD_ALIGN
    391363g_rgfnPioRead:
    392     dw      DualByteReadForXtide    ; DEVICE_8BIT_DUAL_PORT_XTIDE
     364    dw      ReadBlockFromXtideRev1      ; DEVICE_XTIDE_REV1
    393365%ifdef USE_186
    394     dw      WordReadForXTplusAndAT  ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
     366    dw      ReadBlockFrom16bitDataPort  ; DEVICE_XTIDE_REV2
     367    dw      ReadBlockFrom16bitDataPort  ; DEVICE_FAST_XTIDE
    395368%else
    396     dw      WordReadForXTIDEmod
    397 %endif
    398     dw      SingleByteRead          ; DEVICE_8BIT_SINGLE_PORT
    399     dw      WordReadForXTplusAndAT  ; DEVICE_16BIT_ATA
    400     dw      DWordRead               ; DEVICE_32BIT_ATA
     369    dw      ReadBlockFromXtideRev2      ; DEVICE_XTIDE_REV2
     370    dw      ReadBlockFromXtideRev2      ; DEVICE_FAST_XTIDE
     371%endif
     372    dw      ReadBlockFrom16bitDataPort  ; DEVICE_16BIT_ATA
     373    dw      ReadBlockFrom32bitDataPort  ; DEVICE_32BIT_ATA
    401374
    402375g_rgfnPioWrite:
    403     dw      DualByteWriteForXtide   ; DEVICE_8BIT_DUAL_PORT_XTIDE
    404     dw      WordWriteForXTIDEmod    ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
    405     dw      SingleByteWrite         ; DEVICE_8BIT_SINGLE_PORT
    406     dw      WordWrite               ; DEVICE_16BIT_ATA
    407     dw      DWordWrite              ; DEVICE_32BIT_ATA
     376    dw      WriteBlockToXtideRev1       ; DEVICE_XTIDE_REV1
     377    dw      WriteBlockToXtideRev2       ; DEVICE_XTIDE_REV2
     378%ifdef USE_186
     379    dw      WriteBlockTo16bitDataPort   ; DEVICE_FAST_XTIDE
     380%else
     381    dw      WriteBlockToFastXtide       ; DEVICE_FAST_XTIDE
     382%endif
     383    dw      WriteBlockTo16bitDataPort   ; DEVICE_16BIT_ATA
     384    dw      WriteBlockTo32bitDataPort   ; DEVICE_32BIT_ATA
Note: See TracChangeset for help on using the changeset viewer.