if (bus->number > 7) return PCIBIOS_DEVICE_NOT_FOUND; /* * Note: the caller has already checked that off is * suitably aligned and that len is 1, 2 or 4.
*/
cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off); switch (len) { case 1:
*val = in_8(cfg_data); break; case 2:
*val = in_le16(cfg_data); break; default:
*val = in_le32(cfg_data); break;
} return PCIBIOS_SUCCESSFUL;
}
if (bus->number > 7) return PCIBIOS_DEVICE_NOT_FOUND; /* * Note: the caller has already checked that off is * suitably aligned and that len is 1, 2 or 4.
*/
cfg_data = hose->cfg_data + ((bus->number<<16) | (devfn<<8) | off); switch (len) { case 1:
out_8(cfg_data, val); break; case 2:
out_le16(cfg_data, val); break; default:
out_le32(cfg_data, val); break;
} return PCIBIOS_SUCCESSFUL;
}
pci_process_bridge_OF_ranges(hose, dev, index == 0);
/* check the first bridge for a property that we can
use to set pci_dram_offset */
dma = of_get_property(dev, "ibm,dma-ranges", &len); if (index == 0 && dma != NULL && len >= 6 * sizeof(*dma)) {
pci_dram_offset = dma[2] - dma[3];
printk("pci_dram_offset = %lx\n", pci_dram_offset);
}
}
of_node_put(root);
/* * "Temporary" fixes for PCI devices. * -- Geert
*/
hydra_init(); /* Mac I/O */
pci_create_OF_bus_map();
}
/* SL82C105 IDE Control/Status Register */ #define SL82C105_IDECSR 0x40
/* Fixup for Winbond ATA quirk, required for briq mostly because the * 8259 is configured for level sensitive IRQ 14 and so wants the * ATA controller to be set to fully native mode or bad things * will happen.
*/ staticvoid chrp_pci_fixup_winbond_ata(struct pci_dev *sl82c105)
{
u8 progif;
/* If non-briq machines need that fixup too, please speak up */ if (!machine_is(chrp) || _chrp_type != _CHRP_briq) return;
if ((sl82c105->class & 5) != 5) {
printk("W83C553: Switching SL82C105 IDE to PCI native mode\n"); /* Enable SL82C105 PCI native IDE mode */
pci_read_config_byte(sl82c105, PCI_CLASS_PROG, &progif);
pci_write_config_byte(sl82c105, PCI_CLASS_PROG, progif | 0x05);
sl82c105->class |= 0x05; /* Disable SL82C105 second port */
pci_write_config_word(sl82c105, SL82C105_IDECSR, 0x0003); /* Clear IO BARs, they will be reassigned */
pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_0, 0);
pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_1, 0);
pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_2, 0);
pci_write_config_dword(sl82c105, PCI_BASE_ADDRESS_3, 0);
}
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
chrp_pci_fixup_winbond_ata);
/* Pegasos2 firmware version 20040810 configures the built-in IDE controller * in legacy mode, but sets the PCI registers to PCI native mode. * The chip can only operate in legacy mode, so force the PCI class into legacy * mode as well. The same fixup must be done to the class-code property in * the IDE node /pci@80000000/ide@C,1
*/ staticvoid chrp_pci_fixup_vt8231_ata(struct pci_dev *viaide)
{
u8 progif; struct pci_dev *viaisa;
if (!machine_is(chrp) || _chrp_type != _CHRP_Pegasos) return; if (viaide->irq != 14) return;
viaisa = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8231, NULL); if (!viaisa) return;
dev_info(&viaide->dev, "Fixing VIA IDE, force legacy mode on\n");
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.