diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-12-25 21:01:02 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-12-25 21:01:02 +0000 |
commit | d53c70a99ed209b0d5111d33d1e336dcbbc78cf6 (patch) | |
tree | 7cd8a2547c32ccf8484c05e3aa5e481f90b28a45 /sys/dev | |
parent | a56ca9242c27a7d1082e220dabf563c0221630fc (diff) |
Instead of deciding which iockbc port is the keyboard port, and which one is the
mouse port, depending upon the system time, match what the prom is doing and
actually probe for a keyboard on both ports, and decide the first port with a
keyboard is the keyboard port.
If no keyboard is found, but a mouse is found, decide the keyboard port is the
empty one.
If no device is found, then we can try and pick the defaults, depending upon
the system we are running on, as this used to be the case (i.e. coping with
Fuel having keyboard on port 1 and mouse on port 0 when connecting devices
according to the chassis' markings).
This is necessary because different IO9 board revisions on Tezro come with
different wirings, and we can not tell these boards apart.
Discussed with "nullnilaki" (nullnilaki on gmail) who is the lucky owner of an
Onyx 350 with correct wiring and a Tezro with inverted wiring. Tested on Octane
and Fuel with all combinations of devices connected (mouse only, keyboard only,
keyboard and mouse) in both ports, glass and serial console.
XXX We probably want to allow for more pckbd attachment flexibility on non-x86
XXX platforms eventually (at least where the PS/2 slots are really independent,
XXX so that we can attach pckbd to any port and better cope with human error
XXX when connecting devices.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/i8042reg.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/ic/i8042reg.h b/sys/dev/ic/i8042reg.h index 9bbd3a9c757..ef3ad189a22 100644 --- a/sys/dev/ic/i8042reg.h +++ b/sys/dev/ic/i8042reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i8042reg.h,v 1.7 2013/05/23 18:29:51 tobias Exp $ */ +/* $OpenBSD: i8042reg.h,v 1.8 2013/12/25 21:01:01 miod Exp $ */ /* $NetBSD: i8042reg.h,v 1.7 1998/01/18 14:41:37 drochner Exp $ */ #define KBSTATP 4 /* kbd controller status port (I) */ @@ -25,6 +25,7 @@ #define KBC_KBDTEST 0xab /* test keyboard port */ #define KBC_KBDDISABLE 0xad /* disable keyboard port */ #define KBC_KBDENABLE 0xae /* enable keyboard port */ +#define KBC_READID 0xf2 /* read device id */ #define KBC_PULSE0 0xfe /* pulse output bit 0 */ #define KBC_PULSE1 0xfd /* pulse output bit 1 */ #define KBC_PULSE2 0xfb /* pulse output bit 2 */ @@ -44,3 +45,7 @@ #define KC8_MENABLE 0x02 /* enable mouse interrupt */ #define KC8_KENABLE 0x01 /* enable keyboard interrupt */ #define CMDBYTE (KC8_TRANS|KC8_CPU|KC8_MENABLE|KC8_KENABLE) + +#define KCID_KBD1 0xAB +#define KCID_KBD2 0x83 +#define KCID_MOUSE 0x00 |