
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>

The Pegasos machines have the VIA IDE controller configured in a strange
way by the firmware.  It claims to be fully native, but is actually routed
to legacy irqs 14 and 15.

This patch works around that in the driver.  In the future, I'll try to do
an ifdef-less patch by detecting that setup from the chip, and using the
new pci_get_legacy_ide_irq() in that case, but I don't have proper HW
infos.  This patch is good enough in the meantime, I'll come up with a
better one later eventually.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/ide/pci/via82cxxx.c |   11 +++++++++++
 1 files changed, 11 insertions(+)

diff -puN drivers/ide/pci/via82cxxx.c~ppc32-fix-via-ide-driver-for-pegasos drivers/ide/pci/via82cxxx.c
--- 25/drivers/ide/pci/via82cxxx.c~ppc32-fix-via-ide-driver-for-pegasos	2005-01-26 18:22:27.135515400 -0800
+++ 25-akpm/drivers/ide/pci/via82cxxx.c	2005-01-26 18:22:27.139514792 -0800
@@ -36,6 +36,10 @@
 #include <linux/ide.h>
 #include <asm/io.h>
 
+#ifdef CONFIG_PPC_MULTIPLATFORM
+#include <asm/processor.h>
+#endif
+
 #include "ide-timing.h"
 
 #define DISPLAY_VIA_TIMINGS
@@ -584,6 +588,13 @@ static void __init init_hwif_via82cxxx(i
 	hwif->tuneproc = &via82cxxx_tune_drive;
 	hwif->speedproc = &via_set_drive;
 
+
+#ifdef CONFIG_PPC_MULTIPLATFORM
+	if(_machine == _MACH_chrp && _chrp_type == _CHRP_Pegasos) {
+		hwif->irq = hwif->channel ? 15 : 14;
+	}
+#endif
+
 	for (i = 0; i < 2; i++) {
 		hwif->drives[i].io_32bit = 1;
 		hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
_
