From 72a5561b899d4153b712ac79dc6e99d46e0310b8 Mon Sep 17 00:00:00 2001 From: Ted Green Date: Sun, 11 Jun 2017 06:52:05 -0600 Subject: [PATCH] pci-ide: Added writing to subsystem id register. Fixes power-on PCI Data Test in nbagold. (nw) --- src/devices/machine/pci-ide.cpp | 8 ++++++++ src/devices/machine/pci-ide.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp index b88049a7258..216f67ac5fa 100644 --- a/src/devices/machine/pci-ide.cpp +++ b/src/devices/machine/pci-ide.cpp @@ -19,6 +19,7 @@ ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, d DEVICE_ADDRESS_MAP_START(config_map, 32, ide_pci_device) AM_RANGE(0x08, 0x0b) AM_WRITE8(prog_if_w, 0x0000ff00) AM_RANGE(0x10, 0x1f) AM_READWRITE(address_base_r, address_base_w) + AM_RANGE(0x2c, 0x2f) AM_WRITE(subsystem_id_w); AM_RANGE(0x40, 0x5f) AM_READWRITE(pcictrl_r, pcictrl_w) AM_RANGE(0x70, 0x77) AM_DEVREADWRITE("ide", bus_master_ide_controller_device, bmdma_r, bmdma_w) // PCI646 AM_RANGE(0x78, 0x7f) AM_DEVREADWRITE("ide2", bus_master_ide_controller_device, bmdma_r, bmdma_w) // PCI646 @@ -242,3 +243,10 @@ WRITE32_MEMBER(ide_pci_device::address_base_w) } logerror("Mapping bar[%i] = %08x\n", offset, data); } + +WRITE32_MEMBER(ide_pci_device::subsystem_id_w) +{ + // Config register 0x4f enables subsystem id writing for CMD646 + if (m_config_data[0xc / 4] & 0x01000000) + subsystem_id = (data << 16) | (data >> 16); +} diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h index 1171cc761d9..58d6c3bd8db 100644 --- a/src/devices/machine/pci-ide.h +++ b/src/devices/machine/pci-ide.h @@ -66,6 +66,7 @@ private: DECLARE_WRITE32_MEMBER(pcictrl_w); DECLARE_READ32_MEMBER(address_base_r); DECLARE_WRITE32_MEMBER(address_base_w); + DECLARE_WRITE32_MEMBER(subsystem_id_w); const char *m_cpu_tag; cpu_device *m_cpu;