Home
last modified time | relevance | path

Searched refs:devfn (Results 1 – 25 of 148) sorted by relevance

123456

/arch/mips/pci/
A Dops-rc32434.c47 struct pci_bus *bus, unsigned int devfn, in config_access() argument
50 unsigned int slot = PCI_SLOT(devfn); in config_access()
51 u8 func = PCI_FUNC(devfn); in config_access()
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()
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()
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()
[all …]
A Dops-sni.c26 if ((devfn > 255) || (reg > 255)) in set_config_address()
29 if (busno == 0 && devfn >= PCI_DEVFN(8, 0)) in set_config_address()
34 ((devfn & 0xff) << 8) | in set_config_address()
40 static int pcimt_read(struct pci_bus *bus, unsigned int devfn, int reg, in pcimt_read() argument
45 if ((res = set_config_address(bus->number, devfn, reg))) in pcimt_read()
68 if ((res = set_config_address(bus->number, devfn, reg))) in pcimt_write()
93 if ((devfn > 255) || (reg > 255) || (busno > 255)) in pcit_set_config_address()
100 static int pcit_read(struct pci_bus *bus, unsigned int devfn, int reg, in pcit_read() argument
113 if ((res = pcit_set_config_address(0, devfn, 0))) in pcit_read()
120 if ((res = pcit_set_config_address(bus->number, devfn, reg))) in pcit_read()
[all …]
A Dops-loongson2.c34 unsigned int devfn, int where, in loongson_pcibios_config_access() argument
41 int device = PCI_SLOT(devfn); in loongson_pcibios_config_access()
42 int function = PCI_FUNC(devfn); in loongson_pcibios_config_access()
187 u32 devfn = PCI_DEVFN(PCI_IDSEL_CS5536, 0); in _rdmsr() local
191 loongson_pcibios_write(&bus, devfn, PCI_MSR_ADDR, 4, msr); in _rdmsr()
192 loongson_pcibios_read(&bus, devfn, PCI_MSR_DATA_LO, 4, lo); in _rdmsr()
193 loongson_pcibios_read(&bus, devfn, PCI_MSR_DATA_HI, 4, hi); in _rdmsr()
203 u32 devfn = PCI_DEVFN(PCI_IDSEL_CS5536, 0); in _wrmsr() local
207 loongson_pcibios_write(&bus, devfn, PCI_MSR_ADDR, 4, msr); in _wrmsr()
208 loongson_pcibios_write(&bus, devfn, PCI_MSR_DATA_LO, 4, lo); in _wrmsr()
[all …]
A Dpci-bcm1480ht.c38 #define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where)) argument
39 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument
75 static int bcm1480ht_can_access(struct pci_bus *bus, int devfn) in bcm1480ht_can_access() argument
83 devno = PCI_SLOT(devfn); in bcm1480ht_can_access()
96 static int bcm1480ht_pcibios_read(struct pci_bus *bus, unsigned int devfn, in bcm1480ht_pcibios_read() argument
106 if (bcm1480ht_can_access(bus, devfn)) in bcm1480ht_pcibios_read()
107 data = READCFG32(CFGADDR(bus, devfn, where)); in bcm1480ht_pcibios_read()
121 static int bcm1480ht_pcibios_write(struct pci_bus *bus, unsigned int devfn, in bcm1480ht_pcibios_write() argument
124 u32 cfgaddr = CFGADDR(bus, devfn, where); in bcm1480ht_pcibios_write()
132 if (!bcm1480ht_can_access(bus, devfn)) in bcm1480ht_pcibios_write()
A Dops-bcm63xx.c65 unsigned int devfn, int where) in bcm63xx_setup_cfg_access() argument
70 slot = PCI_SLOT(devfn); in bcm63xx_setup_cfg_access()
71 func = PCI_FUNC(devfn); in bcm63xx_setup_cfg_access()
101 unsigned int devfn, int where, int size, in bcm63xx_do_cfg_read() argument
378 PCI_SLOT(devfn) == 0) in bcm63xx_cb_read()
396 PCI_SLOT(devfn) == 0) in bcm63xx_cb_write()
438 PCI_SLOT(dev->devfn) == 0) in bcm63xx_fixup()
472 return PCI_SLOT(devfn) == 0; in bcm63xx_pcie_can_access()
474 if (PCI_SLOT(devfn) == 0) in bcm63xx_pcie_can_access()
489 if (!bcm63xx_pcie_can_access(bus, devfn)) in bcm63xx_pcie_read()
[all …]
A Dops-gt64xxx_pci0.c31 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) in gt64xxx_pci0_pcibios_config_access() argument
36 if ((busnum == 0) && (devfn >= PCI_DEVFN(31, 0))) in gt64xxx_pci0_pcibios_config_access()
46 (devfn << GT_PCI0_CFGADDR_FUNCTNUM_SHF) | in gt64xxx_pci0_pcibios_config_access()
51 if (busnum == 0 && PCI_SLOT(devfn) == 0) { in gt64xxx_pci0_pcibios_config_access()
60 if (busnum == 0 && PCI_SLOT(devfn) == 0) { in gt64xxx_pci0_pcibios_config_access()
91 static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn, in gt64xxx_pci0_pcibios_read() argument
96 if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, in gt64xxx_pci0_pcibios_read()
110 static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn, in gt64xxx_pci0_pcibios_write() argument
119 devfn, where, &data)) in gt64xxx_pci0_pcibios_write()
130 if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, in gt64xxx_pci0_pcibios_write()
A Dops-lantiq.c27 unsigned int devfn, unsigned int where, u32 *data) in ltq_pci_config_access() argument
35 if ((bus->number != 0) || ((devfn & 0xf8) > 0x78) in ltq_pci_config_access()
36 || ((devfn & 0xf8) == 0) || ((devfn & 0xf8) == 0x68)) in ltq_pci_config_access()
42 cfg_base |= (bus->number << LTQ_PCI_CFG_BUSNUM_SHF) | (devfn << in ltq_pci_config_access()
71 int ltq_pci_read_config_dword(struct pci_bus *bus, unsigned int devfn, in ltq_pci_read_config_dword() argument
76 if (ltq_pci_config_access(PCI_ACCESS_READ, bus, devfn, where, &data)) in ltq_pci_read_config_dword()
89 int ltq_pci_write_config_dword(struct pci_bus *bus, unsigned int devfn, in ltq_pci_write_config_dword() argument
98 devfn, where, &data)) in ltq_pci_write_config_dword()
109 if (ltq_pci_config_access(PCI_ACCESS_WRITE, bus, devfn, where, &data)) in ltq_pci_write_config_dword()
A Dpci-bcm1480.c40 #define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where)) argument
41 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument
84 static int bcm1480_pci_can_access(struct pci_bus *bus, int devfn) in bcm1480_pci_can_access() argument
92 devno = PCI_SLOT(devfn); in bcm1480_pci_can_access()
107 static int bcm1480_pcibios_read(struct pci_bus *bus, unsigned int devfn, in bcm1480_pcibios_read() argument
117 if (bcm1480_pci_can_access(bus, devfn)) in bcm1480_pcibios_read()
118 data = READCFG32(CFGADDR(bus, devfn, where)); in bcm1480_pcibios_read()
132 static int bcm1480_pcibios_write(struct pci_bus *bus, unsigned int devfn, in bcm1480_pcibios_write() argument
135 u32 cfgaddr = CFGADDR(bus, devfn, where); in bcm1480_pcibios_write()
143 if (!bcm1480_pci_can_access(bus, devfn)) in bcm1480_pcibios_write()
A Dpci-sb1250.c40 #define CFGOFFSET(bus, devfn, where) (((bus)<<16) + ((devfn)<<8) + (where)) argument
41 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument
91 static int sb1250_pci_can_access(struct pci_bus *bus, int devfn) in sb1250_pci_can_access() argument
99 devno = PCI_SLOT(devfn); in sb1250_pci_can_access()
116 static int sb1250_pcibios_read(struct pci_bus *bus, unsigned int devfn, in sb1250_pcibios_read() argument
126 if (sb1250_pci_can_access(bus, devfn)) in sb1250_pcibios_read()
127 data = READCFG32(CFGADDR(bus, devfn, where)); in sb1250_pcibios_read()
141 static int sb1250_pcibios_write(struct pci_bus *bus, unsigned int devfn, in sb1250_pcibios_write() argument
144 u32 cfgaddr = CFGADDR(bus, devfn, where); in sb1250_pcibios_write()
152 if (!sb1250_pci_can_access(bus, devfn)) in sb1250_pcibios_write()
A Dops-mace.c30 static inline int mkaddr(struct pci_bus *bus, unsigned int devfn, in mkaddr() argument
34 ((devfn & 0xff) << 8) | in mkaddr()
40 mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, in mace_pci_read_config() argument
47 mace->pci.config_addr = mkaddr(bus, devfn, reg); in mace_pci_read_config()
67 (devfn == (1 << 3) || devfn == (2 << 3))) in mace_pci_read_config()
76 mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, in mace_pci_write_config() argument
79 mace->pci.config_addr = mkaddr(bus, devfn, reg); in mace_pci_write_config()
A Dops-msc.c34 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) in msc_pcibios_config_access() argument
45 (PCI_SLOT(devfn) << MSC01_PCI_CFGADDR_DNUM_SHF) | in msc_pcibios_config_access()
46 (PCI_FUNC(devfn) << MSC01_PCI_CFGADDR_FNUM_SHF) | in msc_pcibios_config_access()
75 static int msc_pcibios_read(struct pci_bus *bus, unsigned int devfn, in msc_pcibios_read() argument
85 if (msc_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, in msc_pcibios_read()
99 static int msc_pcibios_write(struct pci_bus *bus, unsigned int devfn, in msc_pcibios_write() argument
112 if (msc_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, in msc_pcibios_write()
124 if (msc_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where, in msc_pcibios_write()
A Dops-bonito64.c26 unsigned int devfn, int where, in bonito64_pcibios_config_access() argument
33 int device = PCI_SLOT(devfn); in bonito64_pcibios_config_access()
34 int function = PCI_FUNC(devfn); in bonito64_pcibios_config_access()
89 static int bonito64_pcibios_read(struct pci_bus *bus, unsigned int devfn, in bonito64_pcibios_read() argument
99 if (bonito64_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, in bonito64_pcibios_read()
113 static int bonito64_pcibios_write(struct pci_bus *bus, unsigned int devfn, in bonito64_pcibios_write() argument
126 if (bonito64_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, in bonito64_pcibios_write()
138 if (bonito64_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where, in bonito64_pcibios_write()
/arch/x86/pci/
A Ddirect.c17 #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ argument
19 | (devfn << 8) | (reg & 0xFC))
22 unsigned int devfn, int reg, int len, u32 *value) in pci_conf1_read() argument
33 outl(PCI_CONF1_ADDRESS(bus, devfn, reg), 0xCF8); in pci_conf1_read()
62 outl(PCI_CONF1_ADDRESS(bus, devfn, reg), 0xCF8); in pci_conf1_write()
107 dev = PCI_SLOT(devfn); in pci_conf2_read()
108 fn = PCI_FUNC(devfn); in pci_conf2_read()
147 dev = PCI_SLOT(devfn); in pci_conf2_write()
148 fn = PCI_FUNC(devfn); in pci_conf2_write()
198 int devfn; in pci_sanity_check() local
[all …]
A Dintel_mid.c77 devfn, pos, 4, &pcie_cap)) in fixed_bar_cap()
86 devfn, pos + 4, 4, &cap_data); in fixed_bar_cap()
110 raw_pci_ext_ops->read(domain, busnum, devfn, in pci_device_update_fixed()
164 if (bus == 0 && (devfn == PCI_DEVFN(2, 0) in type1_access_ok()
165 || devfn == PCI_DEVFN(0, 0) in type1_access_ok()
166 || devfn == PCI_DEVFN(3, 0))) in type1_access_ok()
176 devfn, where, size, value); in pci_read()
178 devfn, where, size, value); in pci_read()
199 offset = fixed_bar_cap(bus, devfn); in pci_write()
213 devfn, where, size, value); in pci_write()
[all …]
A Dnumachip.c19 static inline char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) in pci_dev_base() argument
24 return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12)); in pci_dev_base()
29 unsigned int devfn, int reg, int len, u32 *value) in pci_mmcfg_read_numachip() argument
34 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { in pci_mmcfg_read_numachip()
40 if (unlikely(bus == 0 && devfn >= limit)) { in pci_mmcfg_read_numachip()
46 addr = pci_dev_base(seg, bus, devfn); in pci_mmcfg_read_numachip()
69 unsigned int devfn, int reg, int len, u32 value) in pci_mmcfg_write_numachip() argument
74 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) in pci_mmcfg_write_numachip()
78 if (unlikely(bus == 0 && devfn >= limit)) in pci_mmcfg_write_numachip()
82 addr = pci_dev_base(seg, bus, devfn); in pci_mmcfg_write_numachip()
A Dmmconfig_32.c27 static u32 get_base_addr(unsigned int seg, int bus, unsigned devfn) in get_base_addr() argument
39 static void pci_exp_set_dev_base(unsigned int base, int bus, int devfn) in pci_exp_set_dev_base() argument
41 u32 dev_base = base | PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12); in pci_exp_set_dev_base()
52 unsigned int devfn, int reg, int len, u32 *value) in pci_mmcfg_read() argument
57 if ((bus > 255) || (devfn > 255) || (reg > 4095)) { in pci_mmcfg_read()
63 base = get_base_addr(seg, bus, devfn); in pci_mmcfg_read()
71 pci_exp_set_dev_base(base, bus, devfn); in pci_mmcfg_read()
91 unsigned int devfn, int reg, int len, u32 value) in pci_mmcfg_write() argument
96 if ((bus > 255) || (devfn > 255) || (reg > 4095)) in pci_mmcfg_write()
100 base = get_base_addr(seg, bus, devfn); in pci_mmcfg_write()
[all …]
A Dolpc.c170 static int is_simulated(unsigned int bus, unsigned int devfn) in is_simulated() argument
172 return (!bus && ((PCI_SLOT(devfn) == NB_SLOT) || in is_simulated()
173 (PCI_SLOT(devfn) == SB_SLOT))); in is_simulated()
198 unsigned int devfn, int reg, int len, uint32_t *value) in pci_olpc_read() argument
205 if (!is_simulated(bus, devfn)) in pci_olpc_read()
206 return pci_direct_conf1.read(seg, bus, devfn, reg, len, value); in pci_olpc_read()
215 switch (devfn) { in pci_olpc_read()
260 unsigned int devfn, int reg, int len, uint32_t value) in pci_olpc_write() argument
265 if (!is_simulated(bus, devfn)) in pci_olpc_write()
266 return pci_direct_conf1.write(seg, bus, devfn, reg, len, value); in pci_olpc_write()
[all …]
A Dlegacy.c40 int devfn; in pcibios_scan_specific_bus() local
46 for (devfn = 0; devfn < 256; devfn += stride) { in pcibios_scan_specific_bus()
47 if (!raw_pci_read(0, busn, devfn, PCI_VENDOR_ID, 2, &l) && in pcibios_scan_specific_bus()
49 DBG("Found device at %02x:%02x [%04x]\n", busn, devfn, l); in pcibios_scan_specific_bus()
/arch/powerpc/platforms/pasemi/
A Dpci.c26 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off)) argument
34 if (bus == 0 && devfn == 0) in pa_pxp_offset_valid()
41 u8 bus, u8 devfn, int offset) in pa_pxp_cfg_addr() argument
43 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset); in pa_pxp_cfg_addr()
46 static inline int is_root_port(int busno, int devfn) in is_root_port() argument
48 return ((busno == 0) && (PCI_FUNC(devfn) < 4) && in is_root_port()
49 ((PCI_SLOT(devfn) == 16) || (PCI_SLOT(devfn) == 17))); in is_root_port()
78 dummy = pa_pxp_cfg_addr(hose, bus->number, devfn, 0x10); in workaround_5945()
166 if (!pa_pxp_offset_valid(bus->number, devfn, offset)) in pa_pxp_read_config()
169 if (workaround_5945(bus, devfn, offset, len, val)) in pa_pxp_read_config()
[all …]
/arch/alpha/kernel/
A Dsys_miata.c185 if((slot == 7) && (PCI_FUNC(dev->devfn) == 3)) { in miata_map_irq()
186 struct pci_dev *pdev = pci_get_slot(dev->bus, dev->devfn & ~7); in miata_map_irq()
208 slot = PCI_SLOT(dev->devfn); in miata_swizzle()
211 else if ((PCI_SLOT(dev->bus->self->devfn) == 8) || in miata_swizzle()
212 (PCI_SLOT(dev->bus->self->devfn) == 20)) { in miata_swizzle()
213 slot = PCI_SLOT(dev->devfn) + 9; in miata_swizzle()
219 if ((PCI_SLOT(dev->bus->self->devfn) == 8) || in miata_swizzle()
220 (PCI_SLOT(dev->bus->self->devfn) == 20)) { in miata_swizzle()
221 slot = PCI_SLOT(dev->devfn) + 9; in miata_swizzle()
229 slot = PCI_SLOT(dev->devfn); in miata_swizzle()
/arch/powerpc/sysdev/
A Dindirect_pci.c19 unsigned char bus_number, unsigned int devfn, in __indirect_read_config() argument
29 if (devfn != 0) in __indirect_read_config()
34 if (ppc_md.pci_exclude_device(hose, bus_number, devfn)) in __indirect_read_config()
51 (devfn << 8) | reg | cfg_type)); in __indirect_read_config()
54 (devfn << 8) | reg | cfg_type)); in __indirect_read_config()
75 int indirect_read_config(struct pci_bus *bus, unsigned int devfn, in indirect_read_config() argument
84 int indirect_write_config(struct pci_bus *bus, unsigned int devfn, in indirect_write_config() argument
95 if (devfn != 0) in indirect_write_config()
100 if (ppc_md.pci_exclude_device(hose, bus->number, devfn)) in indirect_write_config()
117 (devfn << 8) | reg | cfg_type)); in indirect_write_config()
[all …]
/arch/sparc/kernel/
A Dpci_common.c22 unsigned long devfn, in config_out_of_range() argument
33 unsigned long devfn, in sun4u_config_mkaddr() argument
42 devfn <<= rbits; in sun4u_config_mkaddr()
96 sun4u_read_pci_cfg_host(pbm, bus, devfn, in sun4u_read_pci_cfg_host()
101 sun4u_read_pci_cfg_host(pbm, bus, devfn, in sun4u_read_pci_cfg_host()
130 if (!bus_dev->number && !PCI_SLOT(devfn)) in sun4u_read_pci_cfg()
220 if (!bus_dev->number && !PCI_SLOT(devfn)) in sun4u_write_pci_cfg()
264 unsigned int device = PCI_SLOT(devfn); in sun4v_read_pci_cfg()
265 unsigned int func = PCI_FUNC(devfn); in sun4v_read_pci_cfg()
297 unsigned int device = PCI_SLOT(devfn); in sun4v_write_pci_cfg()
[all …]
A Dleon_pci_grpci1.c104 unsigned int devfn, int where, u32 val);
119 unsigned int devfn, int where, u32 *val) in grpci1_cfg_r32() argument
156 unsigned int devfn, int where, u32 *val) in grpci1_cfg_r16() argument
181 unsigned int devfn, int where, u32 val) in grpci1_cfg_w32() argument
201 (devfn << 8) | (where & 0xfc)); in grpci1_cfg_w32()
208 unsigned int devfn, int where, u32 val) in grpci1_cfg_w16() argument
224 unsigned int devfn, int where, u32 val) in grpci1_cfg_w8() argument
247 if (PCI_SLOT(devfn) > 15 || busno > 15) { in grpci1_read_config()
270 busno, PCI_SLOT(devfn), PCI_FUNC(devfn), where, *val, size); in grpci1_read_config()
285 if (PCI_SLOT(devfn) > 15 || busno > 15) in grpci1_write_config()
[all …]
/arch/sh/drivers/pci/
A Dops-dreamcast.c36 static int gapspci_config_access(unsigned char bus, unsigned int devfn) in gapspci_config_access() argument
38 return (bus == 0) && (devfn == 0); in gapspci_config_access()
46 static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) in gapspci_read() argument
50 if (!gapspci_config_access(bus->number, devfn)) in gapspci_read()
62 static int gapspci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val) in gapspci_write() argument
64 if (!gapspci_config_access(bus->number, devfn)) in gapspci_write()
A Dops-sh7786.c20 struct pci_bus *bus, unsigned int devfn, int where, u32 *data) in sh7786_pcie_config_access() argument
25 dev = PCI_SLOT(devfn); in sh7786_pcie_config_access()
26 func = PCI_FUNC(devfn); in sh7786_pcie_config_access()
89 static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, in sh7786_pcie_read() argument
103 devfn, where, &data); in sh7786_pcie_read()
118 devfn, where, size, (unsigned long)*val); in sh7786_pcie_read()
125 static int sh7786_pcie_write(struct pci_bus *bus, unsigned int devfn, in sh7786_pcie_write() argument
139 devfn, where, &data); in sh7786_pcie_write()
145 devfn, where, size, (unsigned long)val); in sh7786_pcie_write()
159 devfn, where, &data); in sh7786_pcie_write()

Completed in 41 milliseconds

123456