pci-ide: Added function to set default PIF byte. (nw)

This commit is contained in:
Ted Green 2017-05-17 09:49:54 -06:00
parent 8cb689e7ac
commit 0626b116ee
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -33,6 +33,10 @@ TODO:
#define MCFG_IDE_PCI_SET_LEGACY_TOP(_val) \
downcast<ide_pci_device *>(device)->set_legacy_top(_val);
// Sets the default Programming Interface (PIF) register
#define MCFG_IDE_PCI_SET_PIF(_val) \
downcast<ide_pci_device *>(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 <class Object> static devcb_base &set_irq_handler(device_t &device, Object &&cb) { return downcast<ide_pci_device &>(device).m_irq_handler.set_callback(std::forward<Object>(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);