aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@parisc-linux.org>2005-10-21 22:38:23 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-21 22:38:23 -0400
commit92b919fe46509820c639a08962cbf78bc8d227d9 (patch)
treea4c138f9b224129b0bebbea4533cfe7e1a1dba07 /drivers/parisc
parent86a61ee9c9f3d8b632d29e86ac6610c43ebbb4f0 (diff)
[PARISC] Update dino from parisc tree
Fix card-mode Dino crashes on 725 (and probably other Snake) systems. Dino was coming up in fatal mode after a warm reboot. Resetting Dino brings it out of fatal mode, so do that if the status register indicates we're in fatal mode. Since this was never observed on any later systems, I presume firmware does this for us on those. Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> Add debug statements in the cfg_read and cfg_write functions Fix debug statements from the IRQ overhaul last winter Rename dino_driver_callback() to dino_probe() Signed-off-by: Matthew Wilcox <willy@parisc-linux.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/dino.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index 37820b0ae5ee..5ab75334c579 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -178,6 +178,8 @@ static int dino_cfg_read(struct pci_bus *bus, unsigned int devfn, int where,
178 void __iomem *base_addr = d->hba.base_addr; 178 void __iomem *base_addr = d->hba.base_addr;
179 unsigned long flags; 179 unsigned long flags;
180 180
181 DBG("%s: %p, %d, %d, %d\n", __FUNCTION__, base_addr, devfn, where,
182 size);
181 spin_lock_irqsave(&d->dinosaur_pen, flags); 183 spin_lock_irqsave(&d->dinosaur_pen, flags);
182 184
183 /* tell HW which CFG address */ 185 /* tell HW which CFG address */
@@ -211,6 +213,8 @@ static int dino_cfg_write(struct pci_bus *bus, unsigned int devfn, int where,
211 void __iomem *base_addr = d->hba.base_addr; 213 void __iomem *base_addr = d->hba.base_addr;
212 unsigned long flags; 214 unsigned long flags;
213 215
216 DBG("%s: %p, %d, %d, %d\n", __FUNCTION__, base_addr, devfn, where,
217 size);
214 spin_lock_irqsave(&d->dinosaur_pen, flags); 218 spin_lock_irqsave(&d->dinosaur_pen, flags);
215 219
216 /* avoid address stepping feature */ 220 /* avoid address stepping feature */
@@ -295,7 +299,7 @@ static void dino_disable_irq(unsigned int irq)
295 struct dino_device *dino_dev = irq_desc[irq].handler_data; 299 struct dino_device *dino_dev = irq_desc[irq].handler_data;
296 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq); 300 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq);
297 301
298 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, irq_dev, irq); 302 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);
299 303
300 /* Clear the matching bit in the IMR register */ 304 /* Clear the matching bit in the IMR register */
301 dino_dev->imr &= ~(DINO_MASK_IRQ(local_irq)); 305 dino_dev->imr &= ~(DINO_MASK_IRQ(local_irq));
@@ -308,7 +312,7 @@ static void dino_enable_irq(unsigned int irq)
308 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq); 312 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, irq);
309 u32 tmp; 313 u32 tmp;
310 314
311 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, irq_dev, irq); 315 DBG(KERN_WARNING "%s(0x%p, %d)\n", __FUNCTION__, dino_dev, irq);
312 316
313 /* 317 /*
314 ** clear pending IRQ bits 318 ** clear pending IRQ bits
@@ -490,7 +494,7 @@ dino_card_setup(struct pci_bus *bus, void __iomem *base_addr)
490 if (res->start == F_EXTEND(0xf0000000UL | (i * _8MB))) 494 if (res->start == F_EXTEND(0xf0000000UL | (i * _8MB)))
491 break; 495 break;
492 } 496 }
493 DBG("DINO GSC WRITE i=%d, start=%lx, dino addr = %lx\n", 497 DBG("DINO GSC WRITE i=%d, start=%lx, dino addr = %p\n",
494 i, res->start, base_addr + DINO_IO_ADDR_EN); 498 i, res->start, base_addr + DINO_IO_ADDR_EN);
495 __raw_writel(1 << i, base_addr + DINO_IO_ADDR_EN); 499 __raw_writel(1 << i, base_addr + DINO_IO_ADDR_EN);
496} 500}
@@ -683,6 +687,14 @@ static void __init
683dino_card_init(struct dino_device *dino_dev) 687dino_card_init(struct dino_device *dino_dev)
684{ 688{
685 u32 brdg_feat = 0x00784e05; 689 u32 brdg_feat = 0x00784e05;
690 unsigned long status;
691
692 status = __raw_readl(dino_dev->hba.base_addr+DINO_IO_STATUS);
693 if (status & 0x0000ff80) {
694 __raw_writel(0x00000005,
695 dino_dev->hba.base_addr+DINO_IO_COMMAND);
696 udelay(1);
697 }
686 698
687 __raw_writel(0x00000000, dino_dev->hba.base_addr+DINO_GMASK); 699 __raw_writel(0x00000000, dino_dev->hba.base_addr+DINO_GMASK);
688 __raw_writel(0x00000001, dino_dev->hba.base_addr+DINO_IO_FBB_EN); 700 __raw_writel(0x00000001, dino_dev->hba.base_addr+DINO_IO_FBB_EN);
@@ -928,11 +940,11 @@ static int __init dino_probe(struct parisc_device *dev)
928 } 940 }
929 } 941 }
930 942
931 printk("%s version %s found at 0x%lx\n", name, version, dev->hpa); 943 printk("%s version %s found at 0x%lx\n", name, version, hpa);
932 944
933 if (!request_mem_region(dev->hpa, PAGE_SIZE, name)) { 945 if (!request_mem_region(hpa, PAGE_SIZE, name)) {
934 printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%ld)!\n", 946 printk(KERN_ERR "DINO: Hey! Someone took my MMIO space (0x%ld)!\n",
935 dev->hpa); 947 hpa);
936 return 1; 948 return 1;
937 } 949 }
938 950
@@ -940,12 +952,12 @@ static int __init dino_probe(struct parisc_device *dev)
940 if (is_cujo && dev->id.hversion_rev == 1) { 952 if (is_cujo && dev->id.hversion_rev == 1) {
941#ifdef CONFIG_IOMMU_CCIO 953#ifdef CONFIG_IOMMU_CCIO
942 printk(KERN_WARNING "Enabling Cujo 2.0 bug workaround\n"); 954 printk(KERN_WARNING "Enabling Cujo 2.0 bug workaround\n");
943 if (dev->hpa == (unsigned long)CUJO_RAVEN_ADDR) { 955 if (hpa == (unsigned long)CUJO_RAVEN_ADDR) {
944 ccio_cujo20_fixup(dev, CUJO_RAVEN_BADPAGE); 956 ccio_cujo20_fixup(dev, CUJO_RAVEN_BADPAGE);
945 } else if (dev->hpa == (unsigned long)CUJO_FIREHAWK_ADDR) { 957 } else if (hpa == (unsigned long)CUJO_FIREHAWK_ADDR) {
946 ccio_cujo20_fixup(dev, CUJO_FIREHAWK_BADPAGE); 958 ccio_cujo20_fixup(dev, CUJO_FIREHAWK_BADPAGE);
947 } else { 959 } else {
948 printk("Don't recognise Cujo at address 0x%lx, not enabling workaround\n", dev->hpa); 960 printk("Don't recognise Cujo at address 0x%lx, not enabling workaround\n", hpa);
949 } 961 }
950#endif 962#endif
951 } else if (!is_cujo && !is_card_dino(&dev->id) && 963 } else if (!is_cujo && !is_card_dino(&dev->id) &&
@@ -970,7 +982,7 @@ static int __init dino_probe(struct parisc_device *dev)
970 memset(dino_dev, 0, sizeof(struct dino_device)); 982 memset(dino_dev, 0, sizeof(struct dino_device));
971 983
972 dino_dev->hba.dev = dev; 984 dino_dev->hba.dev = dev;
973 dino_dev->hba.base_addr = ioremap(dev->hpa, 4096); /* faster access */ 985 dino_dev->hba.base_addr = ioremap(hpa, 4096);
974 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */ 986 dino_dev->hba.lmmio_space_offset = 0; /* CPU addrs == bus addrs */
975 spin_lock_init(&dino_dev->dinosaur_pen); 987 spin_lock_init(&dino_dev->dinosaur_pen);
976 dino_dev->hba.iommu = ccio_get_iommu(dev); 988 dino_dev->hba.iommu = ccio_get_iommu(dev);