/openbmc/qemu/tests/qtest/libqos/ |
H A D | generic-pcihost.c | 10 * See the COPYING file in the top-level directory. 15 #include "generic-pcihost.h" 18 #include "qemu/host-utils.h" 27 if (!g_strcmp0(device, "pci-bus-generic")) { in generic_pcihost_get_device() 28 return &host->pci.obj; in generic_pcihost_get_device() 30 fprintf(stderr, "%s not present in generic-pcihost\n", device); in generic_pcihost_get_device() 38 host->obj.get_device = generic_pcihost_get_device; in qos_create_generic_pcihost() 39 qpci_init_generic(&host->pci, qts, alloc, false); in qos_create_generic_pcihost() 42 static uint8_t qpci_generic_pio_readb(QPCIBus *bus, uint32_t addr) in qpci_generic_pio_readb() argument 44 QGenericPCIBus *s = container_of(bus, QGenericPCIBus, bus); in qpci_generic_pio_readb() [all …]
|
H A D | pci.c | 4 * Copyright IBM, Corp. 2012-2013 10 * See the COPYING file in the top-level directory. 19 #include "qemu/host-utils.h" 22 void qpci_device_foreach(QPCIBus *bus, int vendor_id, int device_id, in qpci_device_foreach() argument 34 dev = qpci_device_find(bus, QPCI_DEVFN(slot, fn)); in qpci_device_foreach() 39 if (vendor_id != -1 && in qpci_device_foreach() 45 if (device_id != -1 && in qpci_device_foreach() 58 return dev->bus->has_buggy_msi; in qpci_has_buggy_msi() 70 static void qpci_device_set(QPCIDevice *dev, QPCIBus *bus, int devfn) in qpci_device_set() argument 74 dev->bus = bus; in qpci_device_set() [all …]
|
H A D | pci-pc.c | 4 * Copyright IBM, Corp. 2012-2013 10 * See the COPYING file in the top-level directory. 15 #include "pci-pc.h" 24 static uint8_t qpci_pc_pio_readb(QPCIBus *bus, uint32_t addr) in qpci_pc_pio_readb() argument 26 return qtest_inb(bus->qts, addr); in qpci_pc_pio_readb() 29 static void qpci_pc_pio_writeb(QPCIBus *bus, uint32_t addr, uint8_t val) in qpci_pc_pio_writeb() argument 31 qtest_outb(bus->qts, addr, val); in qpci_pc_pio_writeb() 34 static uint16_t qpci_pc_pio_readw(QPCIBus *bus, uint32_t addr) in qpci_pc_pio_readw() argument 36 return qtest_inw(bus->qts, addr); in qpci_pc_pio_readw() 39 static void qpci_pc_pio_writew(QPCIBus *bus, uint32_t addr, uint16_t val) in qpci_pc_pio_writew() argument [all …]
|
H A D | pci-spapr.c | 5 * See the COPYING file in the top-level directory. 10 #include "pci-spapr.h" 16 #include "qemu/host-utils.h" 20 * PCI devices are always little-endian 21 * SPAPR by default is big-endian 25 static uint8_t qpci_spapr_pio_readb(QPCIBus *bus, uint32_t addr) in qpci_spapr_pio_readb() argument 27 QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus); in qpci_spapr_pio_readb() 28 return qtest_readb(bus->qts, s->pio_cpu_base + addr); in qpci_spapr_pio_readb() 31 static void qpci_spapr_pio_writeb(QPCIBus *bus, uint32_t addr, uint8_t val) in qpci_spapr_pio_writeb() argument 33 QPCIBusSPAPR *s = container_of(bus, QPCIBusSPAPR, bus); in qpci_spapr_pio_writeb() [all …]
|
H A D | pci.h | 4 * Copyright IBM, Corp. 2012-2013 10 * See the COPYING file in the top-level directory. 27 uint8_t (*pio_readb)(QPCIBus *bus, uint32_t addr); 28 uint16_t (*pio_readw)(QPCIBus *bus, uint32_t addr); 29 uint32_t (*pio_readl)(QPCIBus *bus, uint32_t addr); 30 uint64_t (*pio_readq)(QPCIBus *bus, uint32_t addr); 32 void (*pio_writeb)(QPCIBus *bus, uint32_t addr, uint8_t value); 33 void (*pio_writew)(QPCIBus *bus, uint32_t addr, uint16_t value); 34 void (*pio_writel)(QPCIBus *bus, uint32_t addr, uint32_t value); 35 void (*pio_writeq)(QPCIBus *bus, uint32_t addr, uint64_t value); [all …]
|
/openbmc/qemu/hw/i2c/ |
H A D | smbus_master.c | 19 int smbus_quick_command(I2CBus *bus, uint8_t addr, int read) in smbus_quick_command() argument 21 if (i2c_start_transfer(bus, addr, read)) { in smbus_quick_command() 22 return -1; in smbus_quick_command() 24 i2c_end_transfer(bus); in smbus_quick_command() 28 int smbus_receive_byte(I2CBus *bus, uint8_t addr) in smbus_receive_byte() argument 32 if (i2c_start_recv(bus, addr)) { in smbus_receive_byte() 33 return -1; in smbus_receive_byte() 35 data = i2c_recv(bus); in smbus_receive_byte() 36 i2c_nack(bus); in smbus_receive_byte() 37 i2c_end_transfer(bus); in smbus_receive_byte() [all …]
|
/openbmc/linux/drivers/net/phy/ |
H A D | mdio_bus.c | 1 // SPDX-License-Identifier: GPL-2.0+ 2 /* MDIO Bus interface 42 #include "mdio-boardinfo.h" 47 mdiodev->reset_gpio = gpiod_get_optional(&mdiodev->dev, in mdiobus_register_gpiod() 49 if (IS_ERR(mdiodev->reset_gpio)) in mdiobus_register_gpiod() 50 return PTR_ERR(mdiodev->reset_gpio); in mdiobus_register_gpiod() 52 if (mdiodev->reset_gpio) in mdiobus_register_gpiod() 53 gpiod_set_consumer_name(mdiodev->reset_gpio, "PHY reset"); in mdiobus_register_gpiod() 62 reset = reset_control_get_optional_exclusive(&mdiodev->dev, "phy"); in mdiobus_register_reset() 66 mdiodev->reset_ctrl = reset; in mdiobus_register_reset() [all …]
|
/openbmc/linux/sound/hda/ |
H A D | hdac_bus.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HD-audio core bus driver 24 * snd_hdac_bus_init - initialize a HD-audio bas bus 25 * @bus: the pointer to bus object 27 * @ops: bus verb operators 31 int snd_hdac_bus_init(struct hdac_bus *bus, struct device *dev, in snd_hdac_bus_init() argument 34 memset(bus, 0, sizeof(*bus)); in snd_hdac_bus_init() 35 bus->dev = dev; in snd_hdac_bus_init() 37 bus->ops = ops; in snd_hdac_bus_init() 39 bus->ops = &default_ops; in snd_hdac_bus_init() [all …]
|
H A D | hdac_controller.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * HD-audio controller helpers 15 static void azx_clear_corbrp(struct hdac_bus *bus) in azx_clear_corbrp() argument 19 for (timeout = 1000; timeout > 0; timeout--) { in azx_clear_corbrp() 20 if (snd_hdac_chip_readw(bus, CORBRP) & AZX_CORBRP_RST) in azx_clear_corbrp() 25 dev_err(bus->dev, "CORB reset timeout#1, CORBRP = %d\n", in azx_clear_corbrp() 26 snd_hdac_chip_readw(bus, CORBRP)); in azx_clear_corbrp() 28 snd_hdac_chip_writew(bus, CORBRP, 0); in azx_clear_corbrp() 29 for (timeout = 1000; timeout > 0; timeout--) { in azx_clear_corbrp() 30 if (snd_hdac_chip_readw(bus, CORBRP) == 0) in azx_clear_corbrp() [all …]
|
/openbmc/linux/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/ |
H A D | anx9805.c | 28 #include "bus.h" 32 struct nvkm_i2c_bus *bus; member 33 u8 addr; member 39 u8 addr; member 45 struct anx9805_bus *bus = anx9805_bus(base); in anx9805_bus_xfer() local 46 struct anx9805_pad *pad = bus->pad; in anx9805_bus_xfer() 47 struct i2c_adapter *adap = &pad->bus->i2c; in anx9805_bus_xfer() 49 int ret = -ETIMEDOUT; in anx9805_bus_xfer() 53 tmp = nvkm_rdi2cr(adap, pad->addr, 0x07) & ~0x10; in anx9805_bus_xfer() 54 nvkm_wri2cr(adap, pad->addr, 0x07, tmp | 0x10); in anx9805_bus_xfer() [all …]
|
H A D | busnv50.c | 25 #include "bus.h" 31 u32 addr; member 38 struct nv50_i2c_bus *bus = nv50_i2c_bus(base); in nv50_i2c_bus_drive_scl() local 39 struct nvkm_device *device = bus->base.pad->i2c->subdev.device; in nv50_i2c_bus_drive_scl() 40 if (state) bus->data |= 0x01; in nv50_i2c_bus_drive_scl() 41 else bus->data &= 0xfe; in nv50_i2c_bus_drive_scl() 42 nvkm_wr32(device, bus->addr, bus->data); in nv50_i2c_bus_drive_scl() 48 struct nv50_i2c_bus *bus = nv50_i2c_bus(base); in nv50_i2c_bus_drive_sda() local 49 struct nvkm_device *device = bus->base.pad->i2c->subdev.device; in nv50_i2c_bus_drive_sda() 50 if (state) bus->data |= 0x02; in nv50_i2c_bus_drive_sda() [all …]
|
/openbmc/linux/drivers/net/dsa/sja1105/ |
H A D | sja1105_mdio.c | 1 // SPDX-License-Identifier: GPL-2.0 4 #include <linux/pcs/pcs-xpcs.h> 10 int sja1105_pcs_mdio_read_c45(struct mii_bus *bus, int phy, int mmd, int reg) in sja1105_pcs_mdio_read_c45() argument 12 struct sja1105_mdio_private *mdio_priv = bus->priv; in sja1105_pcs_mdio_read_c45() 13 struct sja1105_private *priv = mdio_priv->priv; in sja1105_pcs_mdio_read_c45() 14 u64 addr; in sja1105_pcs_mdio_read_c45() local 18 addr = (mmd << 16) | reg; in sja1105_pcs_mdio_read_c45() 28 rc = sja1105_xfer_u32(priv, SPI_READ, addr, &tmp, NULL); in sja1105_pcs_mdio_read_c45() 35 int sja1105_pcs_mdio_write_c45(struct mii_bus *bus, int phy, int mmd, in sja1105_pcs_mdio_write_c45() argument 38 struct sja1105_mdio_private *mdio_priv = bus->priv; in sja1105_pcs_mdio_write_c45() [all …]
|
/openbmc/linux/drivers/media/pci/cx25821/ |
H A D | cx25821-i2c.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 22 MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time"); 27 printk(KERN_DEBUG "%s/0: " fmt, dev->name, ##arg); \ 38 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_slave_did_ack() local 39 struct cx25821_dev *dev = bus->dev; in i2c_slave_did_ack() 40 return cx_read(bus->reg_stat) & 0x01; in i2c_slave_did_ack() 45 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_is_busy() local 46 struct cx25821_dev *dev = bus->dev; in i2c_is_busy() 47 return cx_read(bus->reg_stat) & 0x02 ? 1 : 0; in i2c_is_busy() 69 struct cx25821_i2c *bus = i2c_adap->algo_data; in i2c_sendbytes() local [all …]
|
/openbmc/linux/drivers/pci/controller/ |
H A D | pci-thunder-ecam.c | 1 // SPDX-License-Identifier: GPL-2.0 11 #include <linux/pci-ecam.h> 29 static int handle_ea_bar(u32 e0, int bar, struct pci_bus *bus, in handle_ea_bar() argument 32 void __iomem *addr; in handle_ea_bar() local 35 /* Entries are 16-byte aligned; bits[2,3] select word in entry */ in handle_ea_bar() 43 addr = bus->ops->map_bus(bus, devfn, bar); /* BAR 0 */ in handle_ea_bar() 44 if (!addr) in handle_ea_bar() 47 v = readl(addr); in handle_ea_bar() 49 v |= 2; /* EA entry-1. Base-L */ in handle_ea_bar() 57 addr = bus->ops->map_bus(bus, devfn, bar); /* BAR 0 */ in handle_ea_bar() [all …]
|
/openbmc/linux/arch/powerpc/platforms/maple/ |
H A D | pci.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 19 #include <asm/pci-bridge.h> 22 #include <asm/ppc-pci.h> 23 #include <asm/isa-bridge.h> 37 for (; node; node = node->sibling) { in fixup_one_level_bus_range() 42 /* For PCI<->PCI bridges or CardBus bridges, we go down */ in fixup_one_level_bus_range() 43 class_code = of_get_property(node, "class-code", NULL); in fixup_one_level_bus_range() 47 bus_range = of_get_property(node, "bus-range", &len); in fixup_one_level_bus_range() 52 higher = fixup_one_level_bus_range(node->child, higher); in fixup_one_level_bus_range() 57 /* This routine fixes the "bus-range" property of all bridges in the [all …]
|
/openbmc/u-boot/board/gdsys/common/ |
H A D | phy.c | 1 // SPDX-License-Identifier: GPL-2.0+ 55 * - set RGMII receive timing to "receive clock transition when data stable" 56 * - set RGMII transmit timing to "transmit clock internally delayed" 57 * - set RGMII output impedance target to 78,8 Ohm 58 * - run output impedance calibration 59 * - set autonegotiation advertise to 1000FD only 102 * turn off SGMII auto-negotiation 120 static int process_setupcmd(const char *bus, unsigned char addr, in process_setupcmd() argument 124 u8 reg = setupcmd->reg; in process_setupcmd() 125 u16 data = setupcmd->data; in process_setupcmd() [all …]
|
/openbmc/qemu/hw/ide/ |
H A D | pci.c | 2 * QEMU IDE Emulation: PCI Bus support. 31 #include "qemu/error-report.h" 34 #include "ide-internal.h" 43 static uint64_t pci_ide_status_read(void *opaque, hwaddr addr, unsigned size) in pci_ide_status_read() argument 45 IDEBus *bus = opaque; in pci_ide_status_read() local 47 if (addr != 2 || size != 1) { in pci_ide_status_read() 48 return ((uint64_t)1 << (size * 8)) - 1; in pci_ide_status_read() 50 return ide_status_read(bus, addr + 2); in pci_ide_status_read() 53 static void pci_ide_ctrl_write(void *opaque, hwaddr addr, in pci_ide_ctrl_write() argument 56 IDEBus *bus = opaque; in pci_ide_ctrl_write() local [all …]
|
/openbmc/linux/include/trace/events/ |
H A D | fsi_master_i2cr.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 15 __field(int, bus) 18 __field(unsigned short, addr) 21 __entry->bus = client->adapter->nr; 22 __entry->rc = rc; 23 memcpy(__entry->command, &command, sizeof(uint32_t)); 24 __entry->addr = client->addr; 26 TP_printk("%d-%02x command:{ %*ph } rc:%d", __entry->bus, __entry->addr, 27 (int)sizeof(uint32_t), __entry->command, __entry->rc) 34 __field(int, bus) [all …]
|
/openbmc/linux/drivers/soundwire/ |
H A D | bus.c | 1 // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) 2 // Copyright(c) 2015-17 Intel Corporation. 11 #include "bus.h" 17 static int sdw_get_id(struct sdw_bus *bus) in sdw_get_id() argument 24 bus->id = rc; in sdw_get_id() 26 if (bus->controller_id == -1) in sdw_get_id() 27 bus->controller_id = rc; in sdw_get_id() 33 * sdw_bus_master_add() - add a bus Master instance 34 * @bus: bus instance 38 * Initializes the bus instance, read properties and create child [all …]
|
/openbmc/qemu/hw/usb/ |
H A D | trace-events | 4 …_state_change(int bus, const char *port, int ep, void *p, const char *o, const char *n) "bus %d, p… 5 usb_packet_state_fault(int bus, const char *port, int ep, void *p, const char *o, const char *n) "b… 7 # bus.c 8 usb_port_claim(int bus, const char *port) "bus %d, port %s" 9 usb_port_attach(int bus, const char *port, const char *devspeed, const char *portspeed) "bus %d, po… 10 usb_port_detach(int bus, const char *port) "bus %d, port %s" 11 usb_port_release(int bus, const char *port) "bus %d, port %s" 13 # hcd-ohci-pci.c 16 # hcd-ohci.c 17 usb_ohci_iso_td_read_failed(uint32_t addr) "ISO_TD read error at 0x%x" [all …]
|
/openbmc/linux/drivers/of/ |
H A D | fdt_address.c | 1 // SPDX-License-Identifier: GPL-2.0+ 3 * FDT Address translation based on u-boot fdt_support.c which in turn was 9 * Copyright 2010-2011 Freescale Semiconductor, Inc. 27 static void __init of_dump_addr(const char *s, const __be32 *addr, int na) in of_dump_addr() argument 30 while(na--) in of_dump_addr() 31 pr_cont(" %08x", *(addr++)); in of_dump_addr() 35 static void __init of_dump_addr(const char *s, const __be32 *addr, int na) { } in of_dump_addr() argument 38 /* Callbacks for bus specific translators */ 42 u64 (*map)(__be32 *addr, const __be32 *range, 44 int (*translate)(__be32 *addr, u64 offset, int na); [all …]
|
/openbmc/linux/drivers/infiniband/hw/hfi1/ |
H A D | qsfp.c | 1 // SPDX-License-Identifier: GPL-2.0 or BSD-3-Clause 12 /* for the given bus number, return the CSR for reading an i2c line */ 18 /* for the given bus number, return the CSR for writing an i2c line */ 26 struct hfi1_i2c_bus *bus = (struct hfi1_i2c_bus *)data; in hfi1_setsda() local 27 struct hfi1_devdata *dd = bus->controlling_dd; in hfi1_setsda() 31 target_oe = i2c_oe_csr(bus->num); in hfi1_setsda() 50 struct hfi1_i2c_bus *bus = (struct hfi1_i2c_bus *)data; in hfi1_setscl() local 51 struct hfi1_devdata *dd = bus->controlling_dd; in hfi1_setscl() 55 target_oe = i2c_oe_csr(bus->num); in hfi1_setscl() 74 struct hfi1_i2c_bus *bus = (struct hfi1_i2c_bus *)data; in hfi1_getsda() local [all …]
|
/openbmc/qemu/hw/i386/ |
H A D | trace-events | 3 # x86-iommu.c 10 vtd_inv_desc_cc_device(uint8_t bus, uint8_t dev, uint8_t fn) "context invalidate device %02"PRIx8":… 14 …nv_desc_iotlb_pages(uint16_t domain, uint64_t addr, uint8_t mask) "iotlb invalidate domain 0x%"PRI… 15 …pasid_pages(uint16_t domain, uint64_t addr, uint8_t mask, uint32_t pasid) "iotlb invalidate domain… 17 vtd_inv_desc_wait_sw(uint64_t addr, uint32_t data) "wait invalidate status write addr 0x%"PRIx64" d… 22 vtd_inv_qi_setup(uint64_t addr, int size) "addr 0x%"PRIx64" size %d" 27 vtd_re_not_present(uint8_t bus) "Root entry bus %"PRIu8" not present" 28 vtd_ce_not_present(uint8_t bus, uint8_t devfn) "Context entry bus %"PRIu8" devfn %"PRIu8" not prese… 29 vtd_iotlb_page_hit(uint16_t sid, uint64_t addr, uint64_t slpte, uint16_t domain) "IOTLB page hit si… 30 vtd_iotlb_page_update(uint16_t sid, uint64_t addr, uint64_t slpte, uint16_t domain) "IOTLB page upd… [all …]
|
/openbmc/u-boot/common/ |
H A D | miiphyutil.c | 1 // SPDX-License-Identifier: GPL-2.0+ 8 * This provides a bit-banged interface to the ethernet MII management 50 if (strcmp(dev->name, devname) == 0) in miiphy_get_dev_by_name() 69 struct mii_dev *bus; in mdio_alloc() local 71 bus = malloc(sizeof(*bus)); in mdio_alloc() 72 if (!bus) in mdio_alloc() 73 return bus; in mdio_alloc() 75 memset(bus, 0, sizeof(*bus)); in mdio_alloc() 78 INIT_LIST_HEAD(&bus->link); in mdio_alloc() 80 return bus; in mdio_alloc() [all …]
|
/openbmc/linux/include/sound/ |
H A D | hdaudio.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 3 * HD-audio core stuff 12 #include <linux/io-64-nonatomic-lo-hi.h> 34 * exported bus type 50 * HD-audio codec base device 55 struct hdac_bus *bus; member 56 unsigned int addr; /* codec address */ member 57 struct list_head list; /* list point for bus codec_list */ 121 int snd_hdac_device_init(struct hdac_device *dev, struct hdac_bus *bus, 122 const char *name, unsigned int addr); [all …]
|