From: Andries Brouwer <aebr@win.tue.nl>
To: Jaco Kroon <jaco@kroon.co.za>
Cc: sebekpi@poczta.onet.pl, Vojtech Pavlik <vojtech@suse.cz>,
Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: i8042 access timings
Date: Thu, 27 Jan 2005 21:23:15 +0100 [thread overview]
Message-ID: <20050127202315.GC6010@pclin040.win.tue.nl> (raw)
In-Reply-To: <41F888CB.8090601@kroon.co.za>
On Thu, Jan 27, 2005 at 08:23:07AM +0200, Jaco Kroon wrote:
> i8042_check_aux: param_in=0x5a, command=AUX_LOOP, param_out=5a <= -1
> i8042_check_aux: param_in=??, command=AUX_TEST, param_out=a5 <= 0
The code is
param = 0x5a;
if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xa5) {
if (i8042_command(¶m, I8042_CMD_AUX_TEST)
|| (param && param != 0xfa && param != 0xff))
return -1;
}
where
#define I8042_CMD_AUX_LOOP 0x11d3: write d3, write 5a, read ->param
#define I8042_CMD_AUX_TEST 0x01a9: write a9, read ->param
In my docs (http://www.win.tue.nl/~aeb/linux/kbd/scancodes-10.html#ss10.3)
d3 is classified under "Obscure, probably obsolete, commands".
The reason is that there is hardware that does not implement d3.
Originally it was special to MCA. Later it was also used as part of
the Synaptics multiplexing handshake.
Now you read one byte after the command a9 and get a5 - clearly the 5a
that was written and complemented. So it looks like the d3 really worked.
The first i8042_command() returned -1, but it really wrote the 5a,
so it did i8042_write_command(d3) and i8042_write_data(5a) and then
the i8042_wait_read() returned -1, a timeout.
Since the byte was there to read, the flag was lost that indicated
that data was available. Hmm. Sequence of actions:
inb(64); // until bit 1 clear
outb(d3, 64);
inb(64); // until bit 1 clear
outb(5a, 60);
inb(64); // until bit 0 set - timeout
inb(64); // until bit 1 clear
outb(a9, 64);
inb(64); // until bit 0 set
inb(64); // test for AUX
inb(60);
I am afraid I don't understand what happens.
One can imagine that the second inb(64) comes too quickly
so that we write the 5a too quickly. But all happens as it
should: the d3 is executed, the 5a is moved from input buffer
to output buffer, the AUXB bit is set, only the ready flag never comes,
not within I8042_CTL_TIMEOUT=10000 times 50 usec, that is 0.5 sec.
By the way, I have some old docs that describe sending a command by
repeat inb(64) until bit 1 clear
outb(cmd, 64)
repeat inb(64) until bit 1 set
and we only do the first half.
Andries
next prev parent reply other threads:[~2005-01-27 20:23 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200501260040.46288.sebekpi@poczta.onet.pl>
2005-01-27 6:23 ` Jaco Kroon
2005-01-27 10:25 ` Vojtech Pavlik
2005-01-27 11:12 ` Sebastian Piechocki
2005-01-27 11:31 ` Vojtech Pavlik
2005-01-27 17:33 ` Jaco Kroon
2005-01-27 18:09 ` Linus Torvalds
2005-01-27 20:29 ` Andries Brouwer
2005-01-27 20:41 ` Dmitry Torokhov
2005-01-27 23:11 ` Andries Brouwer
2005-01-28 13:17 ` Vojtech Pavlik
2005-01-28 14:20 ` Jaco Kroon
2005-01-28 18:39 ` Vojtech Pavlik
2005-01-29 19:59 ` Jaco Kroon
2005-01-29 23:21 ` Dmitry Torokhov
2005-01-29 20:02 ` Randy.Dunlap
2005-01-27 20:51 ` Jaco Kroon
2005-01-27 21:17 ` Linus Torvalds
2005-01-27 22:12 ` Jaco Kroon
2005-01-27 22:36 ` Linus Torvalds
2005-01-27 23:40 ` Dmitry Torokhov
2005-01-28 5:52 ` Jaco Kroon
2005-02-04 19:54 ` Bukie Mabayoje
2005-01-28 11:04 ` Vojtech Pavlik
2005-01-27 20:23 ` Andries Brouwer [this message]
2005-01-25 7:41 Dmitry Torokhov
2005-01-25 10:51 ` Andries Brouwer
2005-01-25 19:17 ` Dmitry Torokhov
2005-01-25 19:25 ` Vojtech Pavlik
2005-01-25 19:41 ` Dmitry Torokhov
2005-01-25 19:46 ` Andries Brouwer
2005-01-25 20:37 ` Lee Revell
2005-01-27 15:14 ` Alan Cox
2005-01-27 16:24 ` Vojtech Pavlik
2005-01-27 16:34 ` Bill Rugolsky Jr.
2005-01-27 16:37 ` Vojtech Pavlik
2005-02-13 0:16 ` Bill Rugolsky Jr.
2005-02-13 8:22 ` Vojtech Pavlik
2005-02-13 16:17 ` Bill Rugolsky Jr.
2005-01-27 17:45 ` Andries Brouwer
2005-01-28 14:55 ` Vojtech Pavlik
2005-01-25 12:44 ` Alan Cox
2005-01-25 12:44 ` Alan Cox
2005-01-26 15:43 ` Vojtech Pavlik
2005-01-26 16:36 ` Dmitry Torokhov
2005-01-26 17:05 ` linux-os
2005-01-26 18:30 ` Dmitry Torokhov
2005-01-27 10:19 ` Vojtech Pavlik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050127202315.GC6010@pclin040.win.tue.nl \
--to=aebr@win.tue.nl \
--cc=akpm@osdl.org \
--cc=jaco@kroon.co.za \
--cc=linux-kernel@vger.kernel.org \
--cc=sebekpi@poczta.onet.pl \
--cc=torvalds@osdl.org \
--cc=vojtech@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®