patch-2.3.99-pre6 linux/arch/arm/kernel/dec21285.c

Next file: linux/arch/arm/kernel/entry-common.S
Previous file: linux/arch/arm/kernel/debug-armv.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/arch/arm/kernel/dec21285.c linux/arch/arm/kernel/dec21285.c
@@ -23,18 +23,28 @@
 #define MAX_SLOTS		21
 
 extern int setup_arm_irq(int, struct irqaction *);
-extern void pcibios_report_device_errors(void);
+extern void pcibios_report_device_errors(int warn);
 
 static unsigned long
-dc21285_base_address(struct pci_dev *dev, int where)
+dc21285_base_address(struct pci_dev *dev)
 {
 	unsigned long addr = 0;
 	unsigned int devfn = dev->devfn;
 
-	if (dev->bus->number != 0)
+	if (dev->bus->number == 0) {
+		if (PCI_SLOT(devfn) == 0)
+			/*
+			 * For devfn 0, point at the 21285
+			 */
+			addr = ARMCSR_BASE;
+		else {
+			devfn -= 1 << 3;
+
+			if (devfn < PCI_DEVFN(MAX_SLOTS, 0))
+				addr = PCICFG0_BASE | 0xc00000 | (devfn << 8);
+		}
+	} else
 		addr = PCICFG1_BASE | (dev->bus->number << 16) | (devfn << 8);
-	else if (devfn < PCI_DEVFN(MAX_SLOTS, 0))
-		addr = PCICFG0_BASE | 0xc00000 | (devfn << 8);
 
 	return addr;
 }
@@ -42,7 +52,7 @@
 static int
 dc21285_read_config_byte(struct pci_dev *dev, int where, u8 *value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 	u8 v;
 
 	if (addr)
@@ -59,7 +69,7 @@
 static int
 dc21285_read_config_word(struct pci_dev *dev, int where, u16 *value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 	u16 v;
 
 	if (addr)
@@ -76,7 +86,7 @@
 static int
 dc21285_read_config_dword(struct pci_dev *dev, int where, u32 *value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 	u32 v;
 
 	if (addr)
@@ -93,7 +103,7 @@
 static int
 dc21285_write_config_byte(struct pci_dev *dev, int where, u8 value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 
 	if (addr)
 		asm("str%?b	%0, [%1, %2]"
@@ -105,7 +115,7 @@
 static int
 dc21285_write_config_word(struct pci_dev *dev, int where, u16 value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 
 	if (addr)
 		asm("str%?h	%0, [%1, %2]"
@@ -117,7 +127,7 @@
 static int
 dc21285_write_config_dword(struct pci_dev *dev, int where, u32 value)
 {
-	unsigned long addr = dc21285_base_address(dev, where);
+	unsigned long addr = dc21285_base_address(dev);
 
 	if (addr)
 		asm("str%?	%0, [%1, %2]"
@@ -147,6 +157,9 @@
 	unsigned long irqstatus = *CSR_IRQ_RAWSTATUS;
 	int warn = time_after_eq(jiffies, next_warn);
 
+	if (machine_is_netwinder())
+		warn = 0;
+
 	ctrl |= SA110_CNTL_DISCARDTIMER;
 
 	if (warn) {
@@ -193,7 +206,7 @@
 	if (warn)
 		printk("pc=[<%08lX>]\n", instruction_pointer(regs));
 
-	pcibios_report_device_errors();
+	pcibios_report_device_errors(warn);
 
 	*CSR_PCICMD = cmd;
 	*CSR_SA110_CNTL = ctrl;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)