src/mess/includes/dm7000.h
| r0 | r15156 | |
| 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 | |
| 8 | class dm7000_state : public driver_device |
| 9 | { |
| 10 | public: |
| 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
| r15155 | r15156 | |
| 37 | 37 | ****************************************************************************/ |
| 38 | 38 | |
| 39 | 39 | #include "emu.h" |
| 40 | | #include "cpu/powerpc/ppc.h" |
| 41 | | #include "machine/terminal.h" |
| 40 | #include "includes/dm7000.h" |
| 42 | 41 | |
| 43 | 42 | #define VERBOSE_LEVEL ( 0 ) |
| 44 | 43 | |
| r15155 | r15156 | |
| 55 | 54 | } |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | | class dm7000_state : public driver_device |
| 59 | | { |
| 60 | | public: |
| 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 | | |
| 88 | 57 | READ8_MEMBER( dm7000_state::dm7000_iic0_r ) |
| 89 | 58 | { |
| 90 | 59 | UINT32 data = 0; // dummy |
| r15155 | r15156 | |
| 109 | 78 | verboselog( machine(), 9, "(IIC1) %08X <- %08X (PC %08X)\n", 0x400b0000 + offset, data, cpu_get_pc(m_maincpu)); |
| 110 | 79 | } |
| 111 | 80 | |
| 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 | | |
| 128 | 81 | READ8_MEMBER( dm7000_state::dm7000_scc0_r ) |
| 129 | 82 | { |
| 130 | 83 | UINT32 data = 0; // dummy |
| r15155 | r15156 | |
| 164 | 117 | verboselog( machine(), 9, "(GPIO0) %08X <- %08X (PC %08X)\n", 0x40060000 + offset, data, cpu_get_pc(m_maincpu)); |
| 165 | 118 | } |
| 166 | 119 | |
| 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 | | |
| 175 | 120 | READ8_MEMBER( dm7000_state::dm7000_scp0_r ) |
| 176 | 121 | { |
| 177 | 122 | UINT32 data = 0; // dummy |
| r15155 | r15156 | |
| 240 | 185 | AM_RANGE(0x400b0000, 0x400b000f) AM_READWRITE8(dm7000_iic1_r, dm7000_iic1_w, 0xffffffff) |
| 241 | 186 | AM_RANGE(0x400c0000, 0x400c0007) AM_READWRITE8(dm7000_scp0_r, dm7000_scp0_w, 0xffffffff) |
| 242 | 187 | |
| 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) |
| 244 | 190 | ADDRESS_MAP_END |
| 245 | 191 | |
| 246 | 192 | /* Input ports */ |
| r15155 | r15156 | |
| 252 | 198 | { |
| 253 | 199 | dm7000_state *state = machine.driver_data<dm7000_state>(); |
| 254 | 200 | |
| 201 | state->dcr[DCRSTB045_SCCR] = 0x00420080 /* default for serial divs */ | 0x3f /* undocumented?? used to print clocks */; |
| 255 | 202 | state->m_scc0_lsr = UART_LSR_THRE | UART_LSR_TEMT; |
| 256 | 203 | } |
| 257 | 204 | |
| r15155 | r15156 | |
| 263 | 210 | { |
| 264 | 211 | return 0; |
| 265 | 212 | } |
| 266 | | #define DCRSTB045_CMD_STAT 0x14a /* Command status */ |
| 267 | 213 | |
| 268 | 214 | static READ32_DEVICE_HANDLER( dcr_r ) |
| 269 | 215 | { |
| 270 | 216 | dm7000_state *state = device->machine().driver_data<dm7000_state>(); |
| 217 | if(offset>=1024) {printf("get %04X\n", offset); return 0;} else |
| 271 | 218 | switch(offset) { |
| 272 | 219 | case DCRSTB045_CMD_STAT: |
| 273 | 220 | return 0; // assume that video dev is always ready |
| r15155 | r15156 | |
| 280 | 227 | static WRITE32_DEVICE_HANDLER( dcr_w ) |
| 281 | 228 | { |
| 282 | 229 | dm7000_state *state = device->machine().driver_data<dm7000_state>(); |
| 230 | if(offset>=1024) {printf("get %04X\n", offset); } else |
| 283 | 231 | state->dcr[offset] = data; |
| 284 | 232 | } |
| 285 | 233 | |
| r15155 | r15156 | |
| 297 | 245 | |
| 298 | 246 | static MACHINE_CONFIG_START( dm7000, dm7000_state ) |
| 299 | 247 | /* 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) |
| 301 | 250 | MCFG_CPU_PROGRAM_MAP(dm7000_mem) |
| 302 | 251 | |
| 303 | 252 | MCFG_MACHINE_RESET(dm7000) |
| r15155 | r15156 | |
| 322 | 271 | ROM_START( dm7000 ) |
| 323 | 272 | ROM_REGION( 0x20000, "user1", ROMREGION_32BIT | ROMREGION_BE ) |
| 324 | 273 | ROMX_LOAD( "dm7000.bin", 0x0000, 0x20000, CRC(8a410f67) SHA1(9d6c9e4f5b05b28453d3558e69a207f05c766f54), ROM_GROUPWORD ) |
| 274 | ROM_REGION( 0x800000, "user2", ROMREGION_32BIT | ROMREGION_BE | ROMREGION_ERASEFF ) |
| 325 | 275 | ROM_END |
| 326 | 276 | |
| 327 | 277 | ROM_START( dm5620 ) |
| 328 | 278 | ROM_REGION( 0x20000, "user1", ROMREGION_32BIT | ROMREGION_BE ) |
| 329 | 279 | 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)) |
| 330 | 282 | ROM_END |
| 331 | 283 | |
| 332 | 284 | ROM_START( dm500 ) |
| r15155 | r15156 | |
| 335 | 287 | ROMX_LOAD( "dm500-alps-boot.bin", 0x0000, 0x20000, CRC(daf2da34) SHA1(68f3734b4589fcb3e73372e258040bc8b83fd739), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1)) |
| 336 | 288 | ROM_SYSTEM_BIOS( 1, "phil", "Philips" ) |
| 337 | 289 | 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 ) |
| 338 | 291 | ROM_END |
| 339 | 292 | /* Driver */ |
| 340 | 293 | |