2 #include <arch/pciconf.h>
5 * Direct access to PCI hardware...
8 uint8_t pci_ppc_read_config8(unsigned char bus, int devfn, int where)
12 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
13 res = in_8((unsigned char *)PCIC0_CFGDATA + (where & 3));
17 uint16_t pci_ppc_read_config16(unsigned char bus, int devfn, int where)
21 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
22 res = in_le16((unsigned short *)PCIC0_CFGDATA + (where & 2));
26 uint32_t pci_ppc_read_config32(unsigned char bus, int devfn, int where)
30 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
31 res = in_le32((unsigned *)PCIC0_CFGDATA);
35 int pci_ppc_write_config8(unsigned char bus, int devfn, int where, uint8_t data)
37 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
38 out_8((unsigned char *)PCIC0_CFGDATA + (where & 3), data);
42 int pci_ppc_write_config16(unsigned char bus, int devfn, int where, uint16_t data)
44 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
45 out_le16((unsigned short *)PCIC0_CFGDATA + (where & 2), data);
49 int pci_ppc_write_config32(unsigned char bus, int devfn, int where, uint32_t data)
51 out_le32((unsigned *)PCIC0_CFGADDR, CONFIG_CMD(bus, devfn, where));
52 out_le32((unsigned *)PCIC0_CFGDATA, data);