Change the way the aux port is probed for. Some older chipsets w/o

mouse port seem to interpret the "test aux port" (0xa9) command differently,
leading to a non-working keyboard.
Now we try to echo a byte through the aux port by means of the "echo aux"
(0xd3) command, which is what Linux does.
Thanks to Christoph Badura for detailed reports and testing.
This commit is contained in:
drochner 2001-04-09 15:45:50 +00:00
parent e637d8a38d
commit 9e9590f441
1 changed files with 18 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pckbc.c,v 1.5 2000/06/09 04:58:35 soda Exp $ */ /* $NetBSD: pckbc.c,v 1.6 2001/04/09 15:45:50 drochner Exp $ */
/* /*
* Copyright (c) 1998 * Copyright (c) 1998
@ -357,26 +357,31 @@ pckbc_attach(sc)
#endif /* 0 */ #endif /* 0 */
/* /*
* check aux port ok * Check aux port ok.
* Avoid KBC_AUXTEST because it hangs some older controllers
* (eg UMC880?).
*/ */
if (!pckbc_send_cmd(iot, ioh_c, KBC_AUXTEST)) if (!pckbc_send_cmd(iot, ioh_c, KBC_AUXECHO)) {
return; printf("kbc: aux echo error 1\n");
res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_KBD_SLOT, 0); goto nomouse;
}
if (res == 0 || res == 0xfa || res == 0x01) { if (!pckbc_wait_output(iot, ioh_c)) {
#ifdef PCKBCDEBUG printf("kbc: aux echo error 2\n");
if (res != 0) goto nomouse;
printf("kbc: returned %x on aux slot test\n", res); }
#endif bus_space_write_1(iot, ioh_d, 0, 0x5a); /* a random value */
res = pckbc_poll_data1(iot, ioh_d, ioh_c, PCKBC_AUX_SLOT, 1);
if (res == 0x5a) {
t->t_haveaux = 1; t->t_haveaux = 1;
if (pckbc_attach_slot(sc, PCKBC_AUX_SLOT)) if (pckbc_attach_slot(sc, PCKBC_AUX_SLOT))
cmdbits |= KC8_MENABLE; cmdbits |= KC8_MENABLE;
} }
#ifdef PCKBCDEBUG #ifdef PCKBCDEBUG
else else
printf("kbc: aux port test: %x\n", res); printf("kbc: aux echo: %x\n", res);
#endif #endif
nomouse:
/* enable needed interrupts */ /* enable needed interrupts */
t->t_cmdbyte |= cmdbits; t->t_cmdbyte |= cmdbits;
if (!pckbc_put8042cmd(t)) if (!pckbc_put8042cmd(t))