From 0626b116ee7b1d2eaff453cf9665ddc62e898623 Mon Sep 17 00:00:00 2001 From: Ted Green Date: Wed, 17 May 2017 09:49:54 -0600 Subject: pci-ide: Added function to set default PIF byte. (nw) --- src/devices/machine/pci-ide.cpp | 5 +++-- src/devices/machine/pci-ide.h | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/pci-ide.cpp b/src/devices/machine/pci-ide.cpp index bac97798949..98ec5180b46 100644 --- a/src/devices/machine/pci-ide.cpp +++ b/src/devices/machine/pci-ide.cpp @@ -11,7 +11,8 @@ ide_pci_device::ide_pci_device(const machine_config &mconfig, const char *tag, d m_ide2(*this, "ide2"), m_irq_num(-1), m_irq_handler(*this), - m_legacy_top(0x000) + m_legacy_top(0x000), + m_pif(0x8a) { } @@ -106,7 +107,7 @@ void ide_pci_device::device_reset() bank_infos[2].adr = (m_legacy_top << 20) | 0x170; bank_infos[3].adr = (m_legacy_top << 20) | 0x374; bank_infos[4].adr = 0xf00; - pclass = 0x01018a; + pclass = 0x010100 | m_pif; remap_cb(); // PCI0646U allow BAR diff --git a/src/devices/machine/pci-ide.h b/src/devices/machine/pci-ide.h index d9200898b4e..f3849fb1515 100644 --- a/src/devices/machine/pci-ide.h +++ b/src/devices/machine/pci-ide.h @@ -33,6 +33,10 @@ TODO: #define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \ downcast(device)->set_legacy_top(_val); +// Sets the default Programming Interface (PIF) register +#define MCFG_IDE_PCI_SET_PIF(_val) \ + downcast(device)->set_pif(_val); + class ide_pci_device : public pci_device { public: ide_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); @@ -47,6 +51,7 @@ public: void set_irq_info(const char *tag, const int irq_num); template static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast(device).m_irq_handler.set_callback(std::forward(cb)); } void set_legacy_top(int val) { m_legacy_top = val & 0xfff; }; + void set_pif(int val) { m_pif = val & 0xff; }; protected: virtual void device_start() override; @@ -63,6 +68,7 @@ private: uint32_t pci_bar[6]; // Bits 31-20 for legacy mode hack uint32_t m_legacy_top; + uint32_t m_pif; uint32_t m_config_data[0x10]; DECLARE_ADDRESS_MAP(chan1_data_command_map, 32); -- cgit v1.2.3