diff options
author | kato <kato@FreeBSD.org> | 1999-12-07 09:32:59 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1999-12-07 09:32:59 +0000 |
commit | d29133dba78088590a688c17b161e9000781e9cf (patch) | |
tree | eca926122052798ef2945c4474654ab557291ed0 /sys/pc98 | |
parent | bd54a04707bf56e9589a7a22a7ea57efdb87401a (diff) | |
download | FreeBSD-src-d29133dba78088590a688c17b161e9000781e9cf.zip FreeBSD-src-d29133dba78088590a688c17b161e9000781e9cf.tar.gz |
Merge from sys/isa/fd.c rev 1.170.
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/fdc.c | 29 | ||||
-rw-r--r-- | sys/pc98/pc98/fd.c | 29 |
2 files changed, 46 insertions, 12 deletions
diff --git a/sys/pc98/cbus/fdc.c b/sys/pc98/cbus/fdc.c index 8da7150..94a29e7 100644 --- a/sys/pc98/cbus/fdc.c +++ b/sys/pc98/cbus/fdc.c @@ -819,13 +819,30 @@ fdc_probe(device_t dev) fdc->porth = rman_get_bushandle(fdc->res_ioport); #ifndef PC98 + /* + * Some bios' report the device at 0x3f2-0x3f5,0x3f7 and some at + * 0x3f0-0x3f5,0x3f7. We detect the former by checking the size + * and adjust the port address accordingly. + * + * And some (!!) report 0x3f2-0x3f5 and completely leave out the + * control register! It seems that some non-antique controller chips + * have a different method of programming the transfer speed which + * doesn't require the control register, but it's mighty bogus as the + * chip still responds to the address for the control register. + * This hack is truely evil as we use the 6th port in a 4-port chunk. + */ + /* 0x3f2-0x3f5 */ + if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 4 && + bus_get_resource_count(dev, SYS_RES_IOPORT, 1) == 0) { + fdc->port_off = -2; + ispnp = 0; /* hack, don't reserve second port chunk */ + } + /* 0x3f0-0x3f5 */ + if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 6 && + bus_get_resource_count(dev, SYS_RES_IOPORT, 1) == 0) { + ispnp = 0; /* hack, don't reserve second port chunk */ + } if (ispnp) { - /* - * Some bios' report the device at 0x3f2-0x3f5,0x3f7 - * and some at 0x3f0-0x3f5,0x3f7. We detect the former - * by checking the size and adjust the port address - * accordingly. - */ if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 4) fdc->port_off = -2; fdc->flags |= FDC_ISPNP; diff --git a/sys/pc98/pc98/fd.c b/sys/pc98/pc98/fd.c index 8da7150..94a29e7 100644 --- a/sys/pc98/pc98/fd.c +++ b/sys/pc98/pc98/fd.c @@ -819,13 +819,30 @@ fdc_probe(device_t dev) fdc->porth = rman_get_bushandle(fdc->res_ioport); #ifndef PC98 + /* + * Some bios' report the device at 0x3f2-0x3f5,0x3f7 and some at + * 0x3f0-0x3f5,0x3f7. We detect the former by checking the size + * and adjust the port address accordingly. + * + * And some (!!) report 0x3f2-0x3f5 and completely leave out the + * control register! It seems that some non-antique controller chips + * have a different method of programming the transfer speed which + * doesn't require the control register, but it's mighty bogus as the + * chip still responds to the address for the control register. + * This hack is truely evil as we use the 6th port in a 4-port chunk. + */ + /* 0x3f2-0x3f5 */ + if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 4 && + bus_get_resource_count(dev, SYS_RES_IOPORT, 1) == 0) { + fdc->port_off = -2; + ispnp = 0; /* hack, don't reserve second port chunk */ + } + /* 0x3f0-0x3f5 */ + if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 6 && + bus_get_resource_count(dev, SYS_RES_IOPORT, 1) == 0) { + ispnp = 0; /* hack, don't reserve second port chunk */ + } if (ispnp) { - /* - * Some bios' report the device at 0x3f2-0x3f5,0x3f7 - * and some at 0x3f0-0x3f5,0x3f7. We detect the former - * by checking the size and adjust the port address - * accordingly. - */ if (bus_get_resource_count(dev, SYS_RES_IOPORT, 0) == 4) fdc->port_off = -2; fdc->flags |= FDC_ISPNP; |