PCI subsystem patch

Martin Mares (mj@ucw.cz)
Thu, 5 Aug 1999 22:47:53 +0200


Hello, world!\n

I've just merged most of my new PCI changes with the stuff Linus
wrote in pre-2.3.13-6. The result is available on ftp://atrey.karlin.mff.cuni.cz/
pub/linux/pci/alpha/l-pci-resource-2.3.13-6.gz and you can read the
summary of my changes just below.

Have a nice fortnight

-- 
Martin `MJ' Mares   <mj@ucw.cz>   http://atrey.karlin.mff.cuni.cz/~mj/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
"New PC concept: "plug and pray""

Summary of changes:

o Merged in my base address / region size reading code. o Expansion ROM is now the seventh resource region. o PCI quirks are no longer optional since they contain vital fixes. o PCI bridge optimization removed, it's broken since beginning and there's a nice userland utility doing these things. o Moved locking of configuration space accesses and alignment checks to generic code. o i386 support code now supports a new parameter "pci=rom" which causes address space to be assigned to expansion ROMs (just an experimental feature). o i386: allocation of I/O regions forgotten by the BIOS now uses the new resource management code. o Use pci_dev->name whereever possible. o pcibios_fixup_ghosts: you cannot use memcmp for comparison of resource structs since they contain name pointers. o PCI resources are prepared in generic code, but really allocated in the arch-dependent one since many architectures need to assign the addresses themselves. o Changed the low-level configuration register interface -- the old one was very messy and all architectures had to have their own config mechanism multiplexer routines and lookup tables mapping PCI bus numbers to internal ones. I've added a pointer to struct pci_ops to struct pci_bus and all operations now go through function pointers contained in this structure and these functions are passed a pointer to struct pci_dev where they can access their private data. - pci_{read,write}_config_{byte,word,dword}() are now the only official interface to configuration space access. They do all checks and locking automatically. - pcibios_* functions are now just a compatibility glue kept in compat.c and doing pci_find_slot and pci_*_config_*. - PCI bus probing is now controlled by the arch-dependent code. pci_init() calls pcibios_init() which initializes the low-level conf access code and calls pci_scan_bus() for all the host buses it knows, passing bus number, private data and pointer to struct pci_ops to it. Then it does all the fixups needed, allocates resources and returns back to pci_init() which initializes the rest. o Unified bug fixups: There are two tables of fixup hooks now -- a generic one in quirks.c and a arch-specific one. Each fixup entry contains vendor and device ID (can be PCI_ANY_ID), function pointer to call and it also specifies the time the fixup should be used -- either immediately after the configuration header is read [used especially for fixing up bogus headers] or during the normal fixup phase [when addresses are assigned and resources allocated]. o names.c are compiled always, not only when modules are enabled. o Replaced all calls to pcibios_* in generic PCI code by their pci_* counterparts. o names.c: pci_namedevice renamed to pci_name_device and added to pci.h. o names.c: Use the bus:dev.func notation used everywhere else in the kernel. o Introduced pci_request_device() and pci_release_device() which should be used by all new drivers to allocate whole PCI devices instead of attempting to allocate the resource regions separately. o Added subsystem vendor and device ID to struct pci_dev since several drivers need to find their devices by these ID's. o "pci=..." options work again. o Synced configuration header declarations in pci.h with PCI specs version 2.2. o /proc/bus/pci/devices report region sizes as well. o Added macros PCI_REGION_* for easy manipulation with PCI resources. o pci_present now just tests that there are any PCI devices.

Still on my TODO list:

o Repair all architectures broken by this patch. o Start fixing all drivers bitten by PCI / resource mgmt changes. o Remove enabling of expansion ROMs from IDE drivers. o ioctl() for setting of kernel view of IRQ's and addresses. o Do something with device naming and /proc/pci. o Create pci_find_subsystem(). o Test automatic allocation of I/O ports. o Update Documentation/pci.txt. o Try compiling without PCI and without BIOS / direct access. o Fixups for broken S3 cards. o Register main RAM in resource manager and remove all the artificial bounds we use when allocating regions now. o Remove #if 0 around the AGP bridge fixup after checking it's correct. o Read all the PCI sources and search for bugs :-) o [maybe for 2.5] allow PCI drivers to register their init functions along with ID's of all devices they want passed.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/