[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linuxbios
Subject:    Re: [coreboot] Keyboard not working on Thinkpad X60/T60
From:       Josh Stump <josh+coreboot () pcinw ! net>
Date:       2011-05-31 19:05:03
Message-ID: BANLkTimpNceCZgbkzkT9YjM-z9d_GA9zbw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I know this is off topic, but how did you get corebios flashed to the T60?
 Is there a software based way or must I get hardware in order to do it?

On Sat, May 28, 2011 at 7:23 AM, Sven Schnelle <svens@stackframe.org> wrote:

> Hi Kevin,
>
> Kevin O'Connor <kevin@koconnor.net> writes:
>
> > On Sat, May 07, 2011 at 08:48:45PM +0200, Sven Schnelle wrote:
> >> Kevin O'Connor <kevin@koconnor.net> writes:
> >> > Some ps2 ports send NAK (0xfe) when there is no keyboard plugged in.
> >> > The detection for NAK was added so that it doesn't take a full second
> >> > to recognize that no keyboard is present.  The patch you sent would
> >> > loop infinitely in this situation.
> >>
> >> Yes, the patch was only for testing purposes. :)
> >>
> >> I feared that are controllers out there that behave like this, so i have
> >> to find another solution.
> >
> > How about something like (untested):
> >
> > --- a/src/ps2port.c
> > +++ b/src/ps2port.c
> > @@ -438,9 +438,14 @@ keyboard_init(void *data)
> >
> >      /* ------------------- keyboard side ------------------------*/
> >      /* reset keyboard and self test  (keyboard side) */
> > -    ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);
> > -    if (ret)
> > -        return;
> > +    u64 end = calc_future_tsc(4000);
> > +    for (;;) {
> > +        ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);
> > +        if (!ret)
> > +            break;
> > +        if (check_tsc(end))
> > +            return;
> > +    }
> >      if (param[0] != 0xaa) {
> >          dprintf(1, "keyboard self test failed (got %x not 0xaa)\n",
> param[0]);
> >          return;
> >
> > If it works, the 4000 could be turned into a config option.
>
> Yes, that fixes it. I'm using the patch below right now.
>
> Not sure about the default value, but 0 seems to be safe to not
> introduce an additional delay for other users ;)
>
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
>
> diff --git a/src/Kconfig b/src/Kconfig
> index 123db01..21cef19 100644
> --- a/src/Kconfig
> +++ b/src/Kconfig
> @@ -126,6 +126,14 @@ menu "Hardware support"
>         help
>             Support PS2 ports (keyboard and mouse).
>
> +    config PS2_RESET_TIMEOUT
> +        depends on PS2PORT
> +        int "Reset timeout (in ms)"
> +        default 0
> +        help
> +            This option specifies how long we should wait for the
> Keyboard.
> +            Some keyboards are requiring a delay after POR for
> initialization.
> +
>     config USB
>         bool "USB"
>         default y
> diff --git a/src/ps2port.c b/src/ps2port.c
> index 81d47c9..3df8a8a 100644
> --- a/src/ps2port.c
> +++ b/src/ps2port.c
> @@ -438,7 +438,9 @@ keyboard_init(void *data)
>
>     /* ------------------- keyboard side ------------------------*/
>     /* reset keyboard and self test  (keyboard side) */
> -    ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);
> +    u64 end = calc_future_tsc(CONFIG_PS2_RESET_TIMEOUT);
> +    while ((ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param)) &&
> !check_tsc(end));
> +
>     if (ret)
>         return;
>     if (param[0] != 0xaa) {
>
> --
> coreboot mailing list: coreboot@coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot
>

[Attachment #5 (text/html)]

<meta http-equiv="content-type" content="text/html; charset=utf-8"><span \
class="Apple-style-span" style="border-collapse: collapse; font-family: arial, \
sans-serif; font-size: 13px; ">I know this is off topic, but how did you get corebios \
flashed to the T60?  Is there a software based way or must I get hardware in order to \
do it?</span><br>

<br><div class="gmail_quote">On Sat, May 28, 2011 at 7:23 AM, Sven Schnelle <span \
dir="ltr">&lt;<a href="mailto:svens@stackframe.org">svens@stackframe.org</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex;">

Hi Kevin,<br>
<br>
Kevin O&#39;Connor &lt;<a href="mailto:kevin@koconnor.net">kevin@koconnor.net</a>&gt; \
writes:<br> <br>
&gt; On Sat, May 07, 2011 at 08:48:45PM +0200, Sven Schnelle wrote:<br>
&gt;&gt; Kevin O&#39;Connor &lt;<a \
href="mailto:kevin@koconnor.net">kevin@koconnor.net</a>&gt; writes:<br> &gt;&gt; &gt; \
Some ps2 ports send NAK (0xfe) when there is no keyboard plugged in.<br> &gt;&gt; \
&gt; The detection for NAK was added so that it doesn&#39;t take a full second<br> \
&gt;&gt; &gt; to recognize that no keyboard is present.  The patch you sent would<br> \
&gt;&gt; &gt; loop infinitely in this situation.<br> &gt;&gt;<br>
&gt;&gt; Yes, the patch was only for testing purposes. :)<br>
&gt;&gt;<br>
&gt;&gt; I feared that are controllers out there that behave like this, so i have<br>
&gt;&gt; to find another solution.<br>
&gt;<br>
&gt; How about something like (untested):<br>
&gt;<br>
&gt; --- a/src/ps2port.c<br>
&gt; +++ b/src/ps2port.c<br>
&gt; @@ -438,9 +438,14 @@ keyboard_init(void *data)<br>
&gt;<br>
&gt;      /* ------------------- keyboard side ------------------------*/<br>
&gt;      /* reset keyboard and self test  (keyboard side) */<br>
&gt; -    ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);<br>
&gt; -    if (ret)<br>
&gt; -        return;<br>
&gt; +    u64 end = calc_future_tsc(4000);<br>
&gt; +    for (;;) {<br>
&gt; +        ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);<br>
&gt; +        if (!ret)<br>
&gt; +            break;<br>
&gt; +        if (check_tsc(end))<br>
&gt; +            return;<br>
&gt; +    }<br>
&gt;      if (param[0] != 0xaa) {<br>
&gt;          dprintf(1, &quot;keyboard self test failed (got %x not 0xaa)\n&quot;, \
param[0]);<br> &gt;          return;<br>
&gt;<br>
&gt; If it works, the 4000 could be turned into a config option.<br>
<br>
Yes, that fixes it. I&#39;m using the patch below right now.<br>
<br>
Not sure about the default value, but 0 seems to be safe to not<br>
introduce an additional delay for other users ;)<br>
<br>
Signed-off-by: Sven Schnelle &lt;<a \
href="mailto:svens@stackframe.org">svens@stackframe.org</a>&gt;<br> <br>
diff --git a/src/Kconfig b/src/Kconfig<br>
index 123db01..21cef19 100644<br>
--- a/src/Kconfig<br>
+++ b/src/Kconfig<br>
@@ -126,6 +126,14 @@ menu &quot;Hardware support&quot;<br>
         help<br>
             Support PS2 ports (keyboard and mouse).<br>
