1 // license:BSD-3-Clause
2 // copyright-holders:Joakim Larsson Edstrom
3 /***************************************************************************
4 *
5 * Motorola MVME-350 6U Intelligent Tape Controller driver
6 *
7 * 31/08/2015
8 *
9 * I baught this board from http://www.retrotechnology.com without documentation.
10 * It has a Motorola 68010 CPU @ 10MHz, 128 Mb RAM and two 2764 EPROMS with
11 * QIC-02 tape controller firmware. The board also populates a 68230 PIT and loads
12 * of descrete TTL components.
13 *
14 *
15 * ||
16 * || ||
17 * ||||--||
18 * ||||--||
19 * || ||__________________________________________________________ ___
20 * ||_______________________________________________________ |_| |
21 * || |74F74 | xxxxx | xxxxx | 74LS245 | 74ALS645| | | |
22 * || |______|________|_________|___________| ________| | | |
23 * || |74F74 | xxxxx | xxxxx | 74LS245 | 74ALS645| | | |
24 * || |______|________|_________|___________| ________| | | |
25 * || |74LS02| 74LS08||Am25LS251| 74S38 |74LS20|Jumpers | | |
26 * || |______|_______||_________|_______|______|______| | |VME|
27 * || |74F04 | 74LS32||74LS374 | 74LS374 |74S244 | | | |
28 * ||+---+ |______|_______||_________|___________|_________| | |P1 |
29 * |||CON| |74F04 | 74LS85||74S244 | 74S240 |PAL | | | |
30 * ||| | |______|_______||_________|___________|_________| | | |
31 * ||| | |74LS04| | |74S244 | | | |
32 * ||| | |______| | PIT |_________| | | |
33 * ||| | |74LS125 | MC68230L10 |74LS145 | | | |
34 * ||| | |______| __|_______________________|---------| | | |
35 * ||| | |74LS74| |25LS251 | | RAM |74S244 | |_| |
36 * ||+---+ ---------- |---------- | HM6264P-12 |---------| |___|
37 * || | PAL | | 74245 | |______________|74S244 | |
38 * || +--------- |_________| | U40 27128 |---------| |
39 * || | 74F32 | | || System ROM |74LS682 | |
40 * Red || +-------- | CPU || |-+-------| |
41 * FAIL ||LED | 74F138| | MC68010 |+--------------+ |DIPSW__| |
42 * Red || +-------- | || RAM | |74S38 | |
43 * HALT ||LED | 74F32 | |__________|| HM6264P-12 | |______ | |
44 * Green || +-------+ |74245 |+--------------+ |74F08 | |
45 * RUN ||LED |XTAL | |__________|| U47 27128 | |______ | |___
46 * ||+---+|20MHz | |74244 || System ROM | |74F00 | _| |
47 * |||CON|--------+___|__________|+--------------+_|_______| | | |
48 * ||| |74LS08 |74F74 |74LS148| |PAL | | PAL | | | |
49 * ||| |________|________|_______| |________|_|_________| | | |
50 * ||| | 74LS138|74F32 | PAL | |74F74 |Am29823 | | | |
51 * ||| |________|________|_______| |________|-+---------| | |VME|
52 * ||| | 74LS11 |74F04 |74LS374| |74LS374 | |74S240 | | | |
53 * ||| |________|________|_______| |________|_|---------| | |P2 |
54 * ||| | 74F138 |BLANK |74LS374| |74LS374 |74S240 | | | |
55 * ||| |________|________|_______| +----------+---------| | | |
56 * ||| | 74LS08 |74F32 |74LS11|74LS393|74LS393|resistors | | |
57 * ||| |________|________|______|______ |_______|________| | | |
58 * ||| |DM2585 |74F74 |DM2230| 74LS00| 74F02 |74F32 | | | |
59 * ||+---+--------+--------+------+-------+---------+------| | | |
60 * || |74LS74 |74F20 |74S260| 74S74 | 74F08 |74LS02| | | |
61 * || +------------------------------------------+------| | | |
62 * || |DM2353 |74F10 |74F32 | 74LS32| 74F08 |DM2353| |_| |
63 * || +------------------------------------------+------+-+ |___|
64 * || ||------------------------------------------------------------+-+
65 * ||||--||
66 * ||||--||
67 * ||
68 *
69 * History of Motorola VME division (https://en.wikipedia.org/wiki/VMEbus)
70 *------------------------------------------------------------------------
71 * See mvme147.cpp
72 *
73 * Description
74 * ------------
75 * Streaming Tape Controller released 1984 with the following feature set
76 *
77 * - Double High (6U) VMEmodule
78 * - QIC-02 Streaming Tape Interface
79 * - Supports One 01C-02 compatible 1/4-inch Streaming Tape Drive
80 * - Standard VMEbus Interface
81 * - Supports 24- or 32-bit DMA Addressing/16-bit Data
82 * - Generates Seven Levels of VMEbus Interrupts with Programmable Interrupt Vector
83 * - 10 MHz MC68010 Microprocessor
84 * - 90Kb/s Continuous Transfer Rate for QIC-02 Interface, 200Kb/s Burst rate
85 * - Controls Tape Cartridges Offering 20Mb, 45Mb and 60Mb of Formatted Data Storage
86 * - MC68230 PIT-based Timer
87 * - 16Kb of Static RAM Provides Buffer Storage and CPU Workspace
88 * - Multitasking Kernel-based Firmware Package
89 * - Buffered Pipe Communication Protocol Allows Multiple Hosts to Oueue Commands Without Interlock
90 * - High Level Command/Status Packets offer efficient Operating System Support
91 * - Permits Chaining of Host Command
92 *
93 * Address Map
94 * --------------------------------------------------------------------------
95 * Local to VME Decscription
96 * --------------------------------------------------------------------------
97 * 0x000000 Up to 128Kb System ROM with RESET vector
98 * 0x020000 RAM with vectors
99 * 0x020500 RAM Top of stack
100 * 0x040000 PIT device?
101 * 0x060000 RAM?
102 * 0x080000 PIT device?
103 * 0xffff5000 MVME350 - Streaming Tape Controller CLUN $04 - From MVME-166 installation manual
104 * 0xffff5100 MVME350 - Streaming Tape Controller CLUN $05 probably base of shared RAM
105 * --------------------------------------------------------------------------
106 *
107 * Interrupt sources MVME
108 * ----------------------------------------------------------
109 * Description Device Lvl IRQ VME board
110 * /Board Vector Address
111 * ----------------------------------------------------------
112 * On board Sources
113 *
114 * Off board Sources (other VME boards)
115 *
116 * ----------------------------------------------------------
117 *
118 * TODO:
119 * - Dump the ROMs (DONE)
120 * - Setup a working address map (STARTED)
121 * - Get documentation for VME interface
122 * - Add VME bus driver
123 * - Hook up the PITs correctly
124 * - Add a configurable shared memory window between local CPU and the VME bus
125 * - Hook up a CPU board that supports boot from tape (ie MVME-162, MVME 147)
126 * - Get a tape file with a bootable data on it.
127 *
128 ****************************************************************************/
129
130 #include "emu.h"
131 #include "vme_mvme350.h"
132
133 #include "cpu/m68000/m68000.h"
134 #include "machine/68230pit.h"
135
136 #define LOG_GENERAL 0x01
137 #define LOG_SETUP 0x02
138 #define LOG_PRINTF 0x04
139
140 #define VERBOSE 0 //(LOG_PRINTF | LOG_SETUP | LOG_GENERAL)
141
142 #define LOGMASK(mask, ...) do { if (VERBOSE & mask) logerror(__VA_ARGS__); } while (0)
143 #define LOGLEVEL(mask, level, ...) do { if ((VERBOSE & mask) >= level) logerror(__VA_ARGS__); } while (0)
144
145 #define LOG(...) LOGMASK(LOG_GENERAL, __VA_ARGS__)
146 #define LOGSETUP(...) LOGMASK(LOG_SETUP, __VA_ARGS__)
147
148 #if VERBOSE & LOG_PRINTF
149 #define logerror printf
150 #endif
151
152 #ifdef _MSC_VER
153 #define FUNCNAME __func__
154 #else
155 #define FUNCNAME __PRETTY_FUNCTION__
156 #endif
157
158 //**************************************************************************
159 // GLOBAL VARIABLES
160 //**************************************************************************
161
162 DEFINE_DEVICE_TYPE(VME_MVME350, vme_mvme350_card_device, "mvme350", "Motorola MVME-350 Intelligent Tape Controller")
163
164 #define MVME350_CPU_TAG "mvme350_cpu"
165 #define MVME350_ROM "mvme350_rom"
166
mvme350_mem(address_map & map)167 void vme_mvme350_card_device::mvme350_mem(address_map &map)
168 {
169 map.unmap_value_high();
170 map(0x000000, 0x01ffff).rom().region(MVME350_ROM, 0);
171 map(0x020000, 0x03ffff).ram();
172
173 #if 0
174 map(0x040000, 0x040035).rw("pit", FUNC(pit68230_device::read), FUNC(pit68230_device::write)).umask16(0x00ff); /* PIT ?*/
175 map(0x060000, 0x06001f).ram(); /* Area is cleared on start */
176 map(0x080000, 0x080035).rw("pit", FUNC(pit68230_device::read), FUNC(pit68230_device::write)).umask16(0x00ff); /* PIT ?*/
177 #endif
178 //map(0x100000, 0xfeffff).rw(FUNC(vme_mvme350_card_device::vme_a24_r), FUNC(vme_mvme350_card_device::vme_a24_w)); /* VMEbus Rev B addresses (24 bits) - not verified */
179 //map(0xff0000, 0xffffff).rw(FUNC(vme_mvme350_card_device::vme_a16_r), FUNC(vme_mvme350_card_device::vme_a16_w)); /* VMEbus Rev B addresses (16 bits) - not verified */
180 }
181
182 ROM_START( mvme350 )
183 ROM_REGION16_BE(0x20000, MVME350_ROM, 0)
CRC(bcef82ef)184 ROM_LOAD16_BYTE("mvme350u40v2.3.bin", 0x0000, 0x4000, CRC (bcef82ef) SHA1 (e6fdf26e4714cbaeb3e97d7b5acf02d64d8ad744))
185 ROM_LOAD16_BYTE("mvme350u47v2.3.bin", 0x0001, 0x4000, CRC (582ce095) SHA1 (d0929dbfeb0cfda63df6b5bc29ee27fbf665def7))
186 ROM_END
187
188 //-------------------------------------------------
189 // device_add_mconfig - add device configuration
190 //-------------------------------------------------
191
192 void vme_mvme350_card_device::device_add_mconfig(machine_config &config)
193 {
194 /* basic machine hardware */
195 m68010_device &cpu(M68010(config, MVME350_CPU_TAG, XTAL(10'000'000)));
196 cpu.set_addrmap(AS_PROGRAM, &vme_mvme350_card_device::mvme350_mem);
197 /* PIT Parallel Interface and Timer device, assuming strapped for on board clock */
198 PIT68230(config, "pit", XTAL(16'000'000) / 2);
199 }
200
device_rom_region() const201 const tiny_rom_entry *vme_mvme350_card_device::device_rom_region() const
202 {
203 LOG("%s\n", FUNCNAME);
204 return ROM_NAME( mvme350 );
205 }
206
207 //**************************************************************************
208 // LIVE DEVICE
209 //**************************************************************************
210
vme_mvme350_card_device(const machine_config & mconfig,device_type type,const char * tag,device_t * owner,uint32_t clock)211 vme_mvme350_card_device::vme_mvme350_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
212 device_t(mconfig, type, tag, owner, clock),
213 device_vme_card_interface(mconfig, *this)
214 {
215 LOG("%s %s\n", tag, FUNCNAME);
216 }
217
vme_mvme350_card_device(const machine_config & mconfig,const char * tag,device_t * owner,uint32_t clock)218 vme_mvme350_card_device::vme_mvme350_card_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
219 vme_mvme350_card_device(mconfig, VME_MVME350, tag, owner, clock)
220 {
221 LOG("%s %s\n", tag, FUNCNAME);
222 }
223
device_start()224 void vme_mvme350_card_device::device_start()
225 {
226 LOG("%s %s\n", tag(), FUNCNAME);
227 set_vme_device();
228
229 /* Setup r/w handlers for shared memory area */
230 #if 0
231 /* From MVME166 Single Board Computer Installation Guide:
232
233 Controller Type First board Second board
234 CLUN Address CLUN Address
235 ---------------------------------------------------
236 MVME350 - Streaming $04 $FFFF5000 $05 $FFFF5100
237 Tape Controller
238 ---------------------------------------------------
239 */
240 uint32_t base = 0xFFFF5000;
241 m_vme->install_device(base + 0, base + 1, // Channel B - Data
242 read8_delegate(FUNC(z80sio_device::db_r), subdevice<z80sio_device>("pit")), write8_delegate(FUNC(z80sio_device::db_w), subdevice<z80sio_device>("pit")), 0x00ff);
243 m_vme->install_device(base + 2, base + 3, // Channel B - Control
244 read8_delegate(FUNC(z80sio_device::cb_r), subdevice<z80sio_device>("pit")), write8_delegate(FUNC(z80sio_device::cb_w), subdevice<z80sio_device>("pit")), 0x00ff);
245 #endif
246
247 }
248
device_reset()249 void vme_mvme350_card_device::device_reset()
250 {
251 LOG("%s %s\n", tag(), FUNCNAME);
252 }
253
254 #if 0
255 uint16_t vme_mvme350_card_device::read16(){
256 LOG("%s()\n", FUNCNAME);
257 return (uint8_t) 0;
258 }
259
260 void vme_mvme350_card_device::write16(uint16_t data){
261 LOG("%s()\n", FUNCNAME);
262 }
263 #endif
264