static int ks8695_pci_writeconfig(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { unsigned long tmp; if (pci_cfg_dbg) { printk("write: %d,%08x,%02x,%d: %08x\n", bus->number, devfn, where, size, value); } ks8695_pci_setupconfig(bus->number, devfn, where); switch (size) { case 4: __raw_writel(value, KS8695_PCI_VA + KS8695_PBCD); break; case 2: tmp = __raw_readl(KS8695_PCI_VA + KS8695_PBCD); tmp &= ~(0xffff << ((where & 2) * 8)); tmp |= value << ((where & 2) * 8); __raw_writel(tmp, KS8695_PCI_VA + KS8695_PBCD); break; case 1: tmp = __raw_readl(KS8695_PCI_VA + KS8695_PBCD); tmp &= ~(0xff << ((where & 3) * 8)); tmp |= value << ((where & 3) * 8); __raw_writel(tmp, KS8695_PCI_VA + KS8695_PBCD); break; } return PCIBIOS_SUCCESSFUL; }
static int ks8695_pci_readconfig(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { ks8695_pci_setupconfig(bus->number, devfn, where); *value = __raw_readl(KS8695_PCI_VA + KS8695_PBCD); switch (size) { case 4: break; case 2: *value = *value >> ((where & 2) * 8); *value &= 0xffff; break; case 1: *value = *value >> ((where & 3) * 8); *value &= 0xff; break; } if (pci_cfg_dbg) { printk("read: %d,%08x,%02x,%d: %08x (%08x)\n", bus->number, devfn, where, size, *value, __raw_readl(KS8695_PCI_VA + KS8695_PBCD)); } return PCIBIOS_SUCCESSFUL; }
static void ks8695_local_writeconfig(int where, u32 value) { ks8695_pci_setupconfig(0, 0, where); __raw_writel(value, KS8695_PCI_VA + KS8695_PBCD); }
static void __iomem *ks8695_pci_map_bus(struct pci_bus *bus, unsigned int devfn, int where) { ks8695_pci_setupconfig(bus->number, devfn, where); return KS8695_PCI_VA + KS8695_PBCD; }