summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-05-12 21:05:59 +0000
commitba2dacab305c598cd4c34a604f8e276bf5bab5ff (patch)
tree78670a0139bf4d5ace617b29b7eba82bbc74d602 /drivers/pci
parentb77bf69998121e689c5e86cc5630d39a0a9ee6ca (diff)
Merge with Linux 2.3.99-pre7 and various other bits.
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c105
-rw-r--r--drivers/pci/pci.ids58
-rw-r--r--drivers/pci/proc.c2
-rw-r--r--drivers/pci/quirks.c19
4 files changed, 178 insertions, 6 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index ee901ab5d..8866a4b56 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -18,6 +18,7 @@
#include <linux/init.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
+#include <linux/pm.h>
#include <asm/page.h>
#include <asm/dma.h> /* isa_dma_bridge_buggy */
@@ -1020,6 +1021,106 @@ struct pci_bus * __init pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata
return b;
}
+#ifdef CONFIG_PM
+
+/*
+ * PCI Power management..
+ *
+ * This needs to be done centralized, so that we power manage PCI
+ * devices in the right order: we should not shut down PCI bridges
+ * before we've shut down the devices behind them, and we should
+ * not wake up devices before we've woken up the bridge to the
+ * device.. Eh?
+ *
+ * We do not touch devices that don't have a driver that exports
+ * a suspend/resume function. That is just too dangerous. If the default
+ * PCI suspend/resume functions work for a device, the driver can
+ * easily implement them (ie just have a suspend function that calls
+ * the pci_set_power_state() function).
+ */
+static int pci_pm_suspend_device(struct pci_dev *dev)
+{
+ if (dev) {
+ struct pci_driver *driver = dev->driver;
+ if (driver && driver->suspend)
+ driver->suspend(dev);
+ }
+ return 0;
+}
+
+static int pci_pm_resume_device(struct pci_dev *dev)
+{
+ if (dev) {
+ struct pci_driver *driver = dev->driver;
+ if (driver && driver->resume)
+ driver->resume(dev);
+ }
+ return 0;
+}
+
+static int pci_pm_suspend_bus(struct pci_bus *bus)
+{
+ struct list_head *list;
+
+ /* Walk the bus children list */
+ list_for_each(list, &bus->children)
+ pci_pm_suspend_bus(pci_bus_b(list));
+
+ /* Walk the device children list */
+ list_for_each(list, &bus->devices)
+ pci_pm_suspend_device(pci_dev_b(list));
+
+ /* Suspend the bus controller.. */
+ pci_pm_suspend_device(bus->self);
+ return 0;
+}
+
+static int pci_pm_resume_bus(struct pci_bus *bus)
+{
+ struct list_head *list;
+
+ pci_pm_resume_device(bus->self);
+
+ /* Walk the device children list */
+ list_for_each(list, &bus->devices)
+ pci_pm_resume_device(pci_dev_b(list));
+
+ /* And then walk the bus children */
+ list_for_each(list, &bus->children)
+ pci_pm_resume_bus(pci_bus_b(list));
+ return 0;
+}
+
+static int pci_pm_suspend(void)
+{
+ struct list_head *list;
+
+ list_for_each(list, &pci_root_buses)
+ pci_pm_suspend_bus(pci_bus_b(list));
+ return 0;
+}
+
+static int pci_pm_resume(void)
+{
+ struct list_head *list;
+
+ list_for_each(list, &pci_root_buses)
+ pci_pm_resume_bus(pci_bus_b(list));
+ return 0;
+}
+
+static int pci_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+ switch (rqst) {
+ case PM_SUSPEND:
+ return pci_pm_suspend();
+ case PM_RESUME:
+ return pci_pm_resume();
+ }
+ return 0;
+}
+#endif
+
void __init pci_init(void)
{
struct pci_dev *dev;
@@ -1029,6 +1130,10 @@ void __init pci_init(void)
pci_for_each_dev(dev) {
pci_fixup_device(PCI_FIXUP_FINAL, dev);
}
+
+#ifdef CONFIG_PM
+ pm_register(PM_PCI_DEV, 0, pci_pm_callback);
+#endif
}
static int __init pci_setup(char *str)
diff --git a/drivers/pci/pci.ids b/drivers/pci/pci.ids
index 2d9788a31..15fff1fa8 100644
--- a/drivers/pci/pci.ids
+++ b/drivers/pci/pci.ids
@@ -4,7 +4,7 @@
# Maintained by Martin Mares <pci-ids@ucw.cz>
# If you have any new entries, send them to the maintainer.
#
-# $Id: pci.ids,v 1.56 2000/04/17 16:11:58 mj Exp $
+# $Id: pci.ids,v 1.60 2000/05/01 19:53:05 mj Exp $
#
# Vendors, devices and subsystems. Please keep sorted.
@@ -315,7 +315,8 @@
0046 DECchip 21554
9005 1364 Dell PowerEdge RAID Controller 2
9005 1365 Dell PowerEdge RAID Controller 2
- 1065 RAID Controller
+ 1065 StrongARM DC21285
+ 1069 0020 DAC960P
1012 Micronics Computers Inc
1013 Cirrus Logic
0038 GD 7548
@@ -372,6 +373,7 @@
002d Python
002e ServeRAID controller
0036 Miami
+ 003a CPU to PCI Bridge
003e 16/4 Token ring UTP/STP controller
1014 003e Token-Ring Adapter
1014 00cd Token-Ring Adapter + Wake-On-LAN
@@ -379,16 +381,30 @@
1014 00cf 16/4 Token-Ring Adapter Special
1014 00e4 High-Speed 100/16/4 Token-Ring Adapter
1014 00e5 16/4 Token-Ring Adapter 2 + Wake-On-LAN
+ 0045 SSA Adapter
0046 MPIC interrupt controller
0047 PCI to PCI Bridge
0048 PCI to PCI Bridge
+ 004e ATM Controller (14104e00)
+ 004f ATM Controller (14104f00)
+ 0050 ATM Controller (14105000)
0053 25 MBit ATM Controller
0057 MPEG PCI Bridge
005c i82557B 10/100
+ 007c ATM Controller (14107c00)
007d 3780IDSP [MWave]
+ 0090 GXT 3000P
+ 1014 008E GXT-3000P
0095 20H2999 PCI Docking Bridge
+ 00a5 ATM Controller (1410a500)
+ 00a6 ATM 155MBPS MM Controller (1410a600)
00b7 256-bit Graphics Rasterizer [Fire GL1]
1902 00b8 Fire GL1
+ 00be ATM 622MBPS Controller (1410be00)
+ 0142 Yotta Video Compositor Input
+ 1014 0143 Yotta Input Controller (ytin)
+ 0144 Yotta Video Compositor Output
+ 1014 0145 Yotta Output Controller (ytout)
ffff MPIC-2 interrupt controller
1015 LSI Logic Corp of Canada
1016 ICL Personal Systems
@@ -1387,6 +1403,7 @@
1077 VScom 400 4 port serial adaptor
9036 9036
9050 PCI <-> IOBus Bridge
+ 10b5 2273 SH-ARC SoHard ARCnet card
d84d 4006 EX-4006 1P
d84d 4008 EX-4008 1P EPP/ECP
d84d 4014 EX-4014 2P
@@ -2398,6 +2415,7 @@
11ae Aztech System Ltd
11af Avid Technology Inc.
11b0 V3 Semiconductor Inc.
+ 0002 V300PSC
0292 V292PBC [Am29030/40 Bridge]
0960 V96xPBC
c960 V96DPC
@@ -2496,7 +2514,7 @@
0458 LT WinModem
0459 LT WinModem
045a LT WinModem
- 0480 Venus WinModem (V90, 56KFlex)
+ 0480 Venus Modem (V90, 56KFlex)
11c2 Sand Microelectronics
11c3 NEC Corp
11c4 Document Technologies, Inc
@@ -2665,7 +2683,7 @@
139c 0017 Raven
14af 0002 Maxi Gamer Phoenix
3030 3030 Skywell Magic TwinPower
- 0004 Voodoo Banshee
+ 0004 Voodoo Banshee [Velocity 100]
0005 Voodoo 3
121a 0004 Voodoo3 AGP
121a 0030 Voodoo3 AGP
@@ -3014,6 +3032,7 @@
12ad Multidata GmbH
12ae Alteon Networks Inc.
0001 AceNIC Gigabit Ethernet
+ 1410 0104 Gigabit Ethernet-SX PCI Adapter (14100401)
12af TDK USA Corp
12b0 Jorge Scientific Corp
12b1 GammaLink
@@ -3962,6 +3981,25 @@
156f M-Systems Flash Disk Pioneers Ltd
1570 Lecroy Corp
1571 Contemporary Controls
+ a001 CCSI PCI20-485 ARCnet
+ a002 CCSI PCI20-485D ARCnet
+ a003 CCSI PCI20-485X ARCnet
+ a004 CCSI PCI20-CXB ARCnet
+ a005 CCSI PCI20-CXS ARCnet
+ a006 CCSI PCI20-FOG-SMA ARCnet
+ a007 CCSI PCI20-FOG-ST ARCnet
+ a008 CCSI PCI20-TB5 ARCnet
+ a009 CCSI PCI20-5-485 5Mbit ARCnet
+ a00a CCSI PCI20-5-485D 5Mbit ARCnet
+ a00b CCSI PCI20-5-485X 5Mbit ARCnet
+ a00c CCSI PCI20-5-FOG-ST 5Mbit ARCnet
+ a00d CCSI PCI20-5-FOG-SMA 5Mbit ARCnet
+ a201 CCSI PCI22-485 10Mbit ARCnet
+ a202 CCSI PCI22-485D 10Mbit ARCnet
+ a203 CCSI PCI22-485X 10Mbit ARCnet
+ a204 CCSI PCI22-CHB 10Mbit ARCnet
+ a205 CCSI PCI22-FOG_ST 10Mbit ARCnet
+ a206 CCSI PCI22-THB 10Mbit ARCnet
1572 Otis Elevator Company
1573 Lattice - Vantis
1574 Fairchild Semiconductor
@@ -4203,6 +4241,8 @@
45fb Baldor Electric Company
4680 Umax Computer Corp
4843 Hercules Computer Technology Inc
+4916 RedCreek Communications Inc
+ 1960 RedCreek PCI adapter
4943 Growth Networks
4978 Axil Computer Inc
4a14 NetVin
@@ -4728,6 +4768,7 @@ C 02 Network controller
01 Token ring network controller
02 FDDI network controller
03 ATM network controller
+ 04 ISDN controller
80 Network controller
C 03 Display controller
00 VGA compatible controller
@@ -4759,6 +4800,10 @@ C 06 Bridge
08 RACEway bridge
00 Transparent mode
01 Endpoint mode
+ 09 Semi-transparent PCI-to-PCI bridge
+ 40 Primary bus towards host CPU
+ 80 Secondary bus towards host CPU
+ 0a InfiniBand to PCI host bridge
80 Bridge
C 07 Communication controller
00 Serial controller
@@ -4836,6 +4881,7 @@ C 0c Serial bus controller
Fe USB Device
04 Fiber Channel
05 SMBus
+ 06 InfiniBand
C 0d Wireless controller
00 IRDA controller
01 Consumer IR controller
@@ -4850,8 +4896,10 @@ C 0f Satellite communications controller
04 Satellite data communication controller
C 10 Encryption controller
00 Network and computing encryption device
- 01 Entertainment encryption device
+ 10 Entertainment encryption device
80 Encryption controller
C 11 Signal processing controller
00 DPIO module
+ 01 Performance counters
+ 10 Communication synchronizer
80 Signal processing controller
diff --git a/drivers/pci/proc.c b/drivers/pci/proc.c
index 067e25647..703b8c138 100644
--- a/drivers/pci/proc.c
+++ b/drivers/pci/proc.c
@@ -389,7 +389,7 @@ static int pci_read_proc(char *buf, char **start, off_t off,
*eof = 1;
pci_for_each_dev(dev) {
- nprinted = sprint_dev_config(dev, buf + len, count - len);
+ nprinted = sprint_dev_config(dev, buf + len, PAGE_SIZE - len);
if (nprinted < 0) {
*eof = 0;
break;
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 8029b1982..3e1485837 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -164,6 +164,23 @@ static void __init quirk_piix4acpi(struct pci_dev *dev)
}
/*
+ * VIA ACPI: One IO region pointed to by longword at
+ * 0x48 or 0x20 (256 bytes of ACPI registers)
+ */
+static void __init quirk_via_acpi(struct pci_dev *dev)
+{
+ u8 rev;
+ u32 region;
+
+ pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
+ if (rev & 0x10) {
+ pci_read_config_dword(dev, 0x48, &region);
+ region &= PCI_BASE_ADDRESS_IO_MASK;
+ quirk_io_region(dev, region, 256, PCI_BRIDGE_RESOURCES);
+ }
+}
+
+/*
* The main table of quirks.
*/
@@ -192,6 +209,8 @@ static struct pci_fixup pci_fixups[] __initdata = {
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443BX_2, quirk_natoma },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, quirk_nopcipci },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_496, quirk_nopcipci },
+ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_acpi },
+ { PCI_FIXUP_FINAL, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_acpi },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, quirk_piix4acpi },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, quirk_ali7101 },
{ 0 }