staticint loongson_pcibios_config_access(unsignedchar access_type, struct pci_bus *bus, unsignedint devfn, int where,
u32 *data)
{
u32 busnum = bus->number;
u32 addr, type;
u32 dummy; void *addrp; int device = PCI_SLOT(devfn); int function = PCI_FUNC(devfn); int reg = where & ~3;
if (busnum == 0) { /* board-specific part,currently,only fuloong2f,yeeloong2f * use CS5536, fuloong2e use via686b, gdium has no * south bridge
*/ #ifdef CONFIG_CS5536 /* cs5536_pci_conf_read4/write4() will call _rdmsr/_wrmsr() to * access the registers PCI_MSR_ADDR, PCI_MSR_DATA_LO, * PCI_MSR_DATA_HI, which is bigger than PCI_MSR_CTRL, so, it * will not go this branch, but the others. so, no calling dead * loop here.
*/ if ((PCI_IDSEL_CS5536 == device) && (reg < PCI_MSR_CTRL)) { switch (access_type) { case PCI_ACCESS_READ:
*data = cs5536_pci_conf_read4(function, reg); break; case PCI_ACCESS_WRITE:
cs5536_pci_conf_write4(function, reg, *data); break;
} return 0;
} #endif /* Type 0 configuration for onboard PCI bus */ if (device > MAX_DEV_NUM) return -1;
addr = (1 << (device + ID_SEL_BEGIN)) | (function << 8) | reg;
type = 0;
} else { /* Type 1 configuration for offboard PCI bus */
addr = (busnum << 16) | (device << 11) | (function << 8) | reg;
type = 0x10000;
}
/* * We can't address 8 and 16 bit words directly. Instead we have to * read/write a 32bit word and mask/modify the data we actually want.
*/ staticint loongson_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.