summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2005-04-07 17:15:10 +0000
committersobomax <sobomax@FreeBSD.org>2005-04-07 17:15:10 +0000
commit80da76bc5041a75d882110b83cf10ca98ce646b8 (patch)
tree6ab8593c5a0d3cae64cafc06661c5ec6686cdb07
parentebb3a9b55bc4865ab615fc039c3b9bd3ff2ef685 (diff)
downloadFreeBSD-src-80da76bc5041a75d882110b83cf10ca98ce646b8.zip
FreeBSD-src-80da76bc5041a75d882110b83cf10ca98ce646b8.tar.gz
Provide a new tunable hw.atkbdc.broken_kit_cmd, which if set to 1
instructs the driver to avoid using Keyboard Interface Test command. This command causes problems with some non-compliant hardware, resulting in machine being abruptly powered down early in the boot process. Particularly it's known that HP ZV5000 and Compaq R3000Z notebooks are affected by this problem. Due to popularity of those models this patch is good MFC5.4 candidate. PR: 67745 Submitted by: Jung-uk Kim jkim at niksun.com MFC after: 1 days
-rw-r--r--share/man/man4/atkbdc.47
-rw-r--r--sys/dev/atkbdc/atkbdc.c15
-rw-r--r--sys/dev/kbd/atkbdc.c15
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))
OpenPOWER on IntegriCloud