/arch/powerpc/platforms/pasemi/ |
D | gpio_mdio.c | 46 #define MDC_PIN(bus) (((struct gpio_priv *)bus->priv)->mdc_pin) argument 47 #define MDIO_PIN(bus) (((struct gpio_priv *)bus->priv)->mdio_pin) argument 49 static inline void mdio_lo(struct mii_bus *bus) in mdio_lo() argument 51 out_le32(gpio_regs+0x10, 1 << MDIO_PIN(bus)); in mdio_lo() 54 static inline void mdio_hi(struct mii_bus *bus) in mdio_hi() argument 56 out_le32(gpio_regs, 1 << MDIO_PIN(bus)); in mdio_hi() 59 static inline void mdc_lo(struct mii_bus *bus) in mdc_lo() argument 61 out_le32(gpio_regs+0x10, 1 << MDC_PIN(bus)); in mdc_lo() 64 static inline void mdc_hi(struct mii_bus *bus) in mdc_hi() argument 66 out_le32(gpio_regs, 1 << MDC_PIN(bus)); in mdc_hi() [all …]
|
D | pci.c | 36 #define PA_PXP_CFA(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off)) argument 38 static inline int pa_pxp_offset_valid(u8 bus, u8 devfn, int offset) in pa_pxp_offset_valid() argument 44 if (bus == 0 && devfn == 0) in pa_pxp_offset_valid() 51 u8 bus, u8 devfn, int offset) in pa_pxp_cfg_addr() argument 53 return hose->cfg_data + PA_PXP_CFA(bus, devfn, offset); in pa_pxp_cfg_addr() 68 static int workaround_5945(struct pci_bus *bus, unsigned int devfn, in workaround_5945() argument 76 if (!is_root_port(bus->number, devfn) || !is_5945_reg(offset)) in workaround_5945() 79 hose = pci_bus_to_host(bus); in workaround_5945() 81 addr = pa_pxp_cfg_addr(hose, bus->number, devfn, offset & ~0x3); in workaround_5945() 88 dummy = pa_pxp_cfg_addr(hose, bus->number, devfn, 0x10); in workaround_5945() [all …]
|
/arch/mn10300/unit-asb2305/ |
D | pci.c | 55 #define CONFIG_CMD(bus, devfn, where) \ argument 56 (0x80000000 | (bus->number << 16) | (devfn << 8) | (where & ~3)) 68 static inline int __query(const struct pci_bus *bus, unsigned int devfn) in __query() argument 71 return bus->number == 0 && (devfn == PCI_DEVFN(0, 0)); in __query() 72 return bus->number == 1; in __query() 73 return bus->number == 0 && in __query() 82 static int pci_ampci_read_config_byte(struct pci_bus *bus, unsigned int devfn, in pci_ampci_read_config_byte() argument 87 if (bus->number == 0 && devfn == PCI_DEVFN(0, 0)) { in pci_ampci_read_config_byte() 91 CONFIG_ADDRESS = CONFIG_CMD(bus, devfn, where); in pci_ampci_read_config_byte() 94 if (__query(bus, devfn)) in pci_ampci_read_config_byte() [all …]
|
/arch/powerpc/kernel/ |
D | pci-hotplug.c | 24 static struct pci_bus *find_bus_among_children(struct pci_bus *bus, in find_bus_among_children() argument 30 if (pci_bus_to_OF_node(bus) == dn) in find_bus_among_children() 31 return bus; in find_bus_among_children() 33 list_for_each_entry(tmp, &bus->children, node) { in find_bus_among_children() 46 if (!pdn || !pdn->phb || !pdn->phb->bus) in pci_find_bus_by_node() 49 return find_bus_among_children(pdn->phb->bus, dn); in pci_find_bus_by_node() 61 struct pci_controller *phb = pci_bus_to_host(dev->bus); in pcibios_release_device() 76 void pci_hp_remove_devices(struct pci_bus *bus) in pci_hp_remove_devices() argument 82 list_for_each_entry(child_bus, &bus->children, node) in pci_hp_remove_devices() 86 pci_domain_nr(bus), bus->number); in pci_hp_remove_devices() [all …]
|
D | io-workarounds.c | 37 struct iowa_bus *bus = &iowa_busses[i]; in iowa_pci_find() local 38 struct pci_controller *phb = bus->phb; in iowa_pci_find() 44 return bus; in iowa_pci_find() 51 return bus; in iowa_pci_find() 62 struct iowa_bus *bus; in iowa_mem_find_bus() local 68 bus = &iowa_busses[token - 1]; in iowa_mem_find_bus() 87 bus = iowa_pci_find(vaddr, paddr); in iowa_mem_find_bus() 89 if (bus == NULL) in iowa_mem_find_bus() 93 return bus; in iowa_mem_find_bus() 118 struct iowa_bus *bus; \ [all …]
|
D | pci_of_scan.c | 116 pcibios_bus_to_resource(dev->bus, res, ®ion); in of_pci_parse_addrs() 127 struct pci_bus *bus, int devfn) in of_create_pci_dev() argument 132 dev = pci_alloc_dev(bus); in of_create_pci_dev() 142 dev->dev.parent = bus->bridge; in of_create_pci_dev() 143 dev->dev.bus = &pci_bus_type; in of_create_pci_dev() 157 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus), in of_create_pci_dev() 158 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); in of_create_pci_dev() 190 pci_device_add(dev, bus); in of_create_pci_dev() 207 struct pci_bus *bus; in of_scan_pci_bridge() local 232 bus = pci_find_bus(pci_domain_nr(dev->bus), in of_scan_pci_bridge() [all …]
|
D | pci_64.c | 63 pci_bus_add_devices(hose->bus); in pcibios_init() 76 int pcibios_unmap_io_space(struct pci_bus *bus) in pcibios_unmap_io_space() argument 80 WARN_ON(bus == NULL); in pcibios_unmap_io_space() 92 if (bus->self) { in pcibios_unmap_io_space() 94 struct resource *res = bus->resource[0]; in pcibios_unmap_io_space() 98 pci_name(bus->self)); in pcibios_unmap_io_space() 108 hose = pci_bus_to_host(bus); in pcibios_unmap_io_space() 175 int pcibios_map_io_space(struct pci_bus *bus) in pcibios_map_io_space() argument 177 WARN_ON(bus == NULL); in pcibios_map_io_space() 182 if (bus->self) { in pcibios_map_io_space() [all …]
|
D | pci-common.c | 200 resource_size_t pcibios_window_alignment(struct pci_bus *bus, in pcibios_window_alignment() argument 203 struct pci_controller *phb = pci_bus_to_host(bus); in pcibios_window_alignment() 206 return phb->controller_ops.window_alignment(bus, type); in pcibios_window_alignment() 216 void pcibios_setup_bridge(struct pci_bus *bus, unsigned long type) in pcibios_setup_bridge() argument 218 struct pci_controller *hose = pci_bus_to_host(bus); in pcibios_setup_bridge() 221 hose->controller_ops.setup_bridge(bus, type); in pcibios_setup_bridge() 226 struct pci_controller *phb = pci_bus_to_host(dev->bus); in pcibios_reset_secondary_bus() 308 int pci_domain_nr(struct pci_bus *bus) in pci_domain_nr() argument 310 struct pci_controller *hose = pci_bus_to_host(bus); in pci_domain_nr() 415 struct pci_controller *hose = pci_bus_to_host(dev->bus); in __pci_mmap_make_offset() [all …]
|
/arch/mips/pci/ |
D | ops-rc32434.c | 41 #define PCI_CFG_SET(bus, slot, func, off) \ argument 43 ((bus) << 16) | ((slot)<<11) | \ 47 struct pci_bus *bus, unsigned int devfn, in config_access() argument 54 PCI_CFG_SET(bus->number, slot, func, where); in config_access() 72 static int read_config_byte(struct pci_bus *bus, unsigned int devfn, in read_config_byte() argument 78 ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); in read_config_byte() 83 static int read_config_word(struct pci_bus *bus, unsigned int devfn, in read_config_word() argument 89 ret = config_access(PCI_ACCESS_READ, bus, devfn, where, &data); 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() [all …]
|
D | pci-xlp.c | 60 #define pci_cfg_addr(bus, devfn, off) (((bus) << 20) | ((devfn) << 12) | (off)) argument 63 static inline u32 pci_cfg_read_32bit(struct pci_bus *bus, unsigned int devfn, in pci_cfg_read_32bit() argument 72 if (bus->number == 0) { in pci_cfg_read_32bit() 77 } else if (bus->parent->number == 0) { /* SoC bus */ in pci_cfg_read_32bit() 83 } else if (bus->number == 0 && PCI_SLOT(devfn) == 1 && where == 0x954) { in pci_cfg_read_32bit() 87 pci_cfg_addr(bus->number, devfn, where)); in pci_cfg_read_32bit() 92 static inline void pci_cfg_write_32bit(struct pci_bus *bus, unsigned int devfn, in pci_cfg_write_32bit() argument 98 pci_cfg_addr(bus->number, devfn, where & ~3)); in pci_cfg_write_32bit() 102 static int nlm_pcibios_read(struct pci_bus *bus, unsigned int devfn, in nlm_pcibios_read() argument 112 data = pci_cfg_read_32bit(bus, devfn, where); in nlm_pcibios_read() [all …]
|
/arch/powerpc/platforms/powermac/ |
D | low_i2c.c | 96 int (*open)(struct pmac_i2c_bus *bus); 97 void (*close)(struct pmac_i2c_bus *bus); 98 int (*xfer)(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, 387 static int kw_i2c_open(struct pmac_i2c_bus *bus) in kw_i2c_open() argument 389 struct pmac_i2c_host_kw *host = bus->hostdata; in kw_i2c_open() 394 static void kw_i2c_close(struct pmac_i2c_bus *bus) in kw_i2c_close() argument 396 struct pmac_i2c_host_kw *host = bus->hostdata; in kw_i2c_close() 400 static int kw_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize, in kw_i2c_xfer() argument 403 struct pmac_i2c_host_kw *host = bus->hostdata; in kw_i2c_xfer() 405 int use_irq = host->irq && !bus->polled; in kw_i2c_xfer() [all …]
|
/arch/x86/pci/ |
D | early.c | 11 u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset) in read_pci_config() argument 14 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); in read_pci_config() 19 u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset) in read_pci_config_byte() argument 22 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); in read_pci_config_byte() 27 u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset) in read_pci_config_16() argument 30 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); in read_pci_config_16() 35 void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, in write_pci_config() argument 38 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); in write_pci_config() 42 void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val) in write_pci_config_byte() argument 44 outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); in write_pci_config_byte() [all …]
|
D | intel_mid_pci.c | 62 static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn) in fixed_bar_cap() argument 73 if (raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number, in fixed_bar_cap() 82 raw_pci_ext_ops->read(pci_domain_nr(bus), bus->number, in fixed_bar_cap() 94 static int pci_device_update_fixed(struct pci_bus *bus, unsigned int devfn, in pci_device_update_fixed() argument 101 domain = pci_domain_nr(bus); in pci_device_update_fixed() 102 busnum = bus->number; in pci_device_update_fixed() 148 static bool type1_access_ok(unsigned int bus, unsigned int devfn, int reg) in type1_access_ok() argument 160 if (bus == 0 && (devfn == PCI_DEVFN(2, 0) in type1_access_ok() 167 static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, in pci_read() argument 170 if (type1_access_ok(bus->number, devfn, where)) in pci_read() [all …]
|
D | numachip.c | 21 static inline char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) in pci_dev_base() argument 23 struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus); in pci_dev_base() 26 return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12)); in pci_dev_base() 30 static int pci_mmcfg_read_numachip(unsigned int seg, unsigned int bus, in pci_mmcfg_read_numachip() argument 36 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { in pci_mmcfg_read_numachip() 42 if (unlikely(bus == 0 && devfn >= limit)) { in pci_mmcfg_read_numachip() 48 addr = pci_dev_base(seg, bus, devfn); in pci_mmcfg_read_numachip() 70 static int pci_mmcfg_write_numachip(unsigned int seg, unsigned int bus, in pci_mmcfg_write_numachip() argument 76 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) in pci_mmcfg_write_numachip() 80 if (unlikely(bus == 0 && devfn >= limit)) in pci_mmcfg_write_numachip() [all …]
|
D | i386.c | 136 !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA)) in skip_isa_ioresource_align() 233 static void pcibios_allocate_bus_resources(struct pci_bus *bus) in pcibios_allocate_bus_resources() argument 238 if (bus->self) in pcibios_allocate_bus_resources() 239 pcibios_allocate_bridge_resources(bus->self); in pcibios_allocate_bus_resources() 240 list_for_each_entry(child, &bus->children, node) in pcibios_allocate_bus_resources() 307 static void pcibios_allocate_resources(struct pci_bus *bus, int pass) in pcibios_allocate_resources() argument 312 list_for_each_entry(dev, &bus->devices, bus_list) { in pcibios_allocate_resources() 341 static void pcibios_allocate_rom_resources(struct pci_bus *bus) in pcibios_allocate_rom_resources() argument 346 list_for_each_entry(dev, &bus->devices, bus_list) { in pcibios_allocate_rom_resources() 357 struct pci_bus *bus; in pcibios_assign_resources() local [all …]
|
/arch/x86/kernel/ |
D | aperture_64.c | 124 static u32 __init find_cap(int bus, int slot, int func, int cap) in find_cap() argument 129 if (!(read_pci_config_16(bus, slot, func, PCI_STATUS) & in find_cap() 133 pos = read_pci_config_byte(bus, slot, func, PCI_CAPABILITY_LIST); in find_cap() 138 id = read_pci_config_byte(bus, slot, func, pos+PCI_CAP_LIST_ID); in find_cap() 143 pos = read_pci_config_byte(bus, slot, func, in find_cap() 150 static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order) in read_agp() argument 159 pr_info("pci 0000:%02x:%02x:%02x: AGP bridge\n", bus, slot, func); in read_agp() 160 apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14); in read_agp() 163 bus, slot, func); in read_agp() 179 aper_low = read_pci_config(bus, slot, func, 0x10); in read_agp() [all …]
|
/arch/alpha/kernel/ |
D | sys_nautilus.c | 76 dev->bus->self && dev->bus->self->device == 0x700f) in nautilus_map_irq() 85 struct pci_bus *bus = pci_isa_hose->bus; in nautilus_kill_arch() local 93 pci_bus_read_config_byte(bus, 0x38, 0x43, &t8); in nautilus_kill_arch() 94 pci_bus_write_config_byte(bus, 0x38, 0x43, t8 | 0x80); in nautilus_kill_arch() 104 pci_bus_read_config_dword(bus, 0x88, 0x10, &pmuport); in nautilus_kill_arch() 108 pci_bus_read_config_dword(bus, 0x88, 0xe0, &pmuport); in nautilus_kill_arch() 210 struct pci_bus *bus; in nautilus_init_pci() local 237 bus = hose->bus = bridge->bus; in nautilus_init_pci() 238 pcibios_claim_one_bus(bus); in nautilus_init_pci() 241 bus->self = irongate; in nautilus_init_pci() [all …]
|
/arch/x86/include/asm/ |
D | pci.h | 40 static inline int pci_domain_nr(struct pci_bus *bus) in pci_domain_nr() argument 42 struct pci_sysdata *sd = bus->sysdata; in pci_domain_nr() 47 static inline int pci_proc_domain(struct pci_bus *bus) in pci_proc_domain() argument 49 return pci_domain_nr(bus); in pci_proc_domain() 54 static inline void *_pci_root_bus_fwnode(struct pci_bus *bus) in _pci_root_bus_fwnode() argument 56 struct pci_sysdata *sd = bus->sysdata; in _pci_root_bus_fwnode() 64 static inline bool is_vmd(struct pci_bus *bus) in is_vmd() argument 67 struct pci_sysdata *sd = bus->sysdata; in is_vmd() 93 void pcibios_scan_root(int bus); 136 static inline int __pcibus_to_node(const struct pci_bus *bus) in __pcibus_to_node() argument [all …]
|
/arch/arm64/kernel/ |
D | pci.c | 41 int raw_pci_read(unsigned int domain, unsigned int bus, in raw_pci_read() argument 44 struct pci_bus *b = pci_find_bus(domain, bus); in raw_pci_read() 51 int raw_pci_write(unsigned int domain, unsigned int bus, in raw_pci_write() argument 54 struct pci_bus *b = pci_find_bus(domain, bus); in raw_pci_write() 63 int pcibus_to_node(struct pci_bus *bus) in pcibus_to_node() argument 65 return dev_to_node(&bus->dev); in pcibus_to_node() 78 int acpi_pci_bus_find_domain_nr(struct pci_bus *bus) in acpi_pci_bus_find_domain_nr() argument 80 struct pci_config_window *cfg = bus->sysdata; in acpi_pci_bus_find_domain_nr() 90 struct pci_config_window *cfg = bridge->bus->sysdata; in pcibios_root_bridge_prepare() 92 struct device *bus_dev = &bridge->bus->dev; in pcibios_root_bridge_prepare() [all …]
|
/arch/powerpc/include/asm/ |
D | pmac_low_i2c.h | 69 extern struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus); 70 extern struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus); 71 extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus); 72 extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus); 73 extern int pmac_i2c_get_channel(struct pmac_i2c_bus *bus); 76 extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus); 92 extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled); 93 extern void pmac_i2c_close(struct pmac_i2c_bus *bus); 94 extern int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode); 95 extern int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
|
D | pci-bridge.h | 21 void (*dma_bus_setup)(struct pci_bus *bus); 23 int (*probe_mode)(struct pci_bus *bus); 34 resource_size_t (*window_alignment)(struct pci_bus *bus, 36 void (*setup_bridge)(struct pci_bus *bus, 56 struct pci_bus *bus; member 136 extern int early_read_config_byte(struct pci_controller *hose, int bus, 138 extern int early_read_config_word(struct pci_controller *hose, int bus, 140 extern int early_read_config_dword(struct pci_controller *hose, int bus, 142 extern int early_write_config_byte(struct pci_controller *hose, int bus, 144 extern int early_write_config_word(struct pci_controller *hose, int bus, [all …]
|
/arch/powerpc/platforms/pseries/ |
D | pci.c | 102 && dev->bus->number == 0 && dev->devfn == 0x81) in fixup_winbond_82c105() 116 struct pci_bus *bus; in pseries_root_bridge_prepare() local 120 bus = bridge->bus; in pseries_root_bridge_prepare() 124 (void *) pci_bus_to_host(bus)); in pseries_root_bridge_prepare() 126 dn = pcibios_get_phb_of_node(bus); in pseries_root_bridge_prepare() 147 bus->max_bus_speed = PCIE_SPEED_2_5GT; in pseries_root_bridge_prepare() 150 bus->max_bus_speed = PCIE_SPEED_5_0GT; in pseries_root_bridge_prepare() 153 bus->max_bus_speed = PCIE_SPEED_8_0GT; in pseries_root_bridge_prepare() 156 bus->max_bus_speed = PCI_SPEED_UNKNOWN; in pseries_root_bridge_prepare() 162 bus->cur_bus_speed = PCIE_SPEED_2_5GT; in pseries_root_bridge_prepare() [all …]
|
/arch/mips/lib/ |
D | iomap-pci.c | 19 struct pci_controller *ctrl = dev->bus->sysdata; in __pci_ioport_map() 24 struct pci_bus *bus = dev->bus; in __pci_ioport_map() local 27 while (bus->parent) in __pci_ioport_map() 28 bus = bus->parent; in __pci_ioport_map() 32 sprintf(name, "%04x:%02x", pci_domain_nr(bus), bus->number); in __pci_ioport_map()
|
/arch/arm/mach-orion5x/ |
D | pci.c | 49 static int pcie_valid_config(int bus, int dev) in pcie_valid_config() argument 56 if (bus == 0 && dev == 0) in pcie_valid_config() 62 if (bus == 0 && dev != 1) in pcie_valid_config() 76 static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, in pcie_rd_conf() argument 82 if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) { in pcie_rd_conf() 88 ret = orion_pcie_rd_conf(PCIE_BASE, bus, devfn, where, size, val); in pcie_rd_conf() 94 static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn, in pcie_rd_conf_wa() argument 99 if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) { in pcie_rd_conf_wa() 115 bus, devfn, where, size, val); in pcie_rd_conf_wa() 120 static int pcie_wr_conf(struct pci_bus *bus, u32 devfn, in pcie_wr_conf() argument [all …]
|
/arch/sh/drivers/pci/ |
D | ops-sh7786.c | 23 struct pci_bus *bus, unsigned int devfn, int where, u32 *data) in sh7786_pcie_config_access() argument 25 struct pci_channel *chan = bus->sysdata; in sh7786_pcie_config_access() 30 type = !!bus->parent; in sh7786_pcie_config_access() 33 if (bus->number > 255 || dev > 31 || func > 7) in sh7786_pcie_config_access() 51 if (pci_is_root_bus(bus)) { in sh7786_pcie_config_access() 67 pci_write_reg(chan, (bus->number << 24) | (dev << 19) | in sh7786_pcie_config_access() 92 static int sh7786_pcie_read(struct pci_bus *bus, unsigned int devfn, in sh7786_pcie_read() argument 105 ret = sh7786_pcie_config_access(PCI_ACCESS_READ, bus, in sh7786_pcie_read() 119 dev_dbg(&bus->dev, "pcie-config-read: bus=%3d devfn=0x%04x " in sh7786_pcie_read() 120 "where=0x%04x size=%d val=0x%08lx\n", bus->number, in sh7786_pcie_read() [all …]
|