/* * BCM1480/1455-specific HT support (looking like PCI) * * This module provides the glue between Linux's PCI subsystem * and the hardware. We basically provide glue for accessing * configuration space, and set up the translation for I/O * space accesses. * * To access configuration space, we use ioremap. In the 32-bit * kernel, this consumes either 4 or 8 page table pages, and 16MB of * kernel mapped memory. Hopefully neither of these should be a huge * problem. *
*/ #include <linux/types.h> #include <linux/pci.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/mm.h> #include <linux/console.h> #include <linux/tty.h>
/* * Macros for calculating offsets into config space given a device * structure or dev/fun/reg
*/ #define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where)) #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where)
/* * Some checks before doing config cycles: * In PCI Device Mode, hide everything on bus 0 except the LDT host * bridge. Otherwise, access is controlled by bridge MasterEn bits.
*/ staticint bcm1480ht_can_access(struct pci_bus *bus, int devfn)
{
u32 devno;
if (!(bcm1480ht_bus_status & (PCI_BUS_ENABLED | PCI_DEVICE_MODE))) return 0;
if (bus->number == 0) {
devno = PCI_SLOT(devfn); if (bcm1480ht_bus_status & PCI_DEVICE_MODE) return 0;
} return 1;
}
/* * Read/write access functions for various sizes of values * in config space. Return all 1's for disallowed accesses * for a kludgy but adequate simulation of master aborts.
*/
staticint bcm1480ht_pcibios_read(struct pci_bus *bus, unsignedint devfn, int where, int size, u32 * val)
{
u32 data = 0;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.