aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/chrp
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/chrp')
-rw-r--r--arch/powerpc/platforms/chrp/pci.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/chrp/pci.c b/arch/powerpc/platforms/chrp/pci.c
index 0c6dba9823e9..974952ed15cb 100644
--- a/arch/powerpc/platforms/chrp/pci.c
+++ b/arch/powerpc/platforms/chrp/pci.c
@@ -338,3 +338,32 @@ void chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
338} 338}
339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105, 339DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
340 chrp_pci_fixup_winbond_ata); 340 chrp_pci_fixup_winbond_ata);
341
342/* Pegasos2 firmware version 20040810 configures the built-in IDE controller
343 * in legacy mode, but sets the PCI registers to PCI native mode.
344 * The chip can only operate in legacy mode, so force the PCI class into legacy
345 * mode as well. The same fixup must be done to the class-code property in
346 * the IDE node /pci@80000000/ide@C,1
347 */
348static void chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
349{
350 u8 progif;
351 struct pci_dev *viaisa;
352
353 if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos)
354 return;
355 if (viaide->irq != 14)
356 return;
357
358 viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL);
359 if (!viaisa)
360 return;
361 printk("Fixing VIA IDE, force legacy mode on '%s'\n", viaide->dev.bus_id);
362
363 pci_read_config_byte(viaide, PCI_CLASS_PROG, &progif);
364 pci_write_config_byte(viaide, PCI_CLASS_PROG, progif & ~0x5);
365 viaide->class &= ~0x5;
366
367 pci_dev_put(viaisa);
368}
369DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, chrp_pci_fixup_vt8231_ata);