summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authortanimura <tanimura@FreeBSD.org>2000-07-11 11:49:33 +0000
committertanimura <tanimura@FreeBSD.org>2000-07-11 11:49:33 +0000
commit7716c5370ad4c724650bb6def35750d561bc11d2 (patch)
tree9a29f2cea6e8dc8339d0261df8deae0201372989 /sys/isa
parent6cecb051f3990a02c86edb2060aa93c44e6d49da (diff)
downloadFreeBSD-src-7716c5370ad4c724650bb6def35750d561bc11d2.zip
FreeBSD-src-7716c5370ad4c724650bb6def35750d561bc11d2.tar.gz
Finally merge newmidi.
(I had been busy for my own research activity until the last weekend) Supported devices: SB Midi Port (sbc + midi) SB OPL3 (sbc + midi) 16550 UART (midi, needs a trick in your hint) CS461x Midi Port (csa + midi) OSS-compatible sequencer (seq) Supported playing software: playmidi (We definitely need more) Notes: /dev/midistat now reports installed midi drivers. /dev/sndstat reports only pcm drivers. We need the new name(pcmstat?). EMU8000(SB AWE) does not sound yet but does get probed so that the OPL3 synth on an AWE card works. TODO: MSS/PCI bridge drivers Midi-tty interface to support general serial devices Modules
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/pnp.c47
-rw-r--r--sys/isa/pnpparse.c5
-rw-r--r--sys/isa/pnpvar.h4
3 files changed, 49 insertions, 7 deletions
diff --git a/sys/isa/pnp.c b/sys/isa/pnp.c
index 12b5dab..f9266bb 100644
--- a/sys/isa/pnp.c
+++ b/sys/isa/pnp.c
@@ -54,6 +54,7 @@ struct pnp_quirk {
u_int32_t logical_id; /* ID of the device with quirk */
int type;
#define PNP_QUIRK_WRITE_REG 1 /* Need to write a pnp register */
+#define PNP_QUIRK_EXTRA_IO 2 /* Has extra io ports */
int arg1;
int arg2;
};
@@ -66,6 +67,24 @@ struct pnp_quirk pnp_quirks[] = {
*/
{ 0x0100561e /* GRV0001 */, 0,
PNP_QUIRK_WRITE_REG, 0xf2, 0xff },
+ /*
+ * An emu8000 does not give us other than the first
+ * port.
+ */
+ { 0x26008c0e /* SB16 */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x42008c0e /* SB32(CTL0042) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x44008c0e /* SB32(CTL0044) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0x49008c0e /* SB32(CTL0049) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xf1008c0e /* SB32(CTL00f1) */, 0x21008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xc1008c0e /* SB64(CTL00c1) */, 0x22008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
+ { 0xe4008c0e /* SB64(CTL00e4) */, 0x22008c0e,
+ PNP_QUIRK_EXTRA_IO, 0x400, 0x800 },
{ 0 }
};
@@ -363,8 +382,8 @@ pnp_set_config(void *arg, struct isa_config *config, int enable)
/*
* Process quirks for a logical device.. The card must be in Config state.
*/
-static void
-pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn)
+void
+pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn, struct isa_config *config)
{
struct pnp_quirk *qp;
@@ -377,6 +396,22 @@ pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn)
pnp_write(PNP_SET_LDN, ldn);
pnp_write(qp->arg1, qp->arg2);
break;
+ case PNP_QUIRK_EXTRA_IO:
+ if (config == NULL)
+ break;
+ if (qp->arg1 != 0) {
+ config->ic_nport++;
+ config->ic_port[config->ic_nport - 1] = config->ic_port[0];
+ config->ic_port[config->ic_nport - 1].ir_start += qp->arg1;
+ config->ic_port[config->ic_nport - 1].ir_end += qp->arg1;
+ }
+ if (qp->arg2 != 0) {
+ config->ic_nport++;
+ config->ic_port[config->ic_nport - 1] = config->ic_port[0];
+ config->ic_port[config->ic_nport - 1].ir_start += qp->arg2;
+ config->ic_port[config->ic_nport - 1].ir_end += qp->arg2;
+ }
+ break;
}
}
}
@@ -461,7 +496,8 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
*/
if (startres) {
pnp_parse_resources(dev, startres,
- resinfo - startres - 1);
+ resinfo - startres - 1,
+ p->vendor_id, logical_id, ldn);
dev = 0;
startres = 0;
}
@@ -471,7 +507,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
* resources.
*/
bcopy(resinfo, &logical_id, 4);
- pnp_check_quirks(p->vendor_id, logical_id, ldn);
+ pnp_check_quirks(p->vendor_id, logical_id, ldn, NULL);
compat_id = 0;
dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1);
if (desc)
@@ -502,7 +538,8 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn,
break;
}
pnp_parse_resources(dev, startres,
- resinfo - startres - 1);
+ resinfo - startres - 1,
+ p->vendor_id, logical_id, ldn);
dev = 0;
startres = 0;
scanning = 0;
diff --git a/sys/isa/pnpparse.c b/sys/isa/pnpparse.c
index c6c0869..dfb5c33 100644
--- a/sys/isa/pnpparse.c
+++ b/sys/isa/pnpparse.c
@@ -47,7 +47,7 @@
* Resource Data or it reaches the end of Resource Data.
*/
void
-pnp_parse_resources(device_t dev, u_char *resources, int len)
+pnp_parse_resources(device_t dev, u_char *resources, int len, u_int32_t vendor_id, u_int32_t logical_id, int ldn)
{
device_t parent = device_get_parent(dev);
u_char tag, *resp, *resinfo;
@@ -189,6 +189,9 @@ pnp_parse_resources(device_t dev, u_char *resources, int len)
config->ic_port[config->ic_nport].ir_align =
resinfo[5];
config->ic_nport++;
+ pnp_check_quirks(vendor_id,
+ logical_id,
+ ldn, config);
break;
case PNP_TAG_IO_FIXED:
diff --git a/sys/isa/pnpvar.h b/sys/isa/pnpvar.h
index 0e7dee9..050adb9 100644
--- a/sys/isa/pnpvar.h
+++ b/sys/isa/pnpvar.h
@@ -53,7 +53,9 @@ u_char pnp_read(int d); /* currently unused, but who knows... */
| (PNP_HEXTONUM(s[5]) << 28))
char *pnp_eisaformat(u_int32_t id);
-void pnp_parse_resources(device_t dev, u_char *resources, int len);
+void pnp_parse_resources(device_t dev, u_char *resources, int len, u_int32_t vendor_id, u_int32_t logical_id, int ldn);
+
+void pnp_check_quirks(u_int32_t vendor_id, u_int32_t logical_id, int ldn, struct isa_config *config);
#endif /* _KERNEL */
OpenPOWER on IntegriCloud