Previous 15994 Revisions Next

r15156 Sunday 13th May, 2012 at 05:26:49 UTC by Miodrag Milanović
more drembox wip, dm5620 now start to boot linux by Lukasz (nw)
[src/mess/drivers]dm7000.c
[src/mess/includes]dm7000.h*

src/mess/includes/dm7000.h
r0r15156
1#ifndef DM7000_H_
2#define DM7000_H_
3
4#include "emu.h"
5#include "cpu/powerpc/ppc.h"
6#include "machine/terminal.h"
7
8class dm7000_state : public driver_device
9{
10public:
11   dm7000_state(const machine_config &mconfig, device_type type, const char *tag)
12      : driver_device(mconfig, type, tag),
13      m_maincpu(*this, "maincpu"),
14      m_terminal(*this, TERMINAL_TAG)      { }
15
16   required_device<cpu_device> m_maincpu;
17   required_device<generic_terminal_device> m_terminal;
18   
19   DECLARE_WRITE8_MEMBER ( dm7000_iic0_w );
20   DECLARE_READ8_MEMBER ( dm7000_iic0_r );
21   DECLARE_WRITE8_MEMBER ( dm7000_iic1_w );
22   DECLARE_READ8_MEMBER ( dm7000_iic1_r );
23   
24   DECLARE_WRITE8_MEMBER ( dm7000_scc0_w );
25   DECLARE_READ8_MEMBER ( dm7000_scc0_r );
26   UINT8 m_scc0_lcr;
27   UINT8 m_scc0_lsr;
28   
29   DECLARE_WRITE8_MEMBER ( dm7000_gpio0_w );
30   DECLARE_READ8_MEMBER ( dm7000_gpio0_r );
31   
32   DECLARE_WRITE8_MEMBER ( dm7000_scp0_w );
33   DECLARE_READ8_MEMBER ( dm7000_scp0_r );
34   
35   UINT32         dcr[1024];   
36};
37
38/* */
39#define UART_DLL   0
40#define UART_RBR   0
41#define UART_THR   0
42#define UART_DLH   1
43#define UART_IER   1
44#define UART_IIR   2
45#define UART_FCR   2
46#define UART_LCR   3
47#define    UART_LCR_DLAB   0x80
48#define UART_MCR   4
49#define UART_LSR   5
50#define      UART_LSR_TEMT   0x20
51#define      UART_LSR_THRE   0x40
52#define UART_MSR   6
53#define UART_SCR   7
54
55/* */
56#define SCP_SPMODE 0
57#define SCP_RXDATA 1
58#define SCP_TXDATA 2
59#define SCP_SPCOM 3
60#define SCP_STATUS 4
61#define    SCP_STATUS_RXRDY 1
62#define SCP_CDM 6
63
64/* STB045xxx DCRs */
65#define DCRSTB045_SCCR       0x120      /* Serial Clock Control Register */
66#define DCRSTB045_CMD_STAT    0x14a      /* Command status */
67
68#endif /* DM7000_H_ */
No newline at end of file
src/mess/drivers/dm7000.c
r15155r15156
3737****************************************************************************/
3838
3939#include "emu.h"
40#include "cpu/powerpc/ppc.h"
41#include "machine/terminal.h"
40#include "includes/dm7000.h"
4241
4342#define VERBOSE_LEVEL ( 0 )
4443
r15155r15156
5554   }
5655}
5756
58class dm7000_state : public driver_device
59{
60public:
61   dm7000_state(const machine_config &mconfig, device_type type, const char *tag)
62      : driver_device(mconfig, type, tag),
63      m_maincpu(*this, "maincpu"),
64      m_terminal(*this, TERMINAL_TAG)      { }
65
66   required_device<cpu_device> m_maincpu;
67   required_device<generic_terminal_device> m_terminal;
68   
69   DECLARE_WRITE8_MEMBER ( dm7000_iic0_w );
70   DECLARE_READ8_MEMBER ( dm7000_iic0_r );
71   DECLARE_WRITE8_MEMBER ( dm7000_iic1_w );
72   DECLARE_READ8_MEMBER ( dm7000_iic1_r );
73   
74   DECLARE_WRITE8_MEMBER ( dm7000_scc0_w );
75   DECLARE_READ8_MEMBER ( dm7000_scc0_r );
76   UINT8 m_scc0_lcr;
77   UINT8 m_scc0_lsr;
78   
79   DECLARE_WRITE8_MEMBER ( dm7000_gpio0_w );
80   DECLARE_READ8_MEMBER ( dm7000_gpio0_r );
81   
82   DECLARE_WRITE8_MEMBER ( dm7000_scp0_w );
83   DECLARE_READ8_MEMBER ( dm7000_scp0_r );
84   
85   UINT32         dcr[512];   
86};
87
8857READ8_MEMBER( dm7000_state::dm7000_iic0_r )
8958{
9059   UINT32 data = 0; // dummy
r15155r15156
10978   verboselog( machine(), 9, "(IIC1) %08X <- %08X (PC %08X)\n", 0x400b0000 + offset, data, cpu_get_pc(m_maincpu));
11079}
11180
112#define UART_DLL   0
113#define UART_RBR   0
114#define UART_THR   0
115#define UART_DLH   1
116#define UART_IER   1
117#define UART_IIR   2
118#define UART_FCR   2
119#define UART_LCR   3
120#define    UART_LCR_DLAB   0x80
121#define UART_MCR   4
122#define UART_LSR   5
123#define      UART_LSR_TEMT   0x20
124#define      UART_LSR_THRE   0x40
125#define UART_MSR   6
126#define UART_SCR   7
127
12881READ8_MEMBER( dm7000_state::dm7000_scc0_r )
12982{
13083   UINT32 data = 0; // dummy
r15155r15156
164117   verboselog( machine(), 9, "(GPIO0) %08X <- %08X (PC %08X)\n", 0x40060000 + offset, data, cpu_get_pc(m_maincpu));
165118}
166119
167#define SCP_SPMODE 0
168#define SCP_RXDATA 1
169#define SCP_TXDATA 2
170#define SCP_SPCOM 3
171#define SCP_STATUS 4
172#define    SCP_STATUS_RXRDY 1
173#define SCP_CDM 6
174
175120READ8_MEMBER( dm7000_state::dm7000_scp0_r )
176121{
177122   UINT32 data = 0; // dummy
r15155r15156
240185   AM_RANGE(0x400b0000, 0x400b000f) AM_READWRITE8(dm7000_iic1_r, dm7000_iic1_w, 0xffffffff)
241186   AM_RANGE(0x400c0000, 0x400c0007) AM_READWRITE8(dm7000_scp0_r, dm7000_scp0_w, 0xffffffff)
242187   
243   AM_RANGE(0xfffe0000, 0xffffffff) AM_ROM AM_REGION("user1",0)
188   AM_RANGE(0x7f800000, 0x7ffdffff) AM_ROM AM_REGION("user2",0)
189   AM_RANGE(0x7ffe0000, 0x7fffffff) AM_ROM AM_REGION("user1",0)
244190ADDRESS_MAP_END
245191
246192/* Input ports */
r15155r15156
252198{
253199   dm7000_state *state = machine.driver_data<dm7000_state>();
254200   
201   state->dcr[DCRSTB045_SCCR] = 0x00420080 /* default for serial divs */ | 0x3f /* undocumented?? used to print clocks */;
255202   state->m_scc0_lsr = UART_LSR_THRE | UART_LSR_TEMT;
256203}
257204
r15155r15156
263210{
264211   return 0;
265212}
266#define DCRSTB045_CMD_STAT    0x14a      /* Command status */
267213
268214static READ32_DEVICE_HANDLER( dcr_r )
269215{
270216   dm7000_state *state = device->machine().driver_data<dm7000_state>();
217   if(offset>=1024) {printf("get %04X\n", offset); return 0;} else
271218   switch(offset) {
272219      case DCRSTB045_CMD_STAT:
273220         return 0; // assume that video dev is always ready
r15155r15156
280227static WRITE32_DEVICE_HANDLER( dcr_w )
281228{
282229   dm7000_state *state = device->machine().driver_data<dm7000_state>();
230   if(offset>=1024) {printf("get %04X\n", offset); } else
283231   state->dcr[offset] = data;
284232}
285233
r15155r15156
297245
298246static MACHINE_CONFIG_START( dm7000, dm7000_state )
299247   /* basic machine hardware */
300   MCFG_CPU_ADD("maincpu",PPC405GP, 252000000) // Should be PPC405
248   MCFG_CPU_ADD("maincpu",PPC405GP, 252000000) // Should be PPC405D4?
249   MCFG_CPU_CONFIG(ppc405_config)
301250   MCFG_CPU_PROGRAM_MAP(dm7000_mem)
302251
303252   MCFG_MACHINE_RESET(dm7000)
r15155r15156
322271ROM_START( dm7000 )
323272   ROM_REGION( 0x20000, "user1", ROMREGION_32BIT | ROMREGION_BE  )
324273   ROMX_LOAD( "dm7000.bin", 0x0000, 0x20000, CRC(8a410f67) SHA1(9d6c9e4f5b05b28453d3558e69a207f05c766f54), ROM_GROUPWORD )
274   ROM_REGION( 0x800000, "user2", ROMREGION_32BIT | ROMREGION_BE | ROMREGION_ERASEFF  )
325275ROM_END
326276
327277ROM_START( dm5620 )
328278   ROM_REGION( 0x20000, "user1", ROMREGION_32BIT | ROMREGION_BE  )
329279   ROMX_LOAD( "dm5620.bin", 0x0000, 0x20000, CRC(ccddb822) SHA1(3ecf553ced0671599438368f59d8d30df4d13ade), ROM_GROUPWORD )
280   ROM_REGION( 0x800000, "user2", ROMREGION_32BIT | ROMREGION_BE | ROMREGION_ERASEFF  )
281   ROM_LOAD( "rel106.img", 0x0000, 0x57b000, CRC(2313d71d) SHA1(0d3d99ab3b3266624f237b7b67e045d7910c44a5))
330282ROM_END
331283
332284ROM_START( dm500 )
r15155r15156
335287   ROMX_LOAD( "dm500-alps-boot.bin",   0x0000, 0x20000, CRC(daf2da34) SHA1(68f3734b4589fcb3e73372e258040bc8b83fd739), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1))
336288   ROM_SYSTEM_BIOS( 1, "phil", "Philips" )
337289   ROMX_LOAD( "dm500-philps-boot.bin", 0x0000, 0x20000, CRC(af3477c7) SHA1(9ac918f6984e6927f55bea68d6daaf008787136e), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2))
290   ROM_REGION( 0x800000, "user2", ROMREGION_32BIT | ROMREGION_BE | ROMREGION_ERASEFF  )
338291ROM_END
339292/* Driver */
340293

Previous 15994 Revisions Next


© 1998-2018 The MESS Team