mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.3-bk7 i8042 does not work on a genuine i386 ibm ps/2 model 70.
Date: 03 Mar 2004 11:51:33 -0700	[thread overview]
Message-ID: <m1znax3gsq.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20040303101347.GB310@ucw.cz>

Vojtech Pavlik <vojtech@suse.cz> writes:

> On Sun, Feb 29, 2004 at 07:32:19AM -0700, Eric W. Biederman wrote:
> > 
> > The i8042 driver attempts to detect if IBM PC compatiblity mode i.e.
> > I8042_CTR_XLATE is enabled.  Unfortunately on a genuine IBM PS/2, (a pc
> > incompatible :) this does not work. 
> > 
> > In i8042_controller_init if I disable the detection of the keyboard
> > not being in XLATE mode everything works fine.
> > 
> > /*
> >  * If the chip is configured into nontranslated mode by the BIOS, don't
> >  * bother enabling translating and be happy.
> >  */     
> > #if 0
> > 
> > 	if (~i8042_ctr & I8042_CTR_XLATE)
> > 		i8042_direct = 1;
> > #endif
> > 
> > 
> > The value of i8042_initial_ctr is 0x25 in case that helps.
> > 
> > I am not certain where to proceed from here.
> 
> This bit is an equivalent to 2.4 code in pc_keyb.c, that adds a
> workaround for IBM PowerPC portables, which don't seem to support
> translated mode:
> 
>        /* ibm powerpc portables need this to use scan-code set 1 -- Cort * */
>         if (!(kbd_write_command_w_and_wait(KBD_CCMD_READ_MODE) & KBD_MODE_KCC))
>         {
>                 /*
>                  * If the controller does not support conversion,
>                  * Set the keyboard to scan-code set 1.
>                  */
>                 kbd_write_output_w(0xF0);
>                 kbd_wait_for_input();
>                 kbd_write_output_w(0x01);
>                 kbd_wait_for_input();
>         }
> 
> As you can see, this sets the keyboard to scancode set 1, if
> KBD_MODE_KCC (which is 0x40, same as I8042_CTR_XLATE), bit is set.
> 
> This should break your keyboard as well, if it supports mode setting.
> 
> I guess we could kill that bit, and ignore the old PowerPCs ....

I will check what happens this evening.  But that sounds exactly
what is happening with my keyboard.  The scan codes I see are in
set 1.

> > The piece I am certain about is that the keyboard controller has
> > traditionally been a tiny microcontroller on PCs so that there is a
> > wide variance in the commands and the exact format that they support.
> 
> Yes. The translate/don't bit is documented by IBM, though.

Any pointers to the docs?

> > And so far every data sheet I have looked at the documentation is
> > slightly different.  The only real intel datasheet I could find was
> > for the i8741A.  And it does not document the traditional interface
> > implemented but the i8042, because that was done in firmware.
> > 
> > This machine is primarily a test machine to make certain my code
> > works on older hardware.  So I am willing try any interesting or
> > likely patches.
> 
> Does the machine by any chance have a PS/2 mouse port? If not, it may be
> the reason - it would have an AT-style i8042, and those might not be
> implementing that bit.

Yes.  But the plugs are clearly labeled which is for the keyboard
and which is for the mouse.

> We could skip the above check if we don't detect the AUX port.

Interesting.

Eric

  parent reply	other threads:[~2004-03-03 18:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-29 14:32 Eric W. Biederman
2004-03-03 10:13 ` Vojtech Pavlik
2004-03-03 14:05   ` David Weinehall
2004-03-03 14:12     ` Vojtech Pavlik
2004-03-03 18:51   ` Eric W. Biederman [this message]
2004-03-03 20:30     ` Eric W. Biederman
2004-03-04  6:45       ` [PATCH] 2.6.4-rc1 make i8042 " Eric W. Biederman

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=m1znax3gsq.fsf@ebiederm.dsl.xmission.com \
    --to=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.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®