Previous 199869 Revisions Next

r33531 Tuesday 25th November, 2014 at 19:06:12 UTC by Olivier Galibert
(nw)
[src/emu/machine]i6300esb.c i6300esb.h lpc-rtc.c* lpc-rtc.h* machine.mak
[src/mame/drivers]lindbergh.c

trunk/src/emu/machine/i6300esb.c
r242042r242043
8686
8787i6300esb_lpc_device::i6300esb_lpc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8888   : 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")
9091{
9192}
9293
r242042r242043
104105   d31_err_cfg = 0x00;
105106   d31_err_sts = 0x00;
106107   pci_dma_cfg = 0x0000;
107   rtc_conf = 0x00;
108108   func_dis = 0x0080;
109109   etr1 = 0x00000000;
110110   siu_config_port = 0;
r242042r242043
140140   lpc_en = 0x0000;
141141   fwh_sel1 = 0x00112233;
142142   gen_cntl = 0x00000080;
143   rtc_conf = 0x00;
143144}
144145
145146READ32_MEMBER (i6300esb_lpc_device::pmbase_r)
r242042r242043
433434{
434435   rtc_conf = data;
435436   logerror("%s: rtc_conf = %02x\n", tag(), rtc_conf);
437   remap_cb();
436438}
437439
438440READ8_MEMBER  (i6300esb_lpc_device::lpc_if_com_range_r)
r242042r242043
743745      UINT16 coma = com_pos[lpc_if_com_range & 7];
744746      logerror("%s: Warning: coma at %04x-%04x\n", tag(), coma, coma+7);
745747   }
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);
746752}
747753
748754
trunk/src/emu/machine/i6300esb.h
r242042r242043
55
66#include "pci.h"
77#include "lpc-acpi.h"
8#include "lpc-rtc.h"
89
910#define MCFG_I6300ESB_LPC_ADD(_tag) \
1011   MCFG_PCI_DEVICE_ADD(_tag, I6300ESB_LPC, 0x808625a1, 0x02, 0x060100, 0x00000000)
r242042r242043
2930
3031private:
3132   required_device<lpc_acpi_device> acpi;
33   required_device<lpc_rtc_device> rtc;
3234
3335   DECLARE_ADDRESS_MAP(internal_io_map, 32);
3436
trunk/src/emu/machine/lpc-rtc.c
r0r242043
1#include "lpc-rtc.h"
2
3const device_type LPC_RTC = &device_creator<lpc_rtc_device>;
4
5DEVICE_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)
8ADDRESS_MAP_END
9
10DEVICE_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)
13ADDRESS_MAP_END
14
15lpc_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
20void 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
26void 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
32void lpc_rtc_device::device_start()
33{
34   memset(ram, 0, 256);
35}
36
37void lpc_rtc_device::device_reset()
38{
39}
40
41READ8_MEMBER(  lpc_rtc_device::index_r)
42{
43   return cur_index;
44}
45
46WRITE8_MEMBER( lpc_rtc_device::index_w)
47{
48   cur_index = data & 0x7f;
49}
50
51READ8_MEMBER(  lpc_rtc_device::target_r)
52{
53   return ram[cur_index];
54}
55
56WRITE8_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
62READ8_MEMBER(  lpc_rtc_device::extindex_r)
63{
64   return cur_extindex;
65}
66
67WRITE8_MEMBER( lpc_rtc_device::extindex_w)
68{
69   cur_extindex = data & 0x7f;
70}
71
72READ8_MEMBER(  lpc_rtc_device::exttarget_r)
73{
74   return ram[cur_extindex|128];
75}
76
77WRITE8_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
r0r242043
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
9class lpc_rtc_device : public lpc_device {
10public:
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
28protected:
29   void device_start();
30   void device_reset();
31
32private:
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
40extern const device_type LPC_RTC;
41
42#endif
trunk/src/emu/machine/machine.mak
r242042r242043
12621262MACHINEOBJS += $(MACHINEOBJ)/i6300esb.o
12631263MACHINEOBJS += $(MACHINEOBJ)/lpc.o
12641264MACHINEOBJS += $(MACHINEOBJ)/lpc-acpi.o
1265MACHINEOBJS += $(MACHINEOBJ)/lpc-rtc.o
12651266endif
12661267
12671268#-------------------------------------------------
trunk/src/mame/drivers/lindbergh.c
r242042r242043
302302   MCFG_SEGA_LINDBERGH_BASEBOARD_ADD(":pci:1e.0:03.0")
303303   MCFG_I6300ESB_LPC_ADD(            ":pci:1f.0")
304304   MCFG_LPC_ACPI_ADD(                ":pci:1f.0:acpi")
305   MCFG_LPC_RTC_ADD(                 ":pci:1f.0:rtc")
305306   MCFG_SATA_ADD(                    ":pci:1f.2",      0x808625a3, 0x02, 0x103382c0)
306307   MCFG_SMBUS_ADD(                   ":pci:1f.3",      0x808625a4, 0x02, 0x103382c0)
307308   MCFG_AC97_ADD(                    ":pci:1f.5",      0x808625a6, 0x02, 0x103382c0)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team