diff options
-rw-r--r-- | share/man/man4/atkbdc.4 | 7 | ||||
-rw-r--r-- | sys/dev/atkbdc/atkbdc.c | 15 | ||||
-rw-r--r-- | sys/dev/kbd/atkbdc.c | 15 |
3 files changed, 37 insertions, 0 deletions
diff --git a/share/man/man4/atkbdc.4 b/share/man/man4/atkbdc.4 index 46d30c1..05a18d1 100644 --- a/share/man/man4/atkbdc.4 +++ b/share/man/man4/atkbdc.4 @@ -42,6 +42,13 @@ In .Pa /boot/device.hints : .Cd hint.atkbdc.0.at="isa" .Cd hint.atkbdc.0.port="0x060" +.Pp +The following tunables are settable from the loader: +.Bl -ohang +.It Va hw.atkbdc.broken_kit_cmd +set to 1 to disable using Keyboard Interface Test command, which +may cause problems with some non-compliant hardware, resulting in +machine being powered down early in the boot process. .Sh DESCRIPTION The keyboard controller .Nm diff --git a/sys/dev/atkbdc/atkbdc.c b/sys/dev/atkbdc/atkbdc.c index 7fc2325..0e1fdea 100644 --- a/sys/dev/atkbdc/atkbdc.c +++ b/sys/dev/atkbdc/atkbdc.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/kernel.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <machine/bus_pio.h> @@ -941,6 +942,17 @@ test_controller(KBDC p) return (c == KBD_DIAG_DONE); } +/* + * Provide a way to disable using Keyboard Interface Test command, which may + * cause problems with some non-compliant hardware, resulting in machine + * being powered down early in the boot process. + * + * Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks are + * affected. + */ +static int broken_kit_cmd = 0; +TUNABLE_INT("hw.atkbdc.broken_kit_cmd", &broken_kit_cmd); + int test_kbd_port(KBDC p) { @@ -948,6 +960,9 @@ test_kbd_port(KBDC p) int again = KBD_MAXWAIT; int c = -1; + if (broken_kit_cmd != 0) + return 0; + while (retry-- > 0) { empty_both_buffers(p, 10); if (write_controller_command(p, KBDC_TEST_KBD_PORT)) diff --git a/sys/dev/kbd/atkbdc.c b/sys/dev/kbd/atkbdc.c index 7fc2325..0e1fdea 100644 --- a/sys/dev/kbd/atkbdc.c +++ b/sys/dev/kbd/atkbdc.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/bus.h> +#include <sys/kernel.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <machine/bus_pio.h> @@ -941,6 +942,17 @@ test_controller(KBDC p) return (c == KBD_DIAG_DONE); } +/* + * Provide a way to disable using Keyboard Interface Test command, which may + * cause problems with some non-compliant hardware, resulting in machine + * being powered down early in the boot process. + * + * Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks are + * affected. + */ +static int broken_kit_cmd = 0; +TUNABLE_INT("hw.atkbdc.broken_kit_cmd", &broken_kit_cmd); + int test_kbd_port(KBDC p) { @@ -948,6 +960,9 @@ test_kbd_port(KBDC p) int again = KBD_MAXWAIT; int c = -1; + if (broken_kit_cmd != 0) + return 0; + while (retry-- > 0) { empty_both_buffers(p, 10); if (write_controller_command(p, KBDC_TEST_KBD_PORT)) |