trunk/src/emu/machine/i6300esb.c
| r242042 | r242043 | |
| 86 | 86 | |
| 87 | 87 | i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 88 | 88 | : pci_device(mconfig, I6300ESB_LPC, "i6300ESB southbridge ISA/LPC bridge", tag, owner, clock, "i6300esb_lpc", __FILE__), |
| 89 | | acpi(*this, "acpi") |
| 89 | acpi(*this, "acpi"), |
| 90 | rtc (*this, "rtc") |
| 90 | 91 | { |
| 91 | 92 | } |
| 92 | 93 | |
| r242042 | r242043 | |
| 104 | 105 | d31_err_cfg = 0x00; |
| 105 | 106 | d31_err_sts = 0x00; |
| 106 | 107 | pci_dma_cfg = 0x0000; |
| 107 | | rtc_conf = 0x00; |
| 108 | 108 | func_dis = 0x0080; |
| 109 | 109 | etr1 = 0x00000000; |
| 110 | 110 | siu_config_port = 0; |
| r242042 | r242043 | |
| 140 | 140 | lpc_en = 0x0000; |
| 141 | 141 | fwh_sel1 = 0x00112233; |
| 142 | 142 | gen_cntl = 0x00000080; |
| 143 | rtc_conf = 0x00; |
| 143 | 144 | } |
| 144 | 145 | |
| 145 | 146 | READ32_MEMBER (i6300esb_lpc_device::pmbase_r) |
| r242042 | r242043 | |
| 433 | 434 | { |
| 434 | 435 | rtc_conf = data; |
| 435 | 436 | logerror("%s: rtc_conf = %02x\n", tag(), rtc_conf); |
| 437 | remap_cb(); |
| 436 | 438 | } |
| 437 | 439 | |
| 438 | 440 | READ8_MEMBER (i6300esb_lpc_device::lpc_if_com_range_r) |
| r242042 | r242043 | |
| 743 | 745 | UINT16 coma = com_pos[lpc_if_com_range & 7]; |
| 744 | 746 | logerror("%s: Warning: coma at %04x-%04x\n", tag(), coma, coma+7); |
| 745 | 747 | } |
| 748 | |
| 749 | rtc->map_device(memory_window_start, memory_window_end, 0, memory_space, io_window_start, io_window_end, 0, io_space); |
| 750 | if(rtc_conf & 4) |
| 751 | rtc->map_extdevice(memory_window_start, memory_window_end, 0, memory_space, io_window_start, io_window_end, 0, io_space); |
| 746 | 752 | } |
| 747 | 753 | |
| 748 | 754 | |
trunk/src/emu/machine/lpc-rtc.c
| r0 | r242043 | |
| 1 | #include "lpc-rtc.h" |
| 2 | |
| 3 | const device_type LPC_RTC = &device_creator<lpc_rtc_device>; |
| 4 | |
| 5 | DEVICE_ADDRESS_MAP_START(map, 32, lpc_rtc_device) |
| 6 | AM_RANGE(0x70, 0x77) AM_READWRITE8(index_r, index_w, 0x00ff00ff) |
| 7 | AM_RANGE(0x70, 0x77) AM_READWRITE8(target_r, target_w, 0xff00ff00) |
| 8 | ADDRESS_MAP_END |
| 9 | |
| 10 | DEVICE_ADDRESS_MAP_START(extmap, 32, lpc_rtc_device) |
| 11 | AM_RANGE(0x70, 0x77) AM_READWRITE8(extindex_r, extindex_w, 0x00ff0000) |
| 12 | AM_RANGE(0x70, 0x77) AM_READWRITE8(exttarget_r, exttarget_w, 0xff000000) |
| 13 | ADDRESS_MAP_END |
| 14 | |
| 15 | lpc_rtc_device::lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 16 | : lpc_device(mconfig, LPC_RTC, "LPC RTC", tag, owner, clock, "lpc_rtc", __FILE__) |
| 17 | { |
| 18 | } |
| 19 | |
| 20 | void lpc_rtc_device::map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 21 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) |
| 22 | { |
| 23 | io_space->install_device(io_offset, io_window_end, *this, &lpc_rtc_device::map); |
| 24 | } |
| 25 | |
| 26 | void lpc_rtc_device::map_extdevice(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 27 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space) |
| 28 | { |
| 29 | io_space->install_device(io_offset, io_window_end, *this, &lpc_rtc_device::extmap); |
| 30 | } |
| 31 | |
| 32 | void lpc_rtc_device::device_start() |
| 33 | { |
| 34 | memset(ram, 0, 256); |
| 35 | } |
| 36 | |
| 37 | void lpc_rtc_device::device_reset() |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | READ8_MEMBER( lpc_rtc_device::index_r) |
| 42 | { |
| 43 | return cur_index; |
| 44 | } |
| 45 | |
| 46 | WRITE8_MEMBER( lpc_rtc_device::index_w) |
| 47 | { |
| 48 | cur_index = data & 0x7f; |
| 49 | } |
| 50 | |
| 51 | READ8_MEMBER( lpc_rtc_device::target_r) |
| 52 | { |
| 53 | return ram[cur_index]; |
| 54 | } |
| 55 | |
| 56 | WRITE8_MEMBER( lpc_rtc_device::target_w) |
| 57 | { |
| 58 | ram[cur_index] = data; |
| 59 | logerror("%s: ram[%02x] = %02x\n", tag(), cur_index, data); |
| 60 | } |
| 61 | |
| 62 | READ8_MEMBER( lpc_rtc_device::extindex_r) |
| 63 | { |
| 64 | return cur_extindex; |
| 65 | } |
| 66 | |
| 67 | WRITE8_MEMBER( lpc_rtc_device::extindex_w) |
| 68 | { |
| 69 | cur_extindex = data & 0x7f; |
| 70 | } |
| 71 | |
| 72 | READ8_MEMBER( lpc_rtc_device::exttarget_r) |
| 73 | { |
| 74 | return ram[cur_extindex|128]; |
| 75 | } |
| 76 | |
| 77 | WRITE8_MEMBER( lpc_rtc_device::exttarget_w) |
| 78 | { |
| 79 | ram[cur_extindex|128] = data; |
| 80 | logerror("%s: ram[%02x] = %02x\n", tag(), cur_extindex|128, data); |
| 81 | } |
trunk/src/emu/machine/lpc-rtc.h
| r0 | r242043 | |
| 1 | #ifndef LPC_RTC_H |
| 2 | #define LPC_RTC_H |
| 3 | |
| 4 | #include "lpc.h" |
| 5 | |
| 6 | #define MCFG_LPC_RTC_ADD(_tag) \ |
| 7 | MCFG_DEVICE_ADD(_tag, LPC_RTC, 0) |
| 8 | |
| 9 | class lpc_rtc_device : public lpc_device { |
| 10 | public: |
| 11 | lpc_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 12 | |
| 13 | virtual void map_device(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 14 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); |
| 15 | |
| 16 | virtual void map_extdevice(UINT64 memory_window_start, UINT64 memory_window_end, UINT64 memory_offset, address_space *memory_space, |
| 17 | UINT64 io_window_start, UINT64 io_window_end, UINT64 io_offset, address_space *io_space); |
| 18 | |
| 19 | DECLARE_READ8_MEMBER( index_r); |
| 20 | DECLARE_WRITE8_MEMBER( index_w); |
| 21 | DECLARE_READ8_MEMBER( target_r); |
| 22 | DECLARE_WRITE8_MEMBER( target_w); |
| 23 | DECLARE_READ8_MEMBER( extindex_r); |
| 24 | DECLARE_WRITE8_MEMBER( extindex_w); |
| 25 | DECLARE_READ8_MEMBER( exttarget_r); |
| 26 | DECLARE_WRITE8_MEMBER( exttarget_w); |
| 27 | |
| 28 | protected: |
| 29 | void device_start(); |
| 30 | void device_reset(); |
| 31 | |
| 32 | private: |
| 33 | DECLARE_ADDRESS_MAP(map, 32); |
| 34 | DECLARE_ADDRESS_MAP(extmap, 32); |
| 35 | |
| 36 | UINT8 cur_index, cur_extindex; |
| 37 | UINT8 ram[256]; |
| 38 | }; |
| 39 | |
| 40 | extern const device_type LPC_RTC; |
| 41 | |
| 42 | #endif |
trunk/src/mame/drivers/lindbergh.c
| r242042 | r242043 | |
| 302 | 302 | MCFG_SEGA_LINDBERGH_BASEBOARD_ADD(":pci:1e.0:03.0") |
| 303 | 303 | MCFG_I6300ESB_LPC_ADD( ":pci:1f.0") |
| 304 | 304 | MCFG_LPC_ACPI_ADD( ":pci:1f.0:acpi") |
| 305 | MCFG_LPC_RTC_ADD( ":pci:1f.0:rtc") |
| 305 | 306 | MCFG_SATA_ADD( ":pci:1f.2", 0x808625a3, 0x02, 0x103382c0) |
| 306 | 307 | MCFG_SMBUS_ADD( ":pci:1f.3", 0x808625a4, 0x02, 0x103382c0) |
| 307 | 308 | MCFG_AC97_ADD( ":pci:1f.5", 0x808625a6, 0x02, 0x103382c0) |