diff options
author | jkim <jkim@FreeBSD.org> | 2006-07-03 23:40:58 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2006-07-03 23:40:58 +0000 |
commit | 2debd6219b428577d7c111ee9caa1a815a20a388 (patch) | |
tree | 2664044863cb6ba465c3bfbe43c25b920771d11b /sys/dev/atkbdc | |
parent | 47919b584ba9f4b69650f676210268ff9990b140 (diff) | |
download | FreeBSD-src-2debd6219b428577d7c111ee9caa1a815a20a388.zip FreeBSD-src-2debd6219b428577d7c111ee9caa1a815a20a388.tar.gz |
Make sure command/data port (0x60) and status port (0x64) are in correct
order. Some brain-damaged ACPI BIOS has reversed resources.
Diffstat (limited to 'sys/dev/atkbdc')
-rw-r--r-- | sys/dev/atkbdc/atkbdc_isa.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c index ca63a8a..4f535db 100644 --- a/sys/dev/atkbdc/atkbdc_isa.c +++ b/sys/dev/atkbdc/atkbdc_isa.c @@ -112,15 +112,21 @@ atkbdc_isa_probe(device_t dev) * The AT keyboard controller uses two ports (a command/data port * 0x60 and a status port 0x64), which may be given to us in * one resource (0x60 through 0x64) or as two separate resources - * (0x60 and 0x64). Furthermore, /boot/device.hints may contain - * just one port, 0x60. We shall adjust resource settings - * so that these two ports are available as two separate resources. + * (0x60 and 0x64). Some brain-damaged ACPI BIOS has reversed + * command/data port and status port. Furthermore, /boot/device.hints + * may contain just one port, 0x60. We shall adjust resource settings + * so that these two ports are available as two separate resources + * in correct order. */ device_quiet(dev); rid = 0; if (bus_get_resource(dev, SYS_RES_IOPORT, rid, &start, &count) != 0) return ENXIO; - if (count > 1) /* adjust the count */ + if (start == IO_KBD + KBD_STATUS_PORT) { + start = IO_KBD; + count++; + } + if (count > 1) /* adjust the count and/or start port */ bus_set_resource(dev, SYS_RES_IOPORT, rid, start, 1); port0 = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); if (port0 == NULL) |