From: Wade Farnsworth <wfarnsworth@mvista.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH 3/5] Support for the LPC47M192 SuperIO on the MPC8641 HPCN
Date: Tue, 15 May 2007 09:32:11 -0700 [thread overview]
Message-ID: <1179246731.8132.117.camel@rhino> (raw)
In-Reply-To: <1179245829.8132.100.camel@rhino>
This adds support for the LPC47M192 SuperIO on the MPC8641 HPCN.
Specifically this adds support for the I8042 Keyboard/Mouse and the GPIO
on the chip.
Also, the mouse needs to use IRQ 12, which is currently in use by some
PCI devices. Move those devices to IRQ 11.
Signed-off-by: Wade Farnsworth <wfarnsworth@mvista.com>
---
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 4 -
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 43 +++++++++++++++----
2 files changed, 38 insertions(+), 9 deletions(-)
Index: linux-2.6-8641/arch/powerpc/boot/dts/mpc8641_hpcn.dts
===================================================================
--- linux-2.6-8641.orig/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ linux-2.6-8641/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -264,7 +264,7 @@
/* IDSEL 0x1c */
e000 0 0 1 &i8259 9 2
e000 0 0 2 &i8259 a 2
- e000 0 0 3 &i8259 c 2
+ e000 0 0 3 &i8259 b 2
e000 0 0 4 &i8259 7 2
/* IDSEL 0x1d */
@@ -274,7 +274,7 @@
e800 0 0 4 &i8259 0 0
/* IDSEL 0x1e */
- f000 0 0 1 &i8259 c 2
+ f000 0 0 1 &i8259 b 2
f000 0 0 2 &i8259 0 0
f000 0 0 3 &i8259 0 0
f000 0 0 4 &i8259 0 0
Index: linux-2.6-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
===================================================================
--- linux-2.6-8641.orig/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ linux-2.6-8641/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -141,7 +141,7 @@ const unsigned char uli1575_irq_route_ta
0x1, /* 9: 0b0001 */
0x3, /* 10: 0b0011 */
0x9, /* 11: 0b1001 */
- 0xb, /* 12: 0b1011 */
+ 0, /* 12: Reserved */
0, /* 13: Reserved */
0xd, /* 14, 0b1101 */
0xf, /* 15, 0b1111 */
@@ -211,7 +211,7 @@ static void __devinit quirk_uli1575(stru
pirq_map_word |= (uli1575_irq_route_table[i] & 0xf)
<< ((irq2pin[i] - PIRQA) * 4);
- /* ULI1575 IRQ mapping conf register default value is 0xb9317542 */
+ /* ULI1575 IRQ mapping conf register default value is 0x09317542 */
DBG("Setup ULI1575 IRQ mapping configuration register value = 0x%x\n",
pirq_map_word);
pci_write_config_dword(dev, 0x48, pirq_map_word);
@@ -266,9 +266,9 @@ static void __devinit quirk_uli1575(stru
pci_write_config_byte(dev, 0x44, 0x30 | uli1575_irq_route_table[14]);
pci_write_config_byte(dev, 0x75, uli1575_irq_route_table[15]);
- /* Set IRQ14 and IRQ15 to legacy IRQs */
+ /* Set IRQ1, IRQ12, IRQ14 and IRQ15 to legacy IRQs */
pci_read_config_word(dev, 0x46, &temp);
- temp |= 0xc000;
+ temp |= 0xd002;
pci_write_config_word(dev, 0x46, temp);
/* Set i8259 interrupt trigger
@@ -280,12 +280,12 @@ static void __devinit quirk_uli1575(stru
* IRQ 9: Level
* IRQ 10: Level
* IRQ 11: Level
- * IRQ 12: Level
+ * IRQ 12: Edge
* IRQ 14: Edge
* IRQ 15: Edge
*/
- outb(0xfa, 0x4d0);
- outb(0x1e, 0x4d1);
+ outb(0xf8, 0x4d0);
+ outb(0x0e, 0x4d1);
#undef ULI1575_SET_DEV_IRQ
@@ -293,6 +293,35 @@ static void __devinit quirk_uli1575(stru
pci_read_config_byte(dev, 0xb8, &c);
c &= 0x7f;
pci_write_config_byte(dev, 0xb8, c);
+
+ /* enable superio @ 0x4e and keyboard/mouse address decoding */
+ pci_write_config_byte(dev, 0x63, 0x90);
+
+ /* LPC47M192 Super I/O configuration */
+ outb(0x55, 0x4e); /* enter superio config mode */
+
+ /* Enable keyboard and mouse */
+ outb(0x07, 0x4e); /* device selector register */
+ outb(0x07, 0x4f); /* select keyboard registers (device 7) */
+ outb(0x30, 0x4e); /* keyboard activation register */
+ outb(0x01, 0x4f); /* activate keyboard */
+ outb(0x70, 0x4e); /* keyboard IRQ register */
+ outb(0x01, 0x4f); /* IRQ1 for keyboard */
+ outb(0x72, 0x4e); /* mouse IRQ register */
+ outb(0x0c, 0x4f); /* IRQ12 for mouse */
+
+ /* Enable superio runtime registers for gpio in pci i/o space */
+ outb(0x20, 0x4e); /* device id register */
+ outb(0x07, 0x4e); /* device selector register */
+ outb(0x0a, 0x4f); /* select runtime registers (device A) */
+ outb(0x60, 0x4e); /* select runtime register address high byte */
+ outb(0x04, 0x4f); /* runtime register address high byte */
+ outb(0x61, 0x4e); /* select runtime register address low byte */
+ outb(0x01, 0x4f); /* runtime register address low byte */
+ outb(0x30, 0x4e); /* runtime registers activation register */
+ outb(0x01, 0x4f); /* activate runtime registers */
+
+ outb(0xaa, 0x4e); /* exit superio config mode */
}
static void __devinit quirk_uli5288(struct pci_dev *dev)
next prev parent reply other threads:[~2007-05-15 16:32 UTC|newest]
Thread overview: 67+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-15 16:17 [PATCH 0/5] MPC8641 HPCN fixes Wade Farnsworth
2007-05-15 16:23 ` [PATCH 1/5] Add MTD support to mpc8641_hpcn.dts Wade Farnsworth
2007-05-15 16:27 ` [PATCH 2/5] Add legacy devices " Wade Farnsworth
2007-05-16 16:37 ` Jon Loeliger
2007-05-16 17:59 ` Wade Farnsworth
2007-05-16 19:59 ` Segher Boessenkool
2007-05-16 19:55 ` Segher Boessenkool
2007-05-16 20:03 ` Sergei Shtylyov
2007-05-16 20:17 ` Wade Farnsworth
2007-05-16 23:40 ` Segher Boessenkool
2007-05-16 23:47 ` Segher Boessenkool
2007-05-17 0:11 ` Wade Farnsworth
2007-05-17 0:09 ` Wade Farnsworth
2007-05-18 16:44 ` Jon Loeliger
2007-05-21 16:04 ` Wade Farnsworth
2007-05-21 16:10 ` Jon Loeliger
2007-05-21 16:51 ` Wade Farnsworth
2007-05-16 20:29 ` Wade Farnsworth
2007-07-07 18:29 ` Sergei Shtylyov
2007-07-07 18:39 ` Arnd Bergmann
2007-07-08 13:13 ` Segher Boessenkool
2007-07-08 20:36 ` Arnd Bergmann
2007-07-08 23:42 ` Segher Boessenkool
2007-07-09 12:43 ` Sergei Shtylyov
2007-07-09 14:43 ` Segher Boessenkool
2007-07-07 18:59 ` Sergei Shtylyov
2007-07-07 19:23 ` Arnd Bergmann
2007-05-15 16:32 ` Wade Farnsworth [this message]
2007-05-15 16:36 ` [PATCH 4/5] Add RTC CMOS support for the MPC8641 HPCN Wade Farnsworth
2007-05-15 16:50 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev 1.02 hardware Wade Farnsworth
2007-05-16 16:44 ` Jon Loeliger
2007-05-16 18:06 ` Wade Farnsworth
2007-05-18 6:52 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev1.02 hardware Jin Zhengxiong-R64188
2007-05-21 15:59 ` Wade Farnsworth
2007-05-17 2:50 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev 1.02hardware Zhang Wei-r63237
2007-05-17 16:03 ` Wade Farnsworth
2007-05-17 16:14 ` Kumar Gala
2007-05-17 16:58 ` Wade Farnsworth
2007-05-17 18:46 ` Timur Tabi
2007-05-17 18:48 ` Timur Tabi
2007-05-17 18:53 ` Scott Wood
2007-05-17 18:59 ` Timur Tabi
2007-05-17 19:16 ` Jerry Van Baren
2007-05-18 13:48 ` Matt Sealey
2007-05-17 22:34 ` Wade Farnsworth
2007-05-18 0:56 ` David Gibson
2007-05-18 3:49 ` Jerry Van Baren
2007-05-18 14:34 ` Timur Tabi
2007-05-18 15:22 ` Jerry Van Baren
2007-05-18 16:46 ` Scott Wood
2007-05-18 17:30 ` Jerry Van Baren
2007-05-18 17:39 ` Timur Tabi
2007-05-18 17:43 ` Scott Wood
2007-05-18 17:47 ` Timur Tabi
2007-05-18 17:52 ` Scott Wood
2007-05-18 17:56 ` Timur Tabi
2007-05-18 18:02 ` Scott Wood
2007-05-18 18:03 ` Jerry Van Baren
2007-05-18 18:19 ` Jon Loeliger
2007-05-18 18:23 ` Scott Wood
2007-05-18 19:05 ` Jon Loeliger
2007-05-18 19:09 ` Scott Wood
2007-05-18 18:30 ` Timur Tabi
2007-05-18 17:59 ` Jerry Van Baren
2007-05-18 10:20 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon and Rev1.02hardware Zhang Wei-r63237
2007-05-21 16:01 ` Wade Farnsworth
2007-05-22 2:53 ` [PATCH 5/5] PCI fixes for the MPC8641 Rev 2.0 silicon andRev1.02hardware Zhang Wei-r63237
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=1179246731.8132.117.camel@rhino \
--to=wfarnsworth@mvista.com \
--cc=linuxppc-dev@ozlabs.org \
/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;
as well as URLs for NNTP newsgroup(s).