Commit dff11c5e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] pdc202xx_new.c: fix PDC20270/1 init on the Xserve Apple machines

From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>

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

Fix initialization of the PDC20270/1 chipsets on the Xserve Apple machines.
parent 81d6f6f8
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#ifdef CONFIG_PPC_PMAC
#include <asm/prom.h>
#include <asm/pci-bridge.h>
#endif
#include "pdc202xx_new.h" #include "pdc202xx_new.h"
#define PDC202_DEBUG_CABLE 0 #define PDC202_DEBUG_CABLE 0
...@@ -513,6 +518,44 @@ void pdcnew_reset (ide_drive_t *drive) ...@@ -513,6 +518,44 @@ void pdcnew_reset (ide_drive_t *drive)
#endif #endif
} }
#ifdef CONFIG_PPC_PMAC
static void __devinit apple_kiwi_init(struct pci_dev *pdev)
{
struct device_node *np = pci_device_to_OF_node(pdev);
unsigned int class_rev = 0;
unsigned long mmio;
u8 conf;
if (np == NULL || !device_is_compatible(np, "kiwi-root"))
return;
pci_read_config_dword(pdev, PCI_CLASS_REVISION, &class_rev);
class_rev &= 0xff;
if (class_rev >= 0x03) {
/* Setup chip magic config stuff (from darwin) */
pci_read_config_byte(pdev, 0x40, &conf);
pci_write_config_byte(pdev, 0x40, conf | 0x01);
}
mmio = (unsigned long)ioremap(pci_resource_start(pdev, 5),
pci_resource_len(pdev, 5));
/* Setup some PLL stuffs */
switch (pdev->device) {
case PCI_DEVICE_ID_PROMISE_20270:
writew(0x0d2b, mmio + 0x1202);
mdelay(30);
break;
case PCI_DEVICE_ID_PROMISE_20271:
writew(0x0826, mmio + 0x1202);
mdelay(30);
break;
}
iounmap((void *)mmio);
}
#endif /* CONFIG_PPC_PMAC */
static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name) static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char *name)
{ {
if (dev->resource[PCI_ROM_RESOURCE].start) { if (dev->resource[PCI_ROM_RESOURCE].start) {
...@@ -522,6 +565,10 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char ...@@ -522,6 +565,10 @@ static unsigned int __init init_chipset_pdcnew (struct pci_dev *dev, const char
name, dev->resource[PCI_ROM_RESOURCE].start); name, dev->resource[PCI_ROM_RESOURCE].start);
} }
#ifdef CONFIG_PPC_PMAC
apple_kiwi_init(dev);
#endif
#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) #if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS)
pdc202_devs[n_pdc202_devs++] = dev; pdc202_devs[n_pdc202_devs++] = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment