| /linux/drivers/pci/controller/ |
| H A D | pci-thunder-ecam.c | 18 static void set_val(u32 v, int where, int size, u32 *val) in set_val() argument 20 int shift = (where & 3) * 8; in set_val() 22 pr_debug("set_val %04x: %08x\n", (unsigned int)(where & ~3), v); in set_val() 32 unsigned int devfn, int where, int size, u32 *val) in handle_ea_bar() argument 38 int where_a = where & 0xc; in handle_ea_bar() 41 set_val(e0, where, size, val); in handle_ea_bar() 52 set_val(v, where, size, val); in handle_ea_bar() 70 set_val(v, where, size, val); in handle_ea_bar() 79 set_val(v, where, size, val); in handle_ea_bar() 86 int where, int size, u32 *val) in thunder_ecam_p2_config_read() argument [all …]
|
| H A D | pcie-altera.c | 118 int (*rp_read_cfg)(struct altera_pcie *pcie, int where, 121 int where, int size, u32 value); 123 unsigned int devfn, int where, int size, u32 *value); 125 unsigned int devfn, int where, int size, u32 value); 376 int where, u8 byte_en, bool read, u32 *headers) in get_tlp_header() argument 390 headers[2] = TLP_CFG_DW2(bus, devfn, where); in get_tlp_header() 394 int where, u8 byte_en, u32 *value) in tlp_cfg_dword_read() argument 398 get_tlp_header(pcie, bus, devfn, where, byte_en, true, in tlp_cfg_dword_read() 407 int where, u8 byte_en, u32 value) in tlp_cfg_dword_write() argument 412 get_tlp_header(pcie, bus, devfn, where, byte_en, false, in tlp_cfg_dword_write() [all …]
|
| H A D | pci-thunder-pem.c | 39 int where, int size, u32 *val) in thunder_pem_bridge_read() argument 45 if (devfn != 0 || where >= 2048) in thunder_pem_bridge_read() 53 read_val = where & ~3ull; in thunder_pem_bridge_read() 62 switch (where & ~3) { in thunder_pem_bridge_read() 123 read_val >>= (8 * (where & 3)); in thunder_pem_bridge_read() 139 int where, int size, u32 *val) in thunder_pem_config_read() argument 152 return thunder_pem_bridge_read(bus, devfn, where, size, val); in thunder_pem_config_read() 154 return pci_generic_config_read(bus, devfn, where, size, val); in thunder_pem_config_read() 215 int where, int size, u32 val) in thunder_pem_bridge_write() argument 220 u64 where_aligned = where & ~3ull; in thunder_pem_bridge_write() [all …]
|
| /linux/arch/mips/pci/ |
| H A D | ops-bcm63xx.c | 20 static int postprocess_read(u32 data, int where, unsigned int size) in postprocess_read() argument 27 ret = (data >> ((where & 3) << 3)) & 0xff; in postprocess_read() 30 ret = (data >> ((where & 3) << 3)) & 0xffff; in postprocess_read() 39 static int preprocess_write(u32 orig_data, u32 val, int where, in preprocess_write() argument 47 ret = (orig_data & ~(0xff << ((where & 3) << 3))) | in preprocess_write() 48 (val << ((where & 3) << 3)); in preprocess_write() 51 ret = (orig_data & ~(0xffff << ((where & 3) << 3))) | in preprocess_write() 52 (val << ((where & 3) << 3)); in preprocess_write() 65 unsigned int devfn, int where) in bcm63xx_setup_cfg_access() argument 72 reg = where >> 2; in bcm63xx_setup_cfg_access() [all …]
|
| H A D | ops-msc.c | 34 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) in msc_pcibios_config_access() argument 47 ((where / 4) << MSC01_PCI_CFGADDR_RNUM_SHF))); in msc_pcibios_config_access() 76 int where, int size, u32 * val) in msc_pcibios_read() argument 80 if ((size == 2) && (where & 1)) in msc_pcibios_read() 82 else if ((size == 4) && (where & 3)) in msc_pcibios_read() 85 if (msc_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, in msc_pcibios_read() 90 *val = (data >> ((where & 3) << 3)) & 0xff; in msc_pcibios_read() 92 *val = (data >> ((where & 3) << 3)) & 0xffff; in msc_pcibios_read() 100 int where, int size, u32 val) in msc_pcibios_write() argument 104 if ((size == 2) && (where & 1)) in msc_pcibios_write() [all …]
|
| H A D | ops-bonito64.c | 26 unsigned int devfn, int where, in bonito64_pcibios_config_access() argument 35 int reg = where & ~3; in bonito64_pcibios_config_access() 90 int where, int size, u32 * val) in bonito64_pcibios_read() argument 94 if ((size == 2) && (where & 1)) in bonito64_pcibios_read() 96 else if ((size == 4) && (where & 3)) in bonito64_pcibios_read() 99 if (bonito64_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, in bonito64_pcibios_read() 104 *val = (data >> ((where & 3) << 3)) & 0xff; in bonito64_pcibios_read() 106 *val = (data >> ((where & 3) << 3)) & 0xffff; in bonito64_pcibios_read() 114 int where, int size, u32 val) in bonito64_pcibios_write() argument 118 if ((size == 2) && (where & 1)) in bonito64_pcibios_write() [all …]
|
| H A D | pci-bcm1480ht.c | 38 #define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where)) argument 39 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument 97 int where, int size, u32 * val) in bcm1480ht_pcibios_read() argument 101 if ((size == 2) && (where & 1)) in bcm1480ht_pcibios_read() 103 else if ((size == 4) && (where & 3)) in bcm1480ht_pcibios_read() 107 data = READCFG32(CFGADDR(bus, devfn, where)); in bcm1480ht_pcibios_read() 112 *val = (data >> ((where & 3) << 3)) & 0xff; in bcm1480ht_pcibios_read() 114 *val = (data >> ((where & 3) << 3)) & 0xffff; in bcm1480ht_pcibios_read() 122 int where, int size, u32 val) in bcm1480ht_pcibios_write() argument 124 u32 cfgaddr = CFGADDR(bus, devfn, where); in bcm1480ht_pcibios_write() [all …]
|
| H A D | pci-bcm1480.c | 40 #define CFGOFFSET(bus, devfn, where) (((bus)<<16)+((devfn)<<8)+(where)) argument 41 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument 108 int where, int size, u32 * val) in bcm1480_pcibios_read() argument 112 if ((size == 2) && (where & 1)) in bcm1480_pcibios_read() 114 else if ((size == 4) && (where & 3)) in bcm1480_pcibios_read() 118 data = READCFG32(CFGADDR(bus, devfn, where)); in bcm1480_pcibios_read() 123 *val = (data >> ((where & 3) << 3)) & 0xff; in bcm1480_pcibios_read() 125 *val = (data >> ((where & 3) << 3)) & 0xffff; in bcm1480_pcibios_read() 133 int where, int size, u32 val) in bcm1480_pcibios_write() argument 135 u32 cfgaddr = CFGADDR(bus, devfn, where); in bcm1480_pcibios_write() [all …]
|
| H A D | pci-sb1250.c | 40 #define CFGOFFSET(bus, devfn, where) (((bus)<<16) + ((devfn)<<8) + (where)) argument 41 #define CFGADDR(bus, devfn, where) CFGOFFSET((bus)->number, (devfn), where) argument 117 int where, int size, u32 * val) in sb1250_pcibios_read() argument 121 if ((size == 2) && (where & 1)) in sb1250_pcibios_read() 123 else if ((size == 4) && (where & 3)) in sb1250_pcibios_read() 127 data = READCFG32(CFGADDR(bus, devfn, where)); in sb1250_pcibios_read() 132 *val = (data >> ((where & 3) << 3)) & 0xff; in sb1250_pcibios_read() 134 *val = (data >> ((where & 3) << 3)) & 0xffff; in sb1250_pcibios_read() 142 int where, int size, u32 val) in sb1250_pcibios_write() argument 144 u32 cfgaddr = CFGADDR(bus, devfn, where); in sb1250_pcibios_write() [all …]
|
| H A D | ops-loongson2.c | 34 unsigned int devfn, int where, in loongson_pcibios_config_access() argument 43 int reg = where & ~3; in loongson_pcibios_config_access() 119 int where, int size, u32 *val) in loongson_pcibios_read() argument 123 if ((size == 2) && (where & 1)) in loongson_pcibios_read() 125 else if ((size == 4) && (where & 3)) in loongson_pcibios_read() 128 if (loongson_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where, in loongson_pcibios_read() 133 *val = (data >> ((where & 3) << 3)) & 0xff; in loongson_pcibios_read() 135 *val = (data >> ((where & 3) << 3)) & 0xffff; in loongson_pcibios_read() 143 int where, int size, u32 val) in loongson_pcibios_write() argument 147 if ((size == 2) && (where & 1)) in loongson_pcibios_write() [all …]
|
| H A D | ops-gt64xxx_pci0.c | 31 struct pci_bus *bus, unsigned int devfn, int where, u32 * data) in gt64xxx_pci0_pcibios_config_access() argument 47 ((where / 4) << GT_PCI0_CFGADDR_REGNUM_SHF) | in gt64xxx_pci0_pcibios_config_access() 92 int where, int size, u32 * val) in gt64xxx_pci0_pcibios_read() argument 97 where, &data)) in gt64xxx_pci0_pcibios_read() 101 *val = (data >> ((where & 3) << 3)) & 0xff; in gt64xxx_pci0_pcibios_read() 103 *val = (data >> ((where & 3) << 3)) & 0xffff; in gt64xxx_pci0_pcibios_read() 111 int where, int size, u32 val) in gt64xxx_pci0_pcibios_write() argument 119 devfn, where, &data)) in gt64xxx_pci0_pcibios_write() 123 data = (data & ~(0xff << ((where & 3) << 3))) | in gt64xxx_pci0_pcibios_write() 124 (val << ((where & 3) << 3)); in gt64xxx_pci0_pcibios_write() [all …]
|
| H A D | ops-lantiq.c | 27 unsigned int devfn, unsigned int where, u32 *data) in ltq_pci_config_access() argument 43 LTQ_PCI_CFG_FUNNUM_SHF) | (where & ~0x3); in ltq_pci_config_access() 72 int where, int size, u32 *val) 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() 80 *val = (data >> ((where & 3) << 3)) & 0xff; in ltq_pci_read_config_dword() 82 *val = (data >> ((where & 3) << 3)) & 0xffff; in ltq_pci_read_config_dword() 90 int where, int size, u32 val) in ltq_pci_write_config_dword() argument 98 devfn, where, &data)) in ltq_pci_write_config_dword() 102 data = (data & ~(0xff << ((where & 3) << 3))) | in ltq_pci_write_config_dword() 103 (val << ((where & 3) << 3)); in ltq_pci_write_config_dword() [all …]
|
| H A D | pci-alchemy.c | 100 unsigned int dev_fn, unsigned char where, u32 *data) in config_access() argument 135 offset = (function << 8) | (where & ~0x3); in config_access() 161 access_type, bus->number, device, where, *data, offset); in config_access() 189 int where, u8 *val) in read_config_byte() argument 192 int ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); in read_config_byte() 194 if (where & 1) in read_config_byte() 196 if (where & 2) in read_config_byte() 203 int where, u16 *val) in read_config_word() argument 206 int ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); in read_config_word() 208 if (where & 2) in read_config_word() [all …]
|
| H A D | pci-ar724x.c | 74 int where, int size, u32 value) in ar724x_pci_local_write() argument 80 WARN_ON(where & (size - 1)); in ar724x_pci_local_write() 86 data = __raw_readl(base + (where & ~3)); in ar724x_pci_local_write() 90 s = ((where & 3) * 8); in ar724x_pci_local_write() 95 s = ((where & 2) * 8); in ar724x_pci_local_write() 106 __raw_writel(data, base + (where & ~3)); in ar724x_pci_local_write() 108 __raw_readl(base + (where & ~3)); in ar724x_pci_local_write() 113 static int ar724x_pci_read(struct pci_bus *bus, unsigned int devfn, int where, in ar724x_pci_read() argument 128 data = __raw_readl(base + (where & ~3)); in ar724x_pci_read() 132 if (where & 1) in ar724x_pci_read() [all …]
|
| H A D | pci-ar71xx.c | 69 static inline u32 ar71xx_pci_get_ble(int where, int size, int local) in ar71xx_pci_get_ble() argument 73 t = ar71xx_pci_ble_table[size & 3][where & 3]; in ar71xx_pci_get_ble() 81 int where) in ar71xx_pci_bus_addr() argument 88 (where & ~3); in ar71xx_pci_bus_addr() 92 (PCI_FUNC(devfn) << 8) | (where & ~3) | 1; in ar71xx_pci_bus_addr() 145 int where, int size, u32 value) in ar71xx_pci_local_write() argument 150 value = value << (8 * (where & 3)); in ar71xx_pci_local_write() 152 ad_cbe = AR71XX_PCI_CRP_CMD_WRITE | (where & ~3); in ar71xx_pci_local_write() 153 ad_cbe |= ar71xx_pci_get_ble(where, size, 1); in ar71xx_pci_local_write() 161 int where, int size, u32 cmd) in ar71xx_pci_set_cfgaddr() argument [all …]
|
| /linux/arch/sh/drivers/pci/ |
| H A D | ops-sh7786.c | 20 struct pci_bus *bus, unsigned int devfn, int where, u32 *data) in sh7786_pcie_config_access() argument 28 reg = where & ~3; in sh7786_pcie_config_access() 90 int where, int size, u32 *val) in sh7786_pcie_read() argument 96 if ((size == 2) && (where & 1)) in sh7786_pcie_read() 98 else if ((size == 4) && (where & 3)) in sh7786_pcie_read() 103 devfn, where, &data); in sh7786_pcie_read() 110 *val = (data >> ((where & 3) << 3)) & 0xff; in sh7786_pcie_read() 112 *val = (data >> ((where & 2) << 3)) & 0xffff; in sh7786_pcie_read() 118 devfn, where, size, (unsigned long)*val); in sh7786_pcie_read() 126 int where, int size, u32 val) in sh7786_pcie_write() argument [all …]
|
| H A D | ops-sh4.c | 16 #define CONFIG_CMD(bus, devfn, where) \ argument 17 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) 23 int where, int size, u32 *val) in sh4_pci_read() argument 34 pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); in sh4_pci_read() 40 *val = (data >> ((where & 3) << 3)) & 0xff; in sh4_pci_read() 43 *val = (data >> ((where & 2) << 3)) & 0xffff; in sh4_pci_read() 61 int where, int size, u32 val) in sh4_pci_write() argument 69 pci_write_reg(chan, CONFIG_CMD(bus, devfn, where), SH4_PCIPAR); in sh4_pci_write() 75 shift = (where & 3) << 3; in sh4_pci_write() 80 shift = (where & 2) << 3; in sh4_pci_write()
|
| H A D | ops-dreamcast.c | 46 static int gapspci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val) in gapspci_read() argument 54 case 1: *val = inb(GAPSPCI_BBA_CONFIG+where); break; in gapspci_read() 55 case 2: *val = inw(GAPSPCI_BBA_CONFIG+where); break; in gapspci_read() 56 case 4: *val = inl(GAPSPCI_BBA_CONFIG+where); break; 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 68 case 1: outb(( u8)val, GAPSPCI_BBA_CONFIG+where); break; in gapspci_write() 69 case 2: outw((u16)val, GAPSPCI_BBA_CONFIG+where); break; in gapspci_write() 70 case 4: outl((u32)val, GAPSPCI_BBA_CONFIG+where); break; in gapspci_write()
|
| /linux/arch/sparc/kernel/ |
| H A D | leon_pci_grpci1.c | 104 unsigned int devfn, int where, u32 val); 119 unsigned int devfn, int where, u32 *val) in grpci1_cfg_r32() argument 123 if (where & 0x3) in grpci1_cfg_r32() 138 pci_conf = (u32 *) (priv->pci_conf | (devfn << 8) | (where & 0xfc)); in grpci1_cfg_r32() 156 unsigned int devfn, int where, u32 *val) in grpci1_cfg_r16() argument 161 if (where & 0x1) in grpci1_cfg_r16() 163 ret = grpci1_cfg_r32(priv, bus, devfn, where & ~0x3, &v); in grpci1_cfg_r16() 164 *val = 0xffff & (v >> (8 * (where & 0x3))); in grpci1_cfg_r16() 169 unsigned int devfn, int where, u32 *val) in grpci1_cfg_r8() argument 174 ret = grpci1_cfg_r32(priv, bus, devfn, where & ~0x3, &v); in grpci1_cfg_r8() [all …]
|
| H A D | pcic.c | 175 …ne CONFIG_CMD(bus, device_fn, where) (0x80000000 | (((unsigned int)bus) << 16) | (((unsigned int)d… argument 178 int where, u32 *value) in pcic_read_config_dword() argument 190 writel(CONFIG_CMD(busno, devfn, where), pcic->pcic_config_space_addr); in pcic_read_config_dword() 201 *value = readl(pcic->pcic_config_space_data + (where&4)); in pcic_read_config_dword() 215 int where, int size, u32 *val) in pcic_read_config() argument 222 pcic_read_config_dword(bus->number, devfn, where&~3, &v); in pcic_read_config() 223 *val = 0xff & (v >> (8*(where & 3))); in pcic_read_config() 226 if (where&1) return -EINVAL; in pcic_read_config() 227 pcic_read_config_dword(bus->number, devfn, where&~3, &v); in pcic_read_config() 228 *val = 0xffff & (v >> (8*(where & 3))); in pcic_read_config() [all …]
|
| H A D | leon_pci_grpci2.c | 237 unsigned int devfn, int where, u32 *val) in grpci2_cfg_r32() argument 243 if (where & 0x3) in grpci2_cfg_r32() 263 (devfn << 8) | (where & 0xfc)); in grpci2_cfg_r32() 283 unsigned int devfn, int where, u32 *val) in grpci2_cfg_r16() argument 288 if (where & 0x1) in grpci2_cfg_r16() 290 ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); in grpci2_cfg_r16() 291 *val = 0xffff & (v >> (8 * (where & 0x3))); in grpci2_cfg_r16() 296 unsigned int devfn, int where, u32 *val) in grpci2_cfg_r8() argument 301 ret = grpci2_cfg_r32(priv, bus, devfn, where & ~0x3, &v); in grpci2_cfg_r8() 302 *val = 0xff & (v >> (8 * (where & 3))); in grpci2_cfg_r8() [all …]
|
| /linux/arch/riscv/include/asm/ |
| H A D | runtime-const.h | 166 static inline void __runtime_fixup_caches(void *where, unsigned int insns) in __runtime_fixup_caches() argument 169 __always_unused uintptr_t va = (uintptr_t)where; in __runtime_fixup_caches() 226 static inline void __runtime_fixup_ptr(void *where, unsigned long val) in __runtime_fixup_ptr() argument 229 __runtime_fixup_32(where, where + 4, val); in __runtime_fixup_ptr() 230 __runtime_fixup_caches(where, 2); in __runtime_fixup_ptr() 232 __runtime_fixup_32(where, where + 8, val); in __runtime_fixup_ptr() 233 __runtime_fixup_32(where + 4, where + 12, val >> 32); in __runtime_fixup_ptr() 234 __runtime_fixup_caches(where, 4); in __runtime_fixup_ptr() 242 static inline void __runtime_fixup_shift(void *where, unsigned long val) in __runtime_fixup_shift() argument 244 __le16 *parcel = where; in __runtime_fixup_shift() [all …]
|
| /linux/arch/powerpc/kernel/ |
| H A D | rtas_pci.c | 36 static inline int config_access_valid(struct pci_dn *dn, int where) in config_access_valid() argument 38 if (where < 256) in config_access_valid() 40 if (where < 4096 && dn->pci_ext_config_space) in config_access_valid() 46 int rtas_pci_dn_read_config(struct pci_dn *pdn, int where, int size, u32 *val) in rtas_pci_dn_read_config() argument 54 if (!config_access_valid(pdn, where)) in rtas_pci_dn_read_config() 62 addr = rtas_config_addr(pdn->busno, pdn->devfn, where); in rtas_pci_dn_read_config() 80 int where, int size, u32 *val) in rtas_pci_read_config() argument 90 ret = rtas_pci_dn_read_config(pdn, where, size, val); in rtas_pci_read_config() 98 int rtas_pci_dn_write_config(struct pci_dn *pdn, int where, int size, u32 val) in rtas_pci_dn_write_config() argument 105 if (!config_access_valid(pdn, where)) in rtas_pci_dn_write_config() [all …]
|
| /linux/arch/arm/plat-orion/ |
| H A D | pcie.c | 209 u32 devfn, int where, int size, u32 *val) in orion_pcie_rd_conf() argument 214 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN, in orion_pcie_rd_conf() 220 *val = (*val >> (8 * (where & 3))) & 0xff; in orion_pcie_rd_conf() 222 *val = (*val >> (8 * (where & 3))) & 0xffff; in orion_pcie_rd_conf() 228 u32 devfn, int where, int size, u32 *val) in orion_pcie_rd_conf_tlp() argument 233 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN, in orion_pcie_rd_conf_tlp() 243 *val = (*val >> (8 * (where & 3))) & 0xff; in orion_pcie_rd_conf_tlp() 245 *val = (*val >> (8 * (where & 3))) & 0xffff; in orion_pcie_rd_conf_tlp() 251 u32 devfn, int where, int size, u32 *val) in orion_pcie_rd_conf_wa() argument 256 PCIE_CONF_REG(where))); in orion_pcie_rd_conf_wa() [all …]
|
| /linux/arch/arm64/include/asm/ |
| H A D | runtime-const.h | 52 static inline void __runtime_fixup_caches(void *where, unsigned int insns) in __runtime_fixup_caches() argument 54 unsigned long va = (unsigned long)where; in __runtime_fixup_caches() 58 static inline void __runtime_fixup_ptr(void *where, unsigned long val) in __runtime_fixup_ptr() argument 60 __le32 *p = lm_alias(where); in __runtime_fixup_ptr() 65 __runtime_fixup_caches(where, 4); in __runtime_fixup_ptr() 69 static inline void __runtime_fixup_shift(void *where, unsigned long val) in __runtime_fixup_shift() argument 71 __le32 *p = lm_alias(where); in __runtime_fixup_shift() 76 __runtime_fixup_caches(where, 1); in __runtime_fixup_shift()
|