bus/pci: add stub for AHA2940AU [Guru]

This commit is contained in:
angelosa 2024-01-20 19:21:02 +01:00
parent 43e005905d
commit 6e7c44a696
4 changed files with 135 additions and 0 deletions

View File

@ -5420,6 +5420,8 @@ if (BUSES["PCI"]~=null) then
files {
MAME_DIR .. "src/devices/bus/pci/pci_slot.cpp",
MAME_DIR .. "src/devices/bus/pci/pci_slot.h",
MAME_DIR .. "src/devices/bus/pci/aha2940au.cpp",
MAME_DIR .. "src/devices/bus/pci/aha2940au.h",
MAME_DIR .. "src/devices/bus/pci/ds2416.cpp",
MAME_DIR .. "src/devices/bus/pci/ds2416.h",
MAME_DIR .. "src/devices/bus/pci/geforce.cpp",

View File

@ -0,0 +1,90 @@
// license:BSD-3-Clause
// copyright-holders:
/**************************************************************************************************
Adaptec AHA-2940AU PCI
Based off AIC-7860/7861
TODO:
- Plays with southbridge SMI & APMCAPMS regs soon after entering in its own BIOS (PC=ccfe1),
going off the track blanking the almost entirety of I/O space range.
**************************************************************************************************/
#include "emu.h"
#include "aha2940au.h"
#define LOG_WARN (1U << 1)
#define VERBOSE (LOG_GENERAL | LOG_WARN)
//#define LOG_OUTPUT_FUNC osd_printf_info
#include "logmacro.h"
#define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__)
DEFINE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device, "aha2940au", "Adaptec AHA-2940AU PCI SCSI controller card")
aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: pci_card_device(mconfig, type, tag, owner, clock)
, m_scsi_rom(*this, "scsi_rom")
{
// TODO: unknown revision & class code
set_ids(0x90046178, 0x00, 0x010700, 0x90046178);
}
aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: aha2940au_scsi_device(mconfig, AHA2940AU, tag, owner, clock)
{
}
ROM_START( aha2940au )
ROM_REGION32_LE( 0x8000, "scsi_rom", ROMREGION_ERASEFF )
ROM_SYSTEM_BIOS( 0, "v1.30", "AHA-2940AU (v1.30)" )
// "589247-00_c_bios_2400_(C)1996_v1.30.u3"
ROMX_LOAD( "589247-00.u3", 0x0000, 0x8000, CRC(de00492b) SHA1(a6015bcd51e51015a5710d7ac1929e28bf033db4), ROM_BIOS(0) )
ROM_END
const tiny_rom_entry *aha2940au_scsi_device::device_rom_region() const
{
return ROM_NAME(aha2940au);
}
void aha2940au_scsi_device::device_add_mconfig(machine_config &config)
{
// TODO: AIC-7860Q
}
void aha2940au_scsi_device::device_start()
{
pci_card_device::device_start();
// TODO: unknown BAR setup
// add_map( size, M_MEM, FUNC(aha2940au_scsi_device::map));
add_rom((u8 *)m_scsi_rom->base(), 0x8000);
expansion_rom_base = 0xc8000;
// TODO: unknown irq pin
// intr_pin = 1;
}
void aha2940au_scsi_device::device_reset()
{
pci_card_device::device_reset();
// TODO: unknown startup state
command = 0x0000;
status = 0x0200;
remap_cb();
}
void aha2940au_scsi_device::config_map(address_map &map)
{
pci_card_device::config_map(map);
// ...
}

View File

@ -0,0 +1,40 @@
// license:BSD-3-Clause
// copyright-holders:
#ifndef MAME_BUS_PCI_AHA2940AU_H
#define MAME_BUS_PCI_AHA2940AU_H
#pragma once
#include "pci_slot.h"
class aha2940au_scsi_device : public pci_card_device
{
public:
aha2940au_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
static constexpr feature_type unemulated_features() { return feature::MEDIA; }
protected:
aha2940au_scsi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
virtual void device_start() override;
virtual void device_reset() override;
virtual void device_add_mconfig(machine_config &config) override;
virtual const tiny_rom_entry *device_rom_region() const override;
// virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
// uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
virtual void config_map(address_map &map) override;
required_memory_region m_scsi_rom;
private:
// ...
};
DECLARE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device)
#endif // MAME_BUS_PCI_AHA2940AU_H

View File

@ -6,6 +6,7 @@
#include "emu.h"
#include "pci_slot.h"
#include "aha2940au.h"
#include "ds2416.h"
#include "geforce.h"
#include "mga2064w.h"
@ -98,6 +99,8 @@ void pci_card_device::irq_pin_w(offs_t line, int state)
void pci_cards(device_slot_interface &device)
{
// 0x01 - mass storage controllers
device.option_add("aha2940au", AHA2940AU);
// 0x02 - network controllers
device.option_add("rtl8029as", RTL8029AS_PCI);
device.option_add("rtl8139", RTL8139_PCI);