Previous 15994 Revisions Next

r14341 Saturday 4th February, 2012 at 11:45:12 UTC by Miodrag Milanović
ISA card AHA1542 skeleton added [Darkstar]
[src/mess]mess.mak mess_dev.lst
[src/mess/drivers]at.c
[src/mess/includes]at.h
[src/mess/machine]isa_aha1542.c* isa_aha1542.h*

src/mess/machine/isa_aha1542.c
r0r14341
1/**********************************************************************
2 *
3 *    Adaptec AHA-1542{,C,CF} SCSI Controller
4 *
5 *    Copyright MESS Team.
6 *    Visit http://mamedev.org for licensing and usage restrictions.
7 *
8 **********************************************************************/
9
10/*
11 PCB layout
12 ----------
13           Floppy            SCSI
14       +-----------+ +------------------+  +-
15 +-----+-----------+-+------------------+--+
16 |                                         |
17 | DIPSW DS1                               |\
18 |     +-----+                             | |
19 |     |     | Y1   +---+   TRM     TRM    | |
20 |     | U3  |      |U5 |                  |S|
21 | U8  +-----+      +---+                  |C|
22 |       +---+ +------+     +-------+      |S|
23 |       |U13| |U15   |  Y2 |       |      |I|
24 |       +---+ +------+     |       |      | |
25 |             |U16   |     |U17    |      | |
26 |             +------+     +-------+      |/
27 +-----------------------------------------+
28 |||||||||  |||||||||||||||||||||||||      |
29
30
31 DIPSW   sw1 - sw8
32 U3   Intel chip labelled "AHA-1542CF/552800-01 D/9346", probably FDC (82077)
33 U5   Z84C0010VEC
34 U8   EEPROM(?) labelled 545120A
35 U13   CXK5864CM-10LL (64kbit SRAM)
36 U15   M27C256B labelled "ADAPTEC INC/553801-00 C/MCODE 563D/(C) 1993"
37 U16   M27C256B labelled "ADAPTEC INC/553601-00 C/BIOS C38D/(C) 1993"
38 U17   AIC-7970Q
39 Y1   XTAL SRX4054 93-38
40 Y2   XTAL SRX4053 93-40
41 TRM   Dallas DS2107AS (SCSI termination)
42 DS1   LED
43
44*/
45
46/*
47 * The PCB has a couple of DIP switches:
48 *
49 *    sw1   on   enable termination
50 *       off   software-controlled termination
51 *
52 *    sw2   sw3   sw4   I/O Port
53 *    off   off   off   0x330 - 0x333 (default)
54 *    on   off   off   0x334 - 0x337
55 *    off   on   off   0x230 - 0x233
56 *    on   on   off   0x234 - 0x237
57 *    off   off   on   0x130 - 0x133
58 *    on   off   on   0x134 - 0x137
59 *    off   on   on   reserved
60 *    on   on   on   reserved
61 *
62 *    sw5   on   disable floppy interface
63 *       off   enable floppy interface
64 *
65 *    sw6   sw7   sw8   BIOS base address
66 *   off   off   off   0xdc000 (default)
67 *   on   off   off   0xd8000
68 *   off   on   off   0xd4000
69 *   on   on   off   0xd0000
70 *   off   off   on   0xcc000
71 *   on   off   on   0xc8000
72 *   off   on   on   reserved
73 *   on   on   on   BIOS disabled
74 *
75 * source: http://download.adaptec.com/pdfs/installation_guides/1540cfig.pdf
76 */
77
78#include "isa_aha1542.h"
79#include "cpu/z80/z80.h"
80
81// I/O Port interface
82// READ  Port x+0: STATUS
83// WRITE Port x+0: CONTROL
84//
85// READ  Port x+1: DATA
86// WRITE Port x+1: COMMAND
87//
88// READ  Port x+2: INTERRUPT STATUS
89// WRITE Port x+2: (undefined?)
90//
91// R/W   Port x+3: (undefined)
92
93// READ STATUS flags
94#define STAT_STST   0x80    // self-test in progress
95#define STAT_DIAGF  0x40    // internal diagnostic failure
96#define STAT_INIT   0x20    // mailbox initialization required
97#define STAT_IDLE   0x10    // HBA is idle
98#define STAT_CDFULL 0x08    // Command/Data output port is full
99#define STAT_DFULL  0x04    // Data input port is full
100#define STAT_INVCMD 0x01    // Invalid command
101
102// READ INTERRUPT STATUS flags
103#define INTR_ANY    0x80    // any interrupt
104#define INTR_SRCD   0x08    // SCSI reset detected
105#define INTR_HACC   0x04    // HA command complete
106#define INTR_MBOA   0x02    // MBO empty
107#define INTR_MBIF   0x01    // MBI full
108
109// WRITE CONTROL commands
110#define CTRL_HRST   0x80    // Hard reset
111#define CTRL_SRST   0x40    // Soft reset
112#define CTRL_IRST   0x20    // interrupt reset
113#define CTRL_SCRST  0x10    // SCSI bus reset
114
115// READ/WRITE DATA commands
116#define CMD_NOP         0x00    // No operation
117#define CMD_MBINIT      0x01    // mailbox initialization
118#define CMD_START_SCSI  0x02    // Start SCSI command
119#define CMD_BIOSCMD     0x03    // undocumented BIOS conmmand (shadow RAM etc.)
120#define CMD_INQUIRY     0x04    // Adapter inquiry
121#define CMD_EMBOI       0x05    // enable Mailbox Out Interrupt
122#define CMD_SELTIMEOUT  0x06    // Set SEL timeout
123#define CMD_BUSON_TIME  0x07    // set bus-On time
124#define CMD_BUSOFF_TIME 0x08    // set bus-off time
125#define CMD_DMASPEED    0x09    // set ISA DMA speed
126#define CMD_RETDEVS     0x0a    // return installed devices
127#define CMD_RETCONF     0x0b    // return configuration data
128#define CMD_TARGET      0x0c    // set HBA to target mode
129#define CMD_RETSETUP    0x0d    // return setup data
130#define CMD_ECHO        0x1f    // ECHO command data (NetBSD says it is 0x1e)
131
132// these are for 1541C only:
133#define CMD_RETDEVSHI   0x23    // return devices 8-15 (from NetBSD)
134#define CMD_EXTBIOS     0x28    // return extended BIOS information
135#define CMD_MBENABLE    0x29    // set mailbox interface enable
136
137const device_type AHA1542 = &device_creator<aha1542_device>;
138
139#define Z84C0010_TAG "u5"
140
141READ8_MEMBER( aha1542_device::aha1542_r )
142{
143   printf("aha1542_r(): pc=0x%08x offset=%d\n", (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC), offset);
144        return 0xff;
145}
146
147WRITE8_MEMBER( aha1542_device::aha1542_w )
148{
149   printf("aha1542_w(): pc=0x%08x offset=%d data=0x%02x\n", (unsigned) cpu_get_reg(machine().firstcpu, STATE_GENPC), offset, data);
150}
151
152//-------------------------------------------------
153//  ROM( aha1542 )
154//-------------------------------------------------
155 
156ROM_START( aha1542 )
157    ROM_REGION( 0x8000, "aha1542", 0 )
158   ROM_LOAD( "553601-00.u16", 0x0000, 0x8000, CRC(AB22FC02) SHA1(f9f783e0272fc14ba3de32316997f1f6cadc67d0) ) /* Adaptec 1540CF/1542CF BIOS v2.01 */
159
160   ROM_REGION( 0x8000, Z84C0010_TAG, 0 )
161   ROM_LOAD( "553801-00.u15", 0x0000, 0x8000, CRC(7824397E) SHA1(35bc2c8fab31aad3190a478f2dc8f3a72958cf04) ) /* ADAPTEC, INC MCODE */
162ROM_END
163
164static ADDRESS_MAP_START( z84c0010_mem, AS_PROGRAM, 8, aha1542_device )
165   AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION(Z84C0010_TAG, 0)
166   AM_RANGE(0x8000, 0x800f) AM_NOP        // something is mapped there
167   AM_RANGE(0x9000, 0xafff) AM_RAM        // 2kb RAM chip
168   AM_RANGE(0xe000, 0xe0ff) AM_RAM        // probably PC<->Z80 communication area
169   AM_RANGE(0xb000, 0xb000) AM_NOP        // something?
170ADDRESS_MAP_END
171
172static MACHINE_CONFIG_FRAGMENT( aha1542 )
173   MCFG_CPU_ADD(Z84C0010_TAG, Z80, XTAL_12MHz)
174   MCFG_CPU_PROGRAM_MAP( z84c0010_mem )
175MACHINE_CONFIG_END
176
177const rom_entry *aha1542_device::device_rom_region() const
178{
179   return ROM_NAME( aha1542 );
180}
181
182machine_config_constructor aha1542_device::device_mconfig_additions() const
183{
184   return MACHINE_CONFIG_NAME( aha1542 );
185}
186
187aha1542_device::aha1542_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
188    device_t(mconfig, AHA1542, "AHA1542", tag, owner, clock),
189   device_isa16_card_interface(mconfig, *this)
190{
191}
192
193void aha1542_device::device_config_complete()
194{
195   m_shortname = "aha1542";
196}
197     
198void aha1542_device::device_start()
199{
200   set_isa_device();
201   m_isa->install_rom(this, 0xdc000, 0xdffff, 0, 0, "aha1542", "aha1542");
202   m_isa->install_device(0x330, 0x333, 0, 0, read8_delegate(FUNC( aha1542_device::aha1542_r ), this),
203   write8_delegate(FUNC( aha1542_device::aha1542_w ), this) );
204}
205
206
207void aha1542_device::device_reset()
208{
209}
210
src/mess/machine/isa_aha1542.h
r0r14341
1/**********************************************************************
2 *
3 *    Adaptec AHA-1542{,C,CF} SCSI Controller
4 *
5 *    Copyright MESS Team.
6 *    Visit http://mamedev.org for licensing and usage restrictions.
7 *
8 **********************************************************************
9
10
11
12 **********************************************************************/
13
14#pragma once
15
16#ifndef __AHA1542__
17#define __AHA1542__
18
19#define ADDRESS_MAP_MODERN
20
21#include "emu.h"
22#include "machine/isa.h"
23#include "machine/scsibus.h"
24
25//*********************************************************************
26//   TYPE DEFINITIONS
27//*********************************************************************
28
29// ====================> aha1542_device
30
31class aha1542_device : public device_t,
32                       public device_isa16_card_interface
33{
34public:
35   // construction/destruction
36   aha1542_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37
38   // optional information overrides
39   virtual const rom_entry *device_rom_region() const;
40   virtual machine_config_constructor device_mconfig_additions() const;
41
42   DECLARE_READ8_MEMBER( aha1542_r );
43   DECLARE_WRITE8_MEMBER( aha1542_w );
44   
45protected:
46   // device-level overrides
47   virtual void device_start();
48   virtual void device_reset();
49   virtual void device_config_complete();
50
51   // device_isa16_card_interface
52   
53private:
54   // internal state
55};
56
57// device type definition
58
59extern const device_type AHA1542;
60
61#endif
62
src/mess/includes/at.h
r14340r14341
2929#include "video/isa_svga_s3.h"
3030
3131#include "machine/idectrl.h"
32#include "machine/isa_aha1542.h"
3233#include "machine/at_keybc.h"
3334#include "includes/ps2.h"
3435
src/mess/mess_dev.lst
r14340r14341
9898ISA8_SVGA_S3
9999ISA8_HERCULES
100100ISA8_FINALCHS
101AHA1542
101102IBM_VGA
102103IQ151_DISC2
103104IQ151_MS151A
src/mess/mess.mak
r14340r14341
13181318   $(MESS_MACHINE)/isa_mpu401.o   \
13191319   $(MESS_MACHINE)/isa_sblaster.o   \
13201320   $(MESS_MACHINE)/isa_ide.o   \
1321   $(MESS_MACHINE)/isa_aha1542.o   \
13211322   $(MESS_VIDEO)/isa_cga.o      \
13221323   $(MESS_VIDEO)/isa_mda.o      \
13231324   $(MESS_VIDEO)/crtc_ega.o   \
src/mess/drivers/at.c
r14340r14341
370370   // ISA 16 bit
371371   SLOT_INTERFACE("ide", ISA16_IDE)
372372   SLOT_INTERFACE("ne2000", NE2000)
373   SLOT_INTERFACE("aha1542", AHA1542)
373374SLOT_INTERFACE_END
374375
375376static MACHINE_CONFIG_FRAGMENT( at_motherboard )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team