Lines Matching +full:data +full:- +full:bus

19  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
34 #include <asm/mach-rc32434/rc32434.h>
35 #include <asm/mach-rc32434/pci.h>
41 #define PCI_CFG_SET(bus, slot, func, off) \ argument
42 (rc32434_pci->pcicfga = (0x80000000 | \
43 ((bus) << 16) | ((slot)<<11) | \
47 struct pci_bus *bus, unsigned int devfn, in config_access() argument
48 unsigned char where, u32 *data) in config_access() argument
54 PCI_CFG_SET(bus->number, slot, func, where); in config_access()
58 rc32434_pci->pcicfgd = *data; in config_access()
60 *data = rc32434_pci->pcicfgd; in config_access()
70 * read/write a 32bit word and mask/modify the data we actually want.
72 static int read_config_byte(struct pci_bus *bus, unsigned int devfn, in read_config_byte() argument
75 u32 data; in read_config_byte() local
78 ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); in read_config_byte()
79 *val = (data >> ((where & 3) << 3)) & 0xff; in read_config_byte()
83 static int read_config_word(struct pci_bus *bus, unsigned int devfn, in read_config_word() argument
86 u32 data; in read_config_word() local
89 ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); in read_config_word()
90 *val = (data >> ((where & 3) << 3)) & 0xffff; in read_config_word()
94 static int read_config_dword(struct pci_bus *bus, unsigned int devfn, in read_config_dword() argument
104 if (bus->number == 0 && PCI_SLOT(devfn) > 21) in read_config_dword()
108 ret = config_access(PCI_ACCESS_READ, bus, devfn, where, val); in read_config_dword()
129 write_config_byte(struct pci_bus *bus, unsigned int devfn, int where, in write_config_byte() argument
132 u32 data = 0; in write_config_byte() local
134 if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) in write_config_byte()
135 return -1; in write_config_byte()
137 data = (data & ~(0xff << ((where & 3) << 3))) | in write_config_byte()
140 if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) in write_config_byte()
141 return -1; in write_config_byte()
148 write_config_word(struct pci_bus *bus, unsigned int devfn, int where, in write_config_word() argument
151 u32 data = 0; in write_config_word() local
153 if (config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) in write_config_word()
154 return -1; in write_config_word()
156 data = (data & ~(0xffff << ((where & 3) << 3))) | in write_config_word()
159 if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) in write_config_word()
160 return -1; in write_config_word()
168 write_config_dword(struct pci_bus *bus, unsigned int devfn, int where, in write_config_dword() argument
171 if (config_access(PCI_ACCESS_WRITE, bus, devfn, where, &val)) in write_config_dword()
172 return -1; in write_config_dword()
177 static int pci_config_read(struct pci_bus *bus, unsigned int devfn, in pci_config_read() argument
182 return read_config_byte(bus, devfn, where, (u8 *) val); in pci_config_read()
184 return read_config_word(bus, devfn, where, (u16 *) val); in pci_config_read()
186 return read_config_dword(bus, devfn, where, val); in pci_config_read()
190 static int pci_config_write(struct pci_bus *bus, unsigned int devfn, in pci_config_write() argument
195 return write_config_byte(bus, devfn, where, (u8) val); in pci_config_write()
197 return write_config_word(bus, devfn, where, (u16) val); in pci_config_write()
199 return write_config_dword(bus, devfn, where, val); in pci_config_write()