public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: pacman@kosh•dhis.org
To: paubert@iram•es (Gabriel Paubert)
Cc: linuxppc-dev@lists•ozlabs.org
Subject: Re: Pegasos i8042 broken again
Date: Mon, 4 Apr 2011 18:02:33 -0500 (GMT+5)	[thread overview]
Message-ID: <20110404230233.28641.qmail@kosh.dhis.org> (raw)
In-Reply-To: <20110404222637.GA4633@iram.es>

Gabriel Paubert writes:
> 
> Ok, I got fed up about it. The patch referred above is obviously wrong since
> it leaves interrupts at 0 when a device_type or name of 8042 is found,
> so what about the following? 

Looks like the workaround I was using for a while.

In the original report I said I wasn't sending my kernel workaround patch
because of the previous disagreements about whether the kernel should work
around this type of bug. (In fact the current difficulty is the result of
changes being made without considering the special case that was created by
my first workaround... what a mess.) I also said I wasn't comfortable hacking
the Forth-based part of the boot sequence because I didn't know the language.

As it turned out, learning Forth was much easier than getting any guidance
from the kernel people on how to proceed with a workaround, so I wrote this:

=== CUT HERE ===
" /isa/8042" find-device
: open true ;
: close ;
: decode-unit ( addr len -- phys )
  1 <> if
    abort" invalid unit address"
  then
  c@
  dup ascii 0 = if
    drop
    0 exit
  then
  ascii 1 = if
    1 exit
  then
  abort" invalid unit address"
;
: encode-unit ( phys -- addr len )
  dup 0 = if
    " 0" exit
  then
  1 = if
    " 1" exit
  then
  abort" invalid unit address"
;

1 encode-int
3 encode-int encode+
d# 12 encode-int encode+
3 encode-int encode+
" interrupts" property

0 0 " 0" " /isa/8042" begin-package
 " keyboard" device-name
 " keyboard" device-type
 " pnpPNP,303" encode-string " compatible" property
 0 encode-int " reg" property
end-package

0 0 " 1" " /isa/8042" begin-package
 " mouse" device-name
 " mouse" device-type
 " pnpPNP,f03" encode-string " compatible" property
 1 encode-int " reg" property
end-package
=== CUT HERE ===

Along with the previous device tree patch (pegasos-dts-20071018), this should
present the kernel with a properly filled-out 8042 device-tree node,
preventing the need for any more patching the next time the kernel changes
its mind about how to initialize the keyboard driver.

-- 
Alan Curry

      parent reply	other threads:[~2011-04-04 23:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10  1:37 Pegasos i8042 broken again pacman
2010-10-10  7:35 ` Benjamin Herrenschmidt
2010-10-10 12:26   ` Gerhard Pircher
2010-10-10 17:32   ` pacman
2011-04-04 22:26   ` Gabriel Paubert
2011-04-04 22:28     ` Benjamin Herrenschmidt
2011-04-04 22:49       ` Gabriel Paubert
2011-04-04 23:02     ` pacman [this message]

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=20110404230233.28641.qmail@kosh.dhis.org \
    --to=pacman@kosh$(echo .)dhis.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=paubert@iram$(echo .)es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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