9 #include <linux/types.h>
10 #include <linux/pci.h>
11 #include <linux/kernel.h>
15 #include <asm/addrspace.h>
18 #include <lantiq_soc.h>
22 #define LTQ_PCI_CFG_BUSNUM_SHF 16
23 #define LTQ_PCI_CFG_DEVNUM_SHF 11
24 #define LTQ_PCI_CFG_FUNNUM_SHF 8
26 #define PCI_ACCESS_READ 0
27 #define PCI_ACCESS_WRITE 1
29 static int ltq_pci_config_access(
unsigned char access_type,
struct pci_bus *
bus,
32 unsigned long cfg_base;
38 if ((bus->
number != 0) || ((devfn & 0xf8) > 0x78)
39 || ((devfn & 0xf8) == 0) || ((devfn & 0xf8) == 0x68))
66 spin_unlock_irqrestore(&
ebu_lock, flags);
83 *val = (data >> ((where & 3) << 3)) & 0xff;
85 *val = (data >> ((where & 3) << 3)) & 0xffff;
101 devfn, where, &data))
105 data = (data & ~(0xff << ((where & 3) << 3))) |
106 (val << ((where & 3) << 3));
108 data = (data & ~(0xffff << ((where & 3) << 3))) |
109 (val << ((where & 3) << 3));