[PATCH] powerpc: Pegasos keyboard detection

STALE6950d

10 messages, 5 authors, 2007-08-01 · open the first message on its own page

[PATCH] powerpc: Pegasos keyboard detection

From: Alan Curry <hidden>
Date: 2007-07-25 01:30:33

As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
--- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 19:04:17.000000000 -0500
+++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 -0500
@@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
 	switch(base_port) {
 	case I8042_DATA_REG:
 		np = of_find_node_by_type(NULL, "8042");
+		/* Pegasos has no device_type on its 8042 node, look for the
+		 * name instead */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-07-25 06:22:52

On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
Doesn't it have something in "compatible" instead ? that would be the
way to go.

Ben.

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-07-25 07:13:18

On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note, if there's a volunteer, we could probably turn that code into a
nice table lookup.

Cheers,
Ben.
quoted hunk
--- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 19:04:17.000000000 -0500
+++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 -0500
@@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
 	switch(base_port) {
 	case I8042_DATA_REG:
 		np = of_find_node_by_type(NULL, "8042");
+		/* Pegasos has no device_type on its 8042 node, look for the
+		 * name instead */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-07-27 01:49:16

On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
quoted
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note, if there's a volunteer, we could probably turn that code into a
nice table lookup.
Did this get merged, or otherwise fixed?  Even though the code in there has
changed quite a bit, it looks to my untrained eye like the fix is still
applicable?


From: Alan Curry <redacted>

As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse
controller on the PegasosPPC.  This is because of a feature/bug in the OF
device tree: the "device_type" attribute is an empty string instead of
"8042" as the kernel expects.  This patch (against 2.6.22.1) adds a
secondary detection which looks for a device whose *name* is "8042" if
there is no device whose *type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/kernel/setup-common.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN /dev/null /dev/null
diff -puN arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection arch/powerpc/kernel/setup-common.c
--- a/arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection
+++ a/arch/powerpc/kernel/setup-common.c
@@ -496,6 +496,12 @@ int check_legacy_ioport(unsigned long ba
 			break;
 		}
 		np = of_find_node_by_type(NULL, "8042");
+		/*
+		 * Pegasos has no device_type on its 8042 node, look for the
+		 * name instead
+		 */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");
_


And ALan says that 2.6.22 is bust, but this patch no won't apply there so
if we want to fix 2.6.22.x then Alan's original patch would be needed.

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-07-27 03:00:51

On Thu, 2007-07-26 at 18:48 -0700, Andrew Morton wrote:
On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
quoted
On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
quoted
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note, if there's a volunteer, we could probably turn that code into a
nice table lookup.
Did this get merged, or otherwise fixed?  Even though the code in there has
changed quite a bit, it looks to my untrained eye like the fix is still
applicable?
Merged a fixed version:

f5d834fc34e61f1a40435981062000e5d2b2baa8

(In linus tree as of now)

Cheers,
Ben.
quoted hunk
From: Alan Curry <redacted>

As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse
controller on the PegasosPPC.  This is because of a feature/bug in the OF
device tree: the "device_type" attribute is an empty string instead of
"8042" as the kernel expects.  This patch (against 2.6.22.1) adds a
secondary detection which looks for a device whose *name* is "8042" if
there is no device whose *type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/kernel/setup-common.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff -puN /dev/null /dev/null
diff -puN arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection arch/powerpc/kernel/setup-common.c
--- a/arch/powerpc/kernel/setup-common.c~powerpc-pegasos-keyboard-detection
+++ a/arch/powerpc/kernel/setup-common.c
@@ -496,6 +496,12 @@ int check_legacy_ioport(unsigned long ba
 			break;
 		}
 		np = of_find_node_by_type(NULL, "8042");
+		/*
+		 * Pegasos has no device_type on its 8042 node, look for the
+		 * name instead
+		 */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
 		break;
 	case FDC_BASE: /* FDC1 */
 		np = of_find_node_by_type(NULL, "fdc");
_


And ALan says that 2.6.22 is bust, but this patch no won't apply there so
if we want to fix 2.6.22.x then Alan's original patch would be needed.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-07-27 04:23:16

On Fri, 27 Jul 2007 13:00:21 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
On Thu, 2007-07-26 at 18:48 -0700, Andrew Morton wrote:
quoted
On Wed, 25 Jul 2007 17:12:45 +1000 Benjamin Herrenschmidt [off-list ref] wrote:
quoted
On Tue, 2007-07-24 at 21:28 -0400, Alan Curry wrote:
quoted
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse controller
on the PegasosPPC. This is because of a feature/bug in the OF device tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary detection
which looks for a device whose *name* is "8042" if there is no device whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note, if there's a volunteer, we could probably turn that code into a
nice table lookup.
Did this get merged, or otherwise fixed?  Even though the code in there has
changed quite a bit, it looks to my untrained eye like the fix is still
applicable?
Merged a fixed version:

f5d834fc34e61f1a40435981062000e5d2b2baa8

(In linus tree as of now)
I hope so.  Alan's patch looks rather different from what you have now:
fall back to of_find_node_by_name() if of_find_node_by_type() failed.

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2007-07-27 07:16:23

On Thu, 2007-07-26 at 21:22 -0700, Andrew Morton wrote:
quoted
Merged a fixed version:

f5d834fc34e61f1a40435981062000e5d2b2baa8

(In linus tree as of now)
I hope so.  Alan's patch looks rather different from what you have
now:
fall back to of_find_node_by_name() if of_find_node_by_type() failed.
Which is just waht that commit does :-)

Ben.

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Segher Boessenkool <hidden>
Date: 2007-07-31 21:29:48

quoted hunk
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse 
controller
on the PegasosPPC. This is because of a feature/bug in the OF device 
tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary 
detection
which looks for a device whose *name* is "8042" if there is no device 
whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
--- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 
19:04:17.000000000 -0500
+++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 
-0500
@@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
 	switch(base_port) {
 	case I8042_DATA_REG:
 		np = of_find_node_by_type(NULL, "8042");
+		/* Pegasos has no device_type on its 8042 node, look for the
+		 * name instead */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
[I know it already got merged, I'm behind on mail, but anyway...]

Could board-specific quirks like this please always include a
check for that board?  Or, even better, do a fixup in the
bootwrapper.

In this case the workaround won't likely trigger on the wrong
boards, but "just a little bit" more dangerous workarounds
_will_, and the law of big numbers works against us...


Segher

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Matt Sealey <hidden>
Date: 2007-08-01 07:24:37

Yeah please do a fixup for the boot wrapper.

Or, if you have trouble, go into the firmware and type "nvedit", add
these lines;

" /isa/8042" find-device
" 8042" encode-string device-type

(then ctrl-c to exit and nvstore to run it on next reboot. Try it without
the patch first, on the firmware console, just to be sure I got it right,
because I can't test it here)

You don't need to patch Linux at all. In fact for silly things like this
I would recommend against it :)

-- 
Matt Sealey [off-list ref]
Genesi, Manager, Developer Relations




Segher Boessenkool wrote:
quoted
As of 2.6.22 the kernel doesn't recognize the i8042 keyboard/mouse 
controller
on the PegasosPPC. This is because of a feature/bug in the OF device 
tree:
the "device_type" attribute is an empty string instead of "8042" as the
kernel expects. This patch (against 2.6.22.1) adds a secondary 
detection
which looks for a device whose *name* is "8042" if there is no device 
whose
*type* is "8042".

Signed-off-by: Alan Curry <redacted>
--- arch/powerpc/kernel/setup-common.c.orig	2007-07-24 
19:04:17.000000000 -0500
+++ arch/powerpc/kernel/setup-common.c	2007-07-24 19:06:36.000000000 
-0500
@@ -487,6 +487,10 @@ int check_legacy_ioport(unsigned long ba
 	switch(base_port) {
 	case I8042_DATA_REG:
 		np = of_find_node_by_type(NULL, "8042");
+		/* Pegasos has no device_type on its 8042 node, look for the
+		 * name instead */
+		if (!np)
+			np = of_find_node_by_name(NULL, "8042");
[I know it already got merged, I'm behind on mail, but anyway...]

Could board-specific quirks like this please always include a
check for that board?  Or, even better, do a fixup in the
bootwrapper.

In this case the workaround won't likely trigger on the wrong
boards, but "just a little bit" more dangerous workarounds
_will_, and the law of big numbers works against us...


Segher

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] powerpc: Pegasos keyboard detection

From: Matt Sealey <hidden>
Date: 2007-08-01 07:27:39

Just so you guys have it all in one pretty little package, these will remove
the need for the Pegasos IDE and ISA fixups in the prom_init.c too.

s" /pci@80000000/ide@C,1" find-device
d# 14 encode-int 0 encode-int
d# 15 encode-int 0 encode-int
encode+ encode+ encode+ s" interrupts" property
0x1018a encode-int s" class-code" property
device-end

s" /pci@80000000/isa@C" find-device
0x1 encode-int 0x0 encode-int 0x1006000 encode-int
0x0 encode-int 0x0 encode-int 0x1000 encode-int
encode+ encode+ encode+ encode+ encode+ s" ranges" property
device-end

If anyone wants to test and confirm the 8042 fix and then we can add
it to the end here.. we can unclutter the kernel.

-- 
Matt Sealey [off-list ref]
Genesi, Manager, Developer Relations

Matt Sealey wrote:
Yeah please do a fixup for the boot wrapper.

Or, if you have trouble, go into the firmware and type "nvedit", add
these lines;

" /isa/8042" find-device
" 8042" encode-string device-type

(then ctrl-c to exit and nvstore to run it on next reboot. Try it without
the patch first, on the firmware console, just to be sure I got it right,
because I can't test it here)

You don't need to patch Linux at all. In fact for silly things like this
I would recommend against it :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help