From 2d99f36ed4d71e246748e40553be4ae7d9c48397 Mon Sep 17 00:00:00 2001 From: Matt Harlum Date: Wed, 1 Mar 2023 08:25:11 +0000 Subject: [PATCH] Change detection code to find AT-Bus/Oktagon device --- include/hardware/ata_apollo.i | 52 ++++++++++++++++----------------- source/AT-Apollo.device_v5.03.s | 19 ++++++------ 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/include/hardware/ata_apollo.i b/include/hardware/ata_apollo.i index e4eab11..b5b310a 100644 --- a/include/hardware/ata_apollo.i +++ b/include/hardware/ata_apollo.i @@ -1,32 +1,32 @@ -**** ATA registers of 3-State AT-Apollo 2000: +**** ATA registers of ATBus -ata_DataPort = $0000 -ata_Error = $0401 -ata_Features = $0401 -ata_SectorCnt = $0801 -ata_SectorNum = $0C01 -ata_CylinderL = $1001 -ata_CylinderH = $1401 -ata_DevHead = $1801 -ata_Status = $1C01 -ata_Command = $1C01 -ata_AltStatus = $3801 -ata_DevCtrl = $3801 +ata_DataPort = $1000 +ata_Error = $0200 +ata_Features = $0200 +ata_SectorCnt = $0400 +ata_SectorNum = $0600 +ata_CylinderL = $0800 +ata_CylinderH = $0A00 +ata_DevHead = $0C00 +ata_Status = $0E00 +ata_Command = $0E00 +ata_AltStatus = $1C00 +ata_DevCtrl = $1C00 ata_NextPort = $2000 -ata_NextReg = $0400 +ata_NextReg = $0200 **** ATAPI registers: -atapi_DataPort = $0000 -atapi_Error = $0401 -atapi_Features = $0401 -atapi_Reason = $0801 -atapi_SamTag = $0C01 -atapi_ByteCntL = $1001 -atapi_ByteCntH = $1401 -atapi_DriveSel = $1801 -atapi_Status = $1C01 -atapi_Command = $1C01 -atapi_AltStatus = $3801 -atapi_DevCtrl = $3801 +atapi_DataPort = $1000 +atapi_Error = $0200 +atapi_Features = $0200 +atapi_Reason = $0400 +atapi_SamTag = $0600 +atapi_ByteCntL = $0800 +atapi_ByteCntH = $0A00 +atapi_DriveSel = $0C00 +atapi_Status = $0E00 +atapi_Command = $0E00 +atapi_AltStatus = $1C00 +atapi_DevCtrl = $1C00 diff --git a/source/AT-Apollo.device_v5.03.s b/source/AT-Apollo.device_v5.03.s index 80eaec3..ef39fa1 100644 --- a/source/AT-Apollo.device_v5.03.s +++ b/source/AT-Apollo.device_v5.03.s @@ -13,7 +13,7 @@ ;>log main ram:scsi.log ;>log -CPU020 SET 1 +;CPU020 SET 1 ;DEBUG SET 1 ;SERDBG SET 1 ;PROTECT SET 1 @@ -52,9 +52,9 @@ PVDBG = 0 ;--------------- BLOCK_SIZE = 512 ;Block/sector size (in bytes) -CONST_NUM = $2222 ;Manufacturer : 3-States / ACT -PRODUCT_COMBI = $22 ;AT + SCSI + memory card -PRODUCT_ATA = $33 ;AT only controller card +CONST_NUM = $082C ;Manufacturer : BSC +PRODUCT_COMBI = $22 ;AT + SCSI + memory card (not used here) +PRODUCT_ATA = $6 ;AT-Bus IDE card ATA_TimeOut = 500000 ATAPI_TimeOut = 1000000 @@ -339,11 +339,11 @@ InitRoutine bne.b .Loop ;No, next card .FoundProd - move.l cd_Unused(a0),d0 ;D0 : Special identifier - cmpi.l #'APOL',d0 ;Apollo controller ON ? - beq.b .FoundCtrl ;Yes, continue - cmpi.l #'APOX',d0 ;Apollo controller OFF ? - bne.b .Loop ;No, next card +; move.l cd_Unused(a0),d0 ;D0 : Special identifier +; cmpi.l #'APOL',d0 ;Apollo controller ON ? +; beq.b .FoundCtrl ;Yes, continue +; cmpi.l #'APOX',d0 ;Apollo controller OFF ? +; bne.b .Loop ;No, next card .FoundCtrl move.l #113,cd_Unused+4(a0) @@ -351,6 +351,7 @@ InitRoutine move.l a1,LN_NAME(a0) ;"ConfigDev" structure name move.l a5,cd_Driver(a0) ;Device address move.l cd_BoardAddr(a0),a1 ;A1 : First IDE port address + add.l #ata_DataPort,a1 ;*************** Primary connector auto-detect ********************************