<br>
+    config PS2_RESET_TIMEOUT<br>
+        depends on PS2PORT<br>
+        int &quot;Reset timeout (in ms)&quot;<br>
+        default 0<br>
+        help<br>
+            This option specifies how long we should wait for the Keyboard.<br>
+            Some keyboards are requiring a delay after POR for initialization.<br>
+<br>
     config USB<br>
         bool &quot;USB&quot;<br>
         default y<br>
diff --git a/src/ps2port.c b/src/ps2port.c<br>
index 81d47c9..3df8a8a 100644<br>
--- a/src/ps2port.c<br>
+++ b/src/ps2port.c<br>
@@ -438,7 +438,9 @@ keyboard_init(void *data)<br>
<br>
     /* ------------------- keyboard side ------------------------*/<br>
     /* reset keyboard and self test  (keyboard side) */<br>
-    ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param);<br>
+    u64 end = calc_future_tsc(CONFIG_PS2_RESET_TIMEOUT);<br>
+    while ((ret = ps2_kbd_command(ATKBD_CMD_RESET_BAT, param)) &amp;&amp; \
!check_tsc(end));<br> +<br>
     if (ret)<br>
         return;<br>
     if (param[0] != 0xaa) {<br>
<font color="#888888"><br>
--<br>
coreboot mailing list: <a \
href="mailto:coreboot@coreboot.org">coreboot@coreboot.org</a><br> <a \
href="http://www.coreboot.org/mailman/listinfo/coreboot" \
target="_blank">http://www.coreboot.org/mailman/listinfo/coreboot</a><br> \
</font></blockquote></div><br>



-- 
coreboot mailing list: coreboot@coreboot.org
http://www.coreboot.org/mailman/listinfo/coreboot

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic