summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/isa/bt54x.cpp
blob: 1c3c4bdf3f188d3014a45054e3a65a19269d2159 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
// license:BSD-3-Clause
// copyright-holders:AJR
/***************************************************************************

    BusTek/BusLogic BT-54x series PC/AT SCSI host adapters

    The earlier version of the BT-542B, with BusTek labels, has a NCR 86C05
    bus controller where a later version has the 80C20 ASIC instead. It is
    believed that these chips are largely compatible with each other, as
    are the NCR 53CF94 and Emulex FAS216 SCSI controllers.

    2.41/2.21 is the last BIOS version compatible with revisions A-G of
    the BT-542B.

***************************************************************************/

#include "emu.h"
#include "bt54x.h"

#include "bus/nscsi/devices.h"
#include "machine/ncr5390.h"
//#include "machine/ncr86c05.h"

DEFINE_DEVICE_TYPE(BT542B, bt542b_device, "bt542b", "BusTek BT-542B SCSI Host Adapter") // Rev. G or earlier
DEFINE_DEVICE_TYPE(BT542BH, bt542bh_device, "bt542bh", "BusLogic BT-542B SCSI Host Adapter (Rev. H)")
DEFINE_DEVICE_TYPE(BT545S, bt545s_device, "bt545s", "BusLogic BT-545S Fast SCSI Host Adapter")

bt54x_device::bt54x_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock)
	: device_t(mconfig, type, tag, owner, clock)
	, device_isa16_card_interface(mconfig, *this)
	, m_mpu(*this, "mpu")
	, m_fdc(*this, "fdc")
	, m_bios(*this, "bios")
{
}

bt542b_device::bt542b_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
	: bt54x_device(mconfig, BT542B, tag, owner, clock)
{
}

bt542bh_device::bt542bh_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
	: bt54x_device(mconfig, BT542BH, tag, owner, clock)
{
}

bt545s_device::bt545s_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
	: bt54x_device(mconfig, BT545S, tag, owner, clock)
{
}

void bt54x_device::device_start()
{
}

u8 bt54x_device::local_status_r()
{
	return 0;
}

void bt54x_device::local_map(address_map &map)
{
	map(0x00000, 0x01fff).ram();
	//map(0x02000, 0x0201f).rw("busintf", FUNC(ncr86c05_device::local_read), FUNC(ncr86c05_device::local_write));
	map(0x02080, 0x0208f).m("scsi:7:scsic", FUNC(ncr53cf94_device::map));
	map(0x02180, 0x02180).r(FUNC(bt54x_device::local_status_r));
	map(0xf8000, 0xfffff).rom().region("mpu", 0);
}

void bt54x_device::asc_config(device_t *device)
{
	ncr53c94_device &asc = downcast<ncr53c94_device &>(*device);

	asc.set_clock(25_MHz_XTAL); // not verified; perhaps selectable? (40 MHz XTAL also on board)

	asc.irq_handler_cb().set(m_mpu, FUNC(i80188_cpu_device::int0_w));
	//asc.drq_handler_cb().set("busintf", FUNC(ncr86c05_device::dma_req_w));
}

void bt54x_device::fsc_config(device_t *device)
{
	ncr53cf94_device &fsc = downcast<ncr53cf94_device &>(*device);

	fsc.set_clock(40_MHz_XTAL);

	fsc.irq_handler_cb().set(m_mpu, FUNC(i80188_cpu_device::int0_w)); // mostly polled on BT-545S
	//fsc.drq_handler_cb().set("busintf", FUNC(ncr86c05_device::dma_req_w));
}

void bt54x_device::fsc_base(machine_config &config)
{
	//ncr86c05_device &busintf(NCR86C05(config, "busintf", 0));
	//busintf.mint_callback().set(m_mpu, FUNC(i80188_cpu_device::int1_w));
	//busintf.dma_ack_callback().set("scsi:7:scsic", FUNC(ncr53cf94_device::dma_w));

	NSCSI_BUS(config, "scsi");
	NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:1", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:2", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:3", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:7", default_scsi_devices, "scsic", true)
		.option_add_internal("scsic", NCR53CF94) // FAS216
		.machine_config([this] (device_t *device) { fsc_config(device); });
}

void bt542b_device::device_add_mconfig(machine_config &config)
{
	I80188(config, m_mpu, 16_MHz_XTAL);
	m_mpu->set_addrmap(AS_PROGRAM, &bt542b_device::local_map);

	//ncr86c05_device &busintf(NCR86C05(config, "busintf", 0));
	//busintf.mint_callback().set(m_mpu, FUNC(i80188_cpu_device::int1_w));
	//busintf.dma_ack_callback().set("scsi:7:scsic", FUNC(ncr53c94_device::dma_w));

	NSCSI_BUS(config, "scsi");
	NSCSI_CONNECTOR(config, "scsi:0", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:1", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:2", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:3", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:4", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:5", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:6", default_scsi_devices, nullptr);
	NSCSI_CONNECTOR(config, "scsi:7", default_scsi_devices, "scsic", true)
		.option_add_internal("scsic", NCR53C94)
		.machine_config([this] (device_t *device) { asc_config(device); });

	DP8473(config, m_fdc, 24_MHz_XTAL);
}

void bt542bh_device::device_add_mconfig(machine_config &config)
{
	I80188(config, m_mpu, 40_MHz_XTAL / 2); // clock guessed
	m_mpu->set_addrmap(AS_PROGRAM, &bt542bh_device::local_map);

	fsc_base(config);

	DP8473(config, m_fdc, 24_MHz_XTAL);
}

void bt545s_device::device_add_mconfig(machine_config &config)
{
	I80188(config, m_mpu, 40_MHz_XTAL / 2); // SAB80188-1-N; clock guessed
	m_mpu->set_addrmap(AS_PROGRAM, &bt545s_device::local_map);

	fsc_base(config);

	PC8477A(config, m_fdc, 24_MHz_XTAL); // actually PC8477BV
}

ROM_START(bt542b)
	ROM_REGION(0x4000, "bios", 0) // "(C) Copyright 1991     BIOS Version 2.41"
	ROM_LOAD("1000006-2.41_bustek.u15", 0x0000, 0x4000, CRC(5eb00d0f) SHA1(74a8bbae1c2b42f0c605b0ac98660f1e16ac5c4e))

	ROM_REGION(0x8000, "mpu", 0) // "(C) Copyright 1991 BusTek Corporation 542B 91/12/14"
	ROM_LOAD("1000005-2.21_bustek.u2", 0x0000, 0x8000, CRC(c2c66653) SHA1(054ba1ea71b2aaab31ab9dd5aca955d861f5333b))
ROM_END

ROM_START(bt542bh)
	ROM_REGION(0x8000, "bios", 0) // "(C) Copyright 1992     BIOS Version 4.70M"
	ROM_LOAD("5000006-4.70_buslogic.u15", 0x0000, 0x8000, CRC(f5a5e116) SHA1(d7b73015532838dc694edf24308ebbab6f4dd5bb))

	ROM_REGION(0x8000, "mpu", 0) // "(C) Copyright 1992 BusLogic Inc.      542BH93/05/23"
	ROM_LOAD("5000005-3.35_buslogic.u2", 0x0000, 0x8000, CRC(181966c3) SHA1(b9b327d50cd13f3e5b5b53892b18f233aff065b7))
ROM_END

ROM_START(bt545s)
	ROM_REGION(0x4000, "bios", 0) // "(C) Copyright 1992     BIOS Version 4.50"
	ROM_LOAD("u15_27128_5002026-4.50.bin", 0x0000, 0x4000, CRC(1bd3247b) SHA1(9d46a99f4b3057e94ef422f387218de2c4553c1a))

	ROM_REGION(0x8000, "mpu", 0) // "(C) Copyright 1992 BusLogic Inc.      542BH92/10/05"
	ROM_LOAD("u2_27256_5002005-3.31.bin", 0x0000, 0x8000, CRC(20473714) SHA1(797a8dba182049949f7a5c14d8bef4b4e908305b))
ROM_END

const tiny_rom_entry *bt542b_device::device_rom_region() const
{
	return ROM_NAME(bt542b);
}

const tiny_rom_entry *bt542bh_device::device_rom_region() const
{
	return ROM_NAME(bt542bh);
}

const tiny_rom_entry *bt545s_device::device_rom_region() const
{
	return ROM_NAME(bt545s);
}