Uncommended the NCR 53c825A and added the NCR 53c860.

This commit is contained in:
OBattler
2020-03-23 09:06:27 +01:00
parent 04193fb199
commit a115be099a
3 changed files with 54 additions and 17 deletions

View File

@@ -74,7 +74,8 @@ static SCSI_CARD scsi_cards[] = {
{ "[MCA] BusLogic BT-640A", "bt640a", &buslogic_640a_device, }, { "[MCA] BusLogic BT-640A", "bt640a", &buslogic_640a_device, },
{ "[PCI] BusLogic BT-958D", "bt958d", &buslogic_pci_device, }, { "[PCI] BusLogic BT-958D", "bt958d", &buslogic_pci_device, },
{ "[PCI] NCR 53C810", "ncr53c810", &ncr53c810_pci_device, }, { "[PCI] NCR 53C810", "ncr53c810", &ncr53c810_pci_device, },
//{ "[PCI] NCR 53C825A", "ncr53c825a", &ncr53c825a_pci_device, }, { "[PCI] NCR 53C825A", "ncr53c825a", &ncr53c825a_pci_device, },
{ "[PCI] NCR 53C860", "ncr53c860", &ncr53c860_pci_device, },
{ "[PCI] NCR 53C875", "ncr53c875", &ncr53c875_pci_device, }, { "[PCI] NCR 53C875", "ncr53c875", &ncr53c875_pci_device, },
{ "[VLB] BusLogic BT-445S", "bt445s", &buslogic_445s_device, }, { "[VLB] BusLogic BT-445S", "bt445s", &buslogic_445s_device, },
{ "", "", NULL, }, { "", "", NULL, },

View File

@@ -49,8 +49,11 @@
#define NCR53C8XX_ROM L"roms/scsi/ncr53c8xx/NCR307.BIN" #define NCR53C8XX_ROM L"roms/scsi/ncr53c8xx/NCR307.BIN"
#define HA_ID 7
#define CHIP_810 0x01 #define CHIP_810 0x01
#define CHIP_825 0x03 #define CHIP_825 0x03
#define CHIP_860 0x06
#define CHIP_875 0x0f #define CHIP_875 0x0f
#define NCR_SCNTL0_TRG 0x01 #define NCR_SCNTL0_TRG 0x01
@@ -302,6 +305,10 @@ typedef struct {
uint32_t adder; uint32_t adder;
pc_timer_t timer; pc_timer_t timer;
#ifdef USE_WDTR
uint8_t tr_set[16];
#endif
} ncr53c8xx_t; } ncr53c8xx_t;
@@ -401,7 +408,7 @@ ncr53c8xx_soft_reset(ncr53c8xx_t *dev)
dev->scntl3 = 0; dev->scntl3 = 0;
dev->sstat0 = 0; dev->sstat0 = 0;
dev->sstat1 = 0; dev->sstat1 = 0;
dev->scid = 7; dev->scid = HA_ID;
dev->sxfer = 0; dev->sxfer = 0;
dev->socl = 0; dev->socl = 0;
dev->sdid = 0; dev->sdid = 0;
@@ -428,13 +435,21 @@ ncr53c8xx_soft_reset(ncr53c8xx_t *dev)
if (dev->chip >= CHIP_825) { if (dev->chip >= CHIP_825) {
/* This *IS* a wide SCSI controller, so reset all SCSI /* This *IS* a wide SCSI controller, so reset all SCSI
devices. */ devices. */
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++) {
#ifdef USE_WDTR
dev->tr_set[i] = 0;
#endif
scsi_device_reset(&scsi_devices[i]); scsi_device_reset(&scsi_devices[i]);
}
} else { } else {
/* This is *NOT* a wide SCSI controller, so do not touch /* This is *NOT* a wide SCSI controller, so do not touch
SCSI devices with ID's >= 8. */ SCSI devices with ID's >= 8. */
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++) {
#ifdef USE_WDTR
dev->tr_set[i] = 0;
#Endif
scsi_device_reset(&scsi_devices[i]); scsi_device_reset(&scsi_devices[i]);
}
} }
} }
@@ -802,9 +817,9 @@ ncr53c8xx_do_wdtr(ncr53c8xx_t *dev, int exponent)
ncr53c8xx_log("Target-initiated WDTR (%08X)\n", dev); ncr53c8xx_log("Target-initiated WDTR (%08X)\n", dev);
ncr53c8xx_set_phase(dev, PHASE_MI); ncr53c8xx_set_phase(dev, PHASE_MI);
dev->msg_action = 4; dev->msg_action = 4;
ncr53c8xx_add_msg_byte(dev, 0x01); /* EXTENDED MESSAGE */ ncr53c8xx_add_msg_byte(dev, 0x01); /* EXTENDED MESSAGE */
ncr53c8xx_add_msg_byte(dev, 0x02); /* EXTENDED MESSAGE LENGTH */ ncr53c8xx_add_msg_byte(dev, 0x02); /* EXTENDED MESSAGE LENGTH */
ncr53c8xx_add_msg_byte(dev, 0x03); /* WIDE DATA TRANSFER REQUEST */ ncr53c8xx_add_msg_byte(dev, 0x03); /* WIDE DATA TRANSFER REQUEST */
ncr53c8xx_add_msg_byte(dev, exponent); /* TRANSFER WIDTH EXPONENT (16-bit) */ ncr53c8xx_add_msg_byte(dev, exponent); /* TRANSFER WIDTH EXPONENT (16-bit) */
} }
#endif #endif
@@ -925,13 +940,14 @@ ncr53c8xx_do_msgout(ncr53c8xx_t *dev, uint8_t id)
break; break;
case 3: case 3:
ncr53c8xx_log("WDTR (ignored)\n"); ncr53c8xx_log("WDTR (ignored)\n");
#ifdef USE_WDTR
dev->tr_set[dev->sdid] = 1;
#endif
if (arg > 0x01) { if (arg > 0x01) {
ncr53c8xx_bad_message(dev, msg); ncr53c8xx_bad_message(dev, msg);
return; return;
} }
#ifdef USE_WDTR
ncr53c8xx_set_phase(dev, PHASE_CMD); ncr53c8xx_set_phase(dev, PHASE_CMD);
#endif
break; break;
case 5: case 5:
ncr53c8xx_log("PPR (ignored)\n"); ncr53c8xx_log("PPR (ignored)\n");
@@ -960,9 +976,14 @@ ncr53c8xx_do_msgout(ncr53c8xx_t *dev, uint8_t id)
scsi_device_command_stop(sd); scsi_device_command_stop(sd);
ncr53c8xx_disconnect(dev); ncr53c8xx_disconnect(dev);
break; break;
case 0x0c:
/* BUS DEVICE RESET message, reset wide transfer request. */
#ifdef USE_WDTR
dev->tr_set[dev->sdid] = 0;
#endif
/* FALLTHROUGH */
case 0x06: case 0x06:
case 0x0e: case 0x0e:
case 0x0c:
/* clear the current I/O process */ /* clear the current I/O process */
scsi_device_command_stop(sd); scsi_device_command_stop(sd);
ncr53c8xx_disconnect(dev); ncr53c8xx_disconnect(dev);
@@ -977,10 +998,11 @@ ncr53c8xx_do_msgout(ncr53c8xx_t *dev, uint8_t id)
dev->current_lun = msg & 7; dev->current_lun = msg & 7;
ncr53c8xx_log("Select LUN %d\n", dev->current_lun); ncr53c8xx_log("Select LUN %d\n", dev->current_lun);
#ifdef USE_WDTR #ifdef USE_WDTR
ncr53c8xx_do_wdtr(dev, 0x01); if ((dev->chip == CHIP_875) && !dev->tr_set[dev->sdid])
#else ncr53c8xx_do_wdtr(dev, 0x01);
ncr53c8xx_set_phase(dev, PHASE_CMD); else
#endif #endif
ncr53c8xx_set_phase(dev, PHASE_CMD);
} }
break; break;
} }
@@ -2625,6 +2647,7 @@ ncr53c8xx_init(const device_t *info)
ncr53c8xx_pci_bar[0].addr_regs[0] = 1; ncr53c8xx_pci_bar[0].addr_regs[0] = 1;
ncr53c8xx_pci_bar[1].addr_regs[0] = 0; ncr53c8xx_pci_bar[1].addr_regs[0] = 0;
dev->chip = info->local; dev->chip = info->local;
ncr53c8xx_pci_regs[0x04] = 3; ncr53c8xx_pci_regs[0x04] = 3;
ncr53c8xx_mem_init(dev, 0x0fffff00); ncr53c8xx_mem_init(dev, 0x0fffff00);
@@ -2632,12 +2655,14 @@ ncr53c8xx_init(const device_t *info)
dev->has_bios = device_get_config_int("bios"); dev->has_bios = device_get_config_int("bios");
if (dev->has_bios) if (dev->has_bios)
rom_init(&dev->bios, NCR53C8XX_ROM, 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); rom_init(&dev->bios, NCR53C8XX_ROM, 0xc8000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
if (dev->chip >= CHIP_825) { if (dev->chip >= CHIP_825) {
if (dev->chip == CHIP_875) { if (dev->chip == CHIP_875) {
dev->chip_rev = 0x04; dev->chip_rev = 0x04;
dev->nvr_path = L"ncr53c875.nvr"; dev->nvr_path = L"ncr53c875.nvr";
} else if (dev->chip == CHIP_860) {
dev->chip_rev = 0x04;
dev->nvr_path = L"ncr53c860.nvr";
} else { } else {
dev->chip_rev = 0x26; dev->chip_rev = 0x26;
dev->nvr_path = L"ncr53c825a.nvr"; dev->nvr_path = L"ncr53c825a.nvr";
@@ -2654,8 +2679,8 @@ ncr53c8xx_init(const device_t *info)
ncr53c8xx_bios_disable(dev); ncr53c8xx_bios_disable(dev);
#endif #endif
} else { } else {
if (dev->has_bios) /* if (dev->has_bios)
rom_init(&dev->bios, NCR53C8XX_ROM, 0xc8000, 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL); rom_init(&dev->bios, NCR53C8XX_ROM, 0xc8000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); */
dev->nvr_path = L"ncr53c810.nvr"; dev->nvr_path = L"ncr53c810.nvr";
} }
@@ -2715,6 +2740,16 @@ const device_t ncr53c825a_pci_device =
ncr53c8xx_pci_config ncr53c8xx_pci_config
}; };
const device_t ncr53c860_pci_device =
{
"NCR 53c860 (SCSI)",
DEVICE_PCI,
CHIP_860,
ncr53c8xx_init, ncr53c8xx_close, NULL,
NULL, NULL, NULL,
ncr53c8xx_pci_config
};
const device_t ncr53c875_pci_device = const device_t ncr53c875_pci_device =
{ {
"NCR 53c875 (SCSI)", "NCR 53c875 (SCSI)",

View File

@@ -27,6 +27,7 @@
extern const device_t ncr53c810_pci_device; extern const device_t ncr53c810_pci_device;
extern const device_t ncr53c825a_pci_device; extern const device_t ncr53c825a_pci_device;
extern const device_t ncr53c860_pci_device;
extern const device_t ncr53c875_pci_device; extern const device_t ncr53c875_pci_device;