rpms/kernel/devel linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch, NONE, 1.1 kernel.spec, 1.181, 1.182
Chuck Ebbert (cebbert)
fedora-extras-commits at redhat.com
Mon Sep 24 19:21:25 UTC 2007
Author: cebbert
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6226
Modified Files:
kernel.spec
Added Files:
linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch
Log Message:
* Mon Sep 24 2007 Chuck Ebbert <cebbert at redhat.com>
- Fix IDE on ppc Pegasos platform (F7 bz #247602)
linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch:
--- NEW FILE linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch ---
The built-in IDE controller is configured in legacy mode,
but the PCI registers advertise native mode.
Force the PCI class into legacy mode. This allows pata_via to access
two drives.
The Pegasos specific irq enforcement in the via82cxxx driver
can be removed.
Tested on Pegasos2 with firmware version 20040810, and two IDE disks.
---
arch/powerpc/kernel/prom_init.c | 11 ++++++++---
arch/powerpc/platforms/chrp/pci.c | 28 ++++++++++++++++++++++++++++
drivers/ide/pci/via82cxxx.c | 7 -------
3 files changed, 36 insertions(+), 10 deletions(-)
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -2041,6 +2041,7 @@ static void __init fixup_device_tree_map
/*
* Pegasos and BriQ lacks the "ranges" property in the isa node
* Pegasos needs decimal IRQ 14/15, not hexadecimal
+ * Pegasos has the IDE configured in legacy mode, but advertised as native
*/
static void __init fixup_device_tree_chrp(void)
{
@@ -2078,9 +2079,13 @@ static void __init fixup_device_tree_chr
prom_printf("Fixing up IDE interrupt on Pegasos...\n");
prop[0] = 14;
prop[1] = 0x0;
- prop[2] = 15;
- prop[3] = 0x0;
- prom_setprop(ph, name, "interrupts", prop, 4*sizeof(u32));
+ prom_setprop(ph, name, "interrupts", prop, 2*sizeof(u32));
+ prom_printf("Fixing up IDE class-code on Pegasos...\n");
+ rc = prom_getprop(ph, "class-code", prop, sizeof(u32));
+ if (rc == sizeof(u32)) {
+ prop[0] &= ~0x5;
+ prom_setprop(ph, name, "class-code", prop, sizeof(u32));
+ }
}
}
#else
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -338,3 +338,31 @@ void chrp_pci_fixup_winbond_ata(struct p
}
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
chrp_pci_fixup_winbond_ata);
+
+/* Pegasos2 firmware version 20040810 configures the built-in IDE controller
+ * in legacy mode, but sets the PCI registers to PCI native mode.
+ * The chip can only operate in legacy mode, so force the PCI class into legacy
+ * mode as well. The same fixup must be done to the class-code property in
+ * the IDE node /pci at 80000000/ide at C,1
+ */
+static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
+{
+ u8 progif;
+ struct pci_dev *viaisa;
+
+ if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
+ return;
+ if (viaide->irq != 14)
+ return;
+
+ viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
+ if (!viaisa)
+ return;
+ printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
+
+ pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
+ pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
+
+ pci_dev_put(viaisa);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -436,13 +436,6 @@ static void __devinit init_hwif_via82cxx
hwif->tuneproc = &via82cxxx_tune_drive;
hwif->speedproc = &via_set_drive;
-
-#ifdef CONFIG_PPC_CHRP
- if(machine_is(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 = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -r1.181 -r1.182
--- kernel.spec 24 Sep 2007 18:17:29 -0000 1.181
+++ kernel.spec 24 Sep 2007 19:20:53 -0000 1.182
@@ -580,14 +580,17 @@
Patch70: linux-2.6-x86_64-silence-up-apic-errors.patch
Patch75: linux-2.6-x86-debug-boot.patch
Patch76: linux-2.6-x86-debug-edd.patch
+
Patch100: linux-2.6-g5-therm-shutdown.patch
Patch120: linux-2.6-ppc32-ucmpdi2.patch
Patch130: linux-2.6-ibmvscsi-schizo.patch
-Patch132: linux-2.6-powerpc-generic-suspend-2-remove-adb-sleep-notifier.patch
-Patch133: linux-2.6-powerpc-generic-suspend-3-remove-dmasound.patch
-Patch134: linux-2.6-powerpc-generic-suspend-4-kill-pmu-sleep-notifier.patch
-Patch135: linux-2.6-powerpc-generic-suspend-5-pmu-pm_ops.patch
-Patch140: linux-2.6-pmac-zilog.patch
+Patch131: linux-2.6-pmac-zilog.patch
+Patch135: linux-2.6-powerpc-generic-suspend-2-remove-adb-sleep-notifier.patch
+Patch136: linux-2.6-powerpc-generic-suspend-3-remove-dmasound.patch
+Patch137: linux-2.6-powerpc-generic-suspend-4-kill-pmu-sleep-notifier.patch
+Patch138: linux-2.6-powerpc-generic-suspend-5-pmu-pm_ops.patch
+Patch140: linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch
+
Patch150: linux-2.6-build-nonintconfig.patch
Patch160: linux-2.6-execshield.patch
Patch170: linux-2.6-modsign-mpilib.patch
@@ -1032,6 +1035,8 @@
ApplyPatch linux-2.6-powerpc-generic-suspend-3-remove-dmasound.patch
ApplyPatch linux-2.6-powerpc-generic-suspend-4-kill-pmu-sleep-notifier.patch
ApplyPatch linux-2.6-powerpc-generic-suspend-5-pmu-pm_ops.patch
+# pegasos IDE
+ApplyPatch linux-2.6-ppc-pegasos-via-ata-legacy-irq.patch
# Exec shield
@@ -1802,6 +1807,9 @@
%changelog
+* Mon Sep 24 2007 Chuck Ebbert <cebbert at redhat.com>
+- Fix IDE on ppc Pegasos platform (F7 bz #247602)
+
* Mon Sep 24 2007 Dave Jones <davej at redhat.com>
- Update hi-res timers patch to .23rc7-hrt1.
More information about the fedora-extras-commits
mailing list