20 #include <linux/types.h>
21 #include <linux/pci.h>
22 #include <linux/kernel.h>
26 #define PCI_ACCESS_READ 0
27 #define PCI_ACCESS_WRITE 1
33 #define PCI_CFG_TYPE0_REG_SHF 0
34 #define PCI_CFG_TYPE0_FUNC_SHF 8
37 #define PCI_CFG_TYPE1_REG_SHF 0
38 #define PCI_CFG_TYPE1_FUNC_SHF 8
39 #define PCI_CFG_TYPE1_DEV_SHF 11
40 #define PCI_CFG_TYPE1_BUS_SHF 16
42 static int gt64xxx_pci0_pcibios_config_access(
unsigned char access_type,
48 if ((busnum == 0) && (devfn >=
PCI_DEVFN(31, 0)))
63 if (busnum == 0 &&
PCI_SLOT(devfn) == 0) {
72 if (busnum == 0 &&
PCI_SLOT(devfn) == 0) {
103 static int gt64xxx_pci0_pcibios_read(
struct pci_bus *
bus,
unsigned int devfn,
113 *val = (data >> ((where & 3) << 3)) & 0xff;
115 *val = (data >> ((where & 3) << 3)) & 0xffff;
122 static int gt64xxx_pci0_pcibios_write(
struct pci_bus *bus,
unsigned int devfn,
123 int where,
int size,
u32 val)
131 devfn, where, &data))
135 data = (data & ~(0xff << ((where & 3) << 3))) |
136 (val << ((where & 3) << 3));
138 data = (data & ~(0xffff << ((where & 3) << 3))) |
139 (val << ((where & 3) << 3));
150 .read = gt64xxx_pci0_pcibios_read,
151 .write = gt64xxx_pci0_pcibios_write