summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-12-19 21:41:04 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-12-19 21:41:04 +0000
commite8258da96486cb06f8f08d7f116b8aa669ce35a8 (patch)
tree2128818a1c76373a8d033eae33e5c5b184df18b5
parent6a5a5e896bf566966bc9e3dcfe13d9e171ca880b (diff)
downloadmtk-20170518-e8258da96486cb06f8f08d7f116b8aa669ce35a8.zip
mtk-20170518-e8258da96486cb06f8f08d7f116b8aa669ce35a8.tar.gz
mtk-20170518-e8258da96486cb06f8f08d7f116b8aa669ce35a8.tar.bz2
add a better pci fix for rb532
SVN-Revision: 5861
-rw-r--r--target/linux/rb532-2.6/patches/100-rb5xx_support.patch27
-rw-r--r--target/linux/rb532-2.6/patches/210-pci_fixes.patch46
2 files changed, 25 insertions, 48 deletions
diff --git a/target/linux/rb532-2.6/patches/100-rb5xx_support.patch b/target/linux/rb532-2.6/patches/100-rb5xx_support.patch
index 43e68c0..45c8fe3 100644
--- a/target/linux/rb532-2.6/patches/100-rb5xx_support.patch
+++ b/target/linux/rb532-2.6/patches/100-rb5xx_support.patch
@@ -130,13 +130,14 @@ diff -urN linux.old/arch/mips/pci/Makefile linux.dev/arch/mips/pci/Makefile
diff -urN linux.old/arch/mips/pci/ops-rc32434.c linux.dev/arch/mips/pci/ops-rc32434.c
--- linux.old/arch/mips/pci/ops-rc32434.c 1970-01-01 01:00:00.000000000 +0100
+++ linux.dev/arch/mips/pci/ops-rc32434.c 2006-12-14 04:09:50.000000000 +0100
-@@ -0,0 +1,195 @@
+@@ -0,0 +1,218 @@
+/**************************************************************************
+ *
+ * BRIEF MODULE DESCRIPTION
+ * pci_ops for IDT EB434 board
+ *
+ * Copyright 2004 IDT Inc. (rischelp@idt.com)
++ * Copyright 2006 Felix Fietkau <nbd@openwrt.org>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
@@ -242,8 +243,30 @@ diff -urN linux.old/arch/mips/pci/ops-rc32434.c linux.dev/arch/mips/pci/ops-rc32
+ int where, u32 * val)
+{
+ int ret;
-+
++ int delay = 1;
++
++ if (bus->number == 0 && (devfn >> 3) > 21)
++ return 0;
++
++retry:
+ ret = config_access(PCI_ACCESS_READ, bus, devfn, where, val);
++
++ /* PCI scan: check for invalid values, device may not have
++ * finished initializing */
++
++ if (where == PCI_VENDOR_ID) {
++ if (ret == 0xffffffff || ret == 0x00000000 ||
++ ret == 0x0000ffff || ret == 0xffff0000) {
++
++ if (delay > 4)
++ return 0;
++
++ delay *= 2;
++ msleep(delay);
++ goto retry;
++ }
++ }
++
+ return ret;
+}
+
diff --git a/target/linux/rb532-2.6/patches/210-pci_fixes.patch b/target/linux/rb532-2.6/patches/210-pci_fixes.patch
deleted file mode 100644
index 02cd2f0..0000000
--- a/target/linux/rb532-2.6/patches/210-pci_fixes.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-diff -urN linux.old/drivers/pci/probe.c linux.dev/drivers/pci/probe.c
---- linux.old/drivers/pci/probe.c 2006-06-08 20:21:20.000000000 +0200
-+++ linux.dev/drivers/pci/probe.c 2006-06-08 20:19:40.000000000 +0200
-@@ -760,15 +760,22 @@
- u32 l;
- u8 hdr_type;
- int delay = 1;
--
-- if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
-- return NULL;
--
-- /* some broken boards return 0 or ~0 if a slot is empty: */
-- if (l == 0xffffffff || l == 0x00000000 ||
-- l == 0x0000ffff || l == 0xffff0000)
-- return NULL;
--
-+ do {
-+ if (pci_bus_read_config_dword(bus, devfn, PCI_VENDOR_ID, &l))
-+ return NULL;
-+ /* some broken boards return 0 or ~0 if a slot is empty: */
-+ if (l == 0xffffffff || l == 0x00000000 ||
-+ l == 0x0000ffff || l == 0xffff0000){
-+ if (delay > 4)
-+ return NULL;
-+ /* But that could also be the previous dev not settled */
-+ pr_debug("PCI: retrying scan at 0x%x, because config is 0x%x\n",devfn,l);
-+ msleep(delay);
-+ delay *=2;
-+ l=0;
-+ }
-+ }while (l==0);
-+
- /* Configuration request Retry Status */
- while (l == 0xffff0001) {
- msleep(delay);
-@@ -903,7 +910,10 @@
-
- /* Go find them, Rover! */
- for (devfn = 0; devfn < 0x100; devfn += 8)
-+ {
-+ if (bus->number == 0 && (devfn >> 3) > 21) break;
- pci_scan_slot(bus, devfn);
-+ }
-
- /*
- * After performing arch-dependent fixup of the bus, look behind