mirror of
https://github.com/holub/mame
synced 2025-07-01 00:09:18 +03:00
xbox.cpp: rename pci device mcpx_lpc to mcpx_isalpc (nw)
Also add mc1885ext device as rtc.
This commit is contained in:
parent
ab7af50b13
commit
0e86bb1de3
@ -33,7 +33,7 @@ class xbox_state : public xbox_base_state
|
||||
public:
|
||||
xbox_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: xbox_base_state(mconfig, type, tag)
|
||||
, m_ide(*this, "ide")
|
||||
, m_ide(*this, "pci:09.0:ide")
|
||||
, m_devh(*this, "pci:09.0:ide:0:hdd")
|
||||
, m_devc(*this, "pci:09.0:ide:1:cdrom")
|
||||
{ }
|
||||
|
@ -84,6 +84,8 @@ public:
|
||||
debug_irq_active(false),
|
||||
debug_irq_number(0),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
mcpxlpc(*this, ":pci:01.0"),
|
||||
ide(*this, ":pci:09.0:ide"),
|
||||
debugc_bios(nullptr) { }
|
||||
|
||||
void xbox_base(machine_config &config);
|
||||
@ -115,8 +117,6 @@ protected:
|
||||
DECLARE_WRITE_LINE_MEMBER(nv2a_interrupt_changed);
|
||||
IRQ_CALLBACK_MEMBER(irq_callback);
|
||||
|
||||
mcpx_lpc_device *mcpxlpc;
|
||||
bus_master_ide_controller_device *ide;
|
||||
struct superio_state
|
||||
{
|
||||
bool configuration_mode;
|
||||
@ -128,6 +128,8 @@ protected:
|
||||
bool debug_irq_active;
|
||||
int debug_irq_number;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<mcpx_isalpc_device> mcpxlpc;
|
||||
required_device<bus_master_ide_controller_device> ide;
|
||||
static const struct debugger_constants
|
||||
{
|
||||
uint32_t id;
|
||||
|
@ -58,9 +58,9 @@ DECLARE_DEVICE_TYPE(NV2A_RAM, nv2a_ram_device)
|
||||
* LPC Bus
|
||||
*/
|
||||
|
||||
class mcpx_lpc_device : public pci_device {
|
||||
class mcpx_isalpc_device : public pci_device {
|
||||
public:
|
||||
mcpx_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
mcpx_isalpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto interrupt_output() { return m_interrupt_output.bind(); }
|
||||
|
||||
@ -98,7 +98,7 @@ private:
|
||||
required_device<pit8254_device> pit8254;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(MCPX_LPC, mcpx_lpc_device)
|
||||
DECLARE_DEVICE_TYPE(MCPX_ISALPC, mcpx_isalpc_device)
|
||||
|
||||
/*
|
||||
* SMBus
|
||||
|
@ -782,8 +782,6 @@ void xbox_base_state::machine_start()
|
||||
{
|
||||
find_debug_params();
|
||||
nvidia_nv2a = subdevice<nv2a_gpu_device>("pci:1e.0:00.0")->debug_get_renderer();
|
||||
mcpxlpc = subdevice<mcpx_lpc_device>(":pci:01.0");
|
||||
ide = subdevice<bus_master_ide_controller_device>("ide");
|
||||
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
|
||||
{
|
||||
using namespace std::placeholders;
|
||||
@ -852,7 +850,7 @@ MACHINE_CONFIG_START(xbox_base_state::xbox_base)
|
||||
PCI_ROOT(config, ":pci", 0);
|
||||
NV2A_HOST(config, ":pci:00.0", 0, m_maincpu);
|
||||
NV2A_RAM(config, ":pci:00.3", 0);
|
||||
MCPX_LPC(config, ":pci:01.0", 0).interrupt_output().set(FUNC(xbox_base_state::maincpu_interrupt));
|
||||
MCPX_ISALPC(config, ":pci:01.0", 0).interrupt_output().set(FUNC(xbox_base_state::maincpu_interrupt));
|
||||
MCPX_SMBUS(config, ":pci:01.1", 0).interrupt_handler().set(FUNC(xbox_base_state::smbus_interrupt_changed));
|
||||
XBOX_PIC16LC(config, ":pci:01.1:10", 0);
|
||||
XBOX_CX25871(config, ":pci:01.1:45", 0);
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "machine/pci.h"
|
||||
#include "includes/xbox_pci.h"
|
||||
#include "includes/xbox.h"
|
||||
#include "machine/ds128x.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
@ -81,28 +82,29 @@ WRITE32_MEMBER(nv2a_ram_device::config_register_w)
|
||||
* LPC Bus
|
||||
*/
|
||||
|
||||
DEFINE_DEVICE_TYPE(MCPX_LPC, mcpx_lpc_device, "mcpx_lpc", "MCPX HUB Interface - ISA Bridge")
|
||||
DEFINE_DEVICE_TYPE(MCPX_ISALPC, mcpx_isalpc_device, "mcpx_isalpc", "MCPX HUB Interface - ISA Bridge")
|
||||
|
||||
void mcpx_lpc_device::lpc_io(address_map &map)
|
||||
void mcpx_isalpc_device::lpc_io(address_map &map)
|
||||
{
|
||||
map(0x00000000, 0x000000ff).rw(FUNC(mcpx_lpc_device::lpc_r), FUNC(mcpx_lpc_device::lpc_w));
|
||||
map(0x00000000, 0x000000ff).rw(FUNC(mcpx_isalpc_device::lpc_r), FUNC(mcpx_isalpc_device::lpc_w));
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::internal_io_map(address_map &map)
|
||||
void mcpx_isalpc_device::internal_io_map(address_map &map)
|
||||
{
|
||||
map(0x0020, 0x0023).rw("pic8259_1", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
|
||||
map(0x0040, 0x0043).rw("pit8254", FUNC(pit8254_device::read), FUNC(pit8254_device::write));
|
||||
map(0x0070, 0x0073).rw("rtc", FUNC(ds12885ext_device::read), FUNC(ds12885ext_device::write));
|
||||
map(0x00a0, 0x00a3).rw("pic8259_2", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
|
||||
void mcpx_isalpc_device::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)
|
||||
{
|
||||
io_space->install_device(0, 0xffff, *this, &mcpx_lpc_device::internal_io_map);
|
||||
io_space->install_device(0, 0xffff, *this, &mcpx_isalpc_device::internal_io_map);
|
||||
}
|
||||
|
||||
mcpx_lpc_device::mcpx_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: pci_device(mconfig, MCPX_LPC, tag, owner, clock),
|
||||
mcpx_isalpc_device::mcpx_isalpc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: pci_device(mconfig, MCPX_ISALPC, tag, owner, clock),
|
||||
m_interrupt_output(*this),
|
||||
pic8259_1(*this, "pic8259_1"),
|
||||
pic8259_2(*this, "pic8259_2"),
|
||||
@ -111,107 +113,109 @@ mcpx_lpc_device::mcpx_lpc_device(const machine_config &mconfig, const char *tag,
|
||||
set_ids(0x10de01b2, 0xb4, 0, 0); // revision id must be at least 0xb4, otherwise usb will require a hub
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::device_start()
|
||||
void mcpx_isalpc_device::device_start()
|
||||
{
|
||||
pci_device::device_start();
|
||||
m_interrupt_output.resolve_safe();
|
||||
add_map(0x00000100, M_IO, FUNC(mcpx_lpc_device::lpc_io));
|
||||
add_map(0x00000100, M_IO, FUNC(mcpx_isalpc_device::lpc_io));
|
||||
bank_infos[0].adr = 0x8000;
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::device_reset()
|
||||
void mcpx_isalpc_device::device_reset()
|
||||
{
|
||||
pci_device::device_reset();
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::device_add_mconfig(machine_config &config)
|
||||
void mcpx_isalpc_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
pic8259_device &pic8259_1(PIC8259(config, "pic8259_1", 0));
|
||||
pic8259_1.out_int_callback().set(FUNC(mcpx_lpc_device::interrupt_ouptut_changed));
|
||||
pic8259_1.out_int_callback().set(FUNC(mcpx_isalpc_device::interrupt_ouptut_changed));
|
||||
pic8259_1.in_sp_callback().set_constant(1);
|
||||
pic8259_1.read_slave_ack_callback().set(FUNC(mcpx_lpc_device::get_slave_ack));
|
||||
pic8259_1.read_slave_ack_callback().set(FUNC(mcpx_isalpc_device::get_slave_ack));
|
||||
|
||||
pic8259_device &pic8259_2(PIC8259(config, "pic8259_2", 0));
|
||||
pic8259_2.out_int_callback().set("pic8259_1", FUNC(pic8259_device::ir2_w));
|
||||
pic8259_2.out_int_callback().set(pic8259_1, FUNC(pic8259_device::ir2_w));
|
||||
pic8259_2.in_sp_callback().set_constant(0);
|
||||
|
||||
pit8254_device &pit8254(PIT8254(config, "pit8254", 0));
|
||||
pit8254.set_clk<0>(1125000); /* heartbeat IRQ */
|
||||
pit8254.out_handler<0>().set(FUNC(mcpx_lpc_device::pit8254_out0_changed));
|
||||
pit8254.out_handler<0>().set(FUNC(mcpx_isalpc_device::pit8254_out0_changed));
|
||||
pit8254.set_clk<1>(1125000); /* (unused) dram refresh */
|
||||
pit8254.set_clk<2>(1125000); /* (unused) pio port c pin 4, and speaker polling enough */
|
||||
pit8254.out_handler<2>().set(FUNC(mcpx_lpc_device::pit8254_out2_changed));
|
||||
pit8254.out_handler<2>().set(FUNC(mcpx_isalpc_device::pit8254_out2_changed));
|
||||
|
||||
ds12885ext_device &ds12885(DS12885EXT(config, "rtc", 0));
|
||||
ds12885.irq().set(pic8259_2, FUNC(pic8259_device::ir0_w));
|
||||
|
||||
/*
|
||||
More devices are needed:
|
||||
82093 compatible I/O APIC
|
||||
dual 8237 DMA controllers
|
||||
MC146818A/DS12887 compatible RTC with 256byte battery backed-up RAM
|
||||
*/
|
||||
}
|
||||
|
||||
READ32_MEMBER(mcpx_lpc_device::lpc_r)
|
||||
READ32_MEMBER(mcpx_isalpc_device::lpc_r)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(mcpx_lpc_device::lpc_w)
|
||||
WRITE32_MEMBER(mcpx_isalpc_device::lpc_w)
|
||||
{
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::interrupt_ouptut_changed)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::interrupt_ouptut_changed)
|
||||
{
|
||||
m_interrupt_output(state);
|
||||
}
|
||||
|
||||
READ8_MEMBER(mcpx_lpc_device::get_slave_ack)
|
||||
READ8_MEMBER(mcpx_isalpc_device::get_slave_ack)
|
||||
{
|
||||
if (offset == 2) // IRQ = 2
|
||||
return pic8259_2->acknowledge();
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::pit8254_out0_changed)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::pit8254_out0_changed)
|
||||
{
|
||||
pic8259_1->ir0_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::pit8254_out2_changed)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::pit8254_out2_changed)
|
||||
{
|
||||
//xbox_speaker_set_input( state ? 1 : 0 );
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::irq1)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::irq1)
|
||||
{
|
||||
pic8259_1->ir1_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::irq3)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::irq3)
|
||||
{
|
||||
pic8259_1->ir3_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::irq10)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::irq10)
|
||||
{
|
||||
pic8259_2->ir2_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::irq11)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::irq11)
|
||||
{
|
||||
pic8259_2->ir3_w(state);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(mcpx_lpc_device::irq14)
|
||||
WRITE_LINE_MEMBER(mcpx_isalpc_device::irq14)
|
||||
{
|
||||
pic8259_2->ir6_w(state);
|
||||
}
|
||||
|
||||
uint32_t mcpx_lpc_device::acknowledge()
|
||||
uint32_t mcpx_isalpc_device::acknowledge()
|
||||
{
|
||||
return pic8259_1->acknowledge();
|
||||
}
|
||||
|
||||
void mcpx_lpc_device::debug_generate_irq(int irq, int state)
|
||||
void mcpx_isalpc_device::debug_generate_irq(int irq, int state)
|
||||
{
|
||||
switch (irq)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user