/freebsd/sys/dev/usb/ |
H A D | usb_hub.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 6 * Copyright (c) 2008-2022 Hans Petter Selasky 44 #include <sys/bus.h> 108 #define UHUB_PROTO(sc) ((sc)->sc_udev->ddesc.bDeviceProtocol) 194 * has changed status. Notify the bus in uhub_intr_callback() 198 usb_needs_explore(sc->sc_udev->bus, 0); in uhub_intr_callback() 206 if (xfer->error != USB_ERR_CANCELLED) { in uhub_intr_callback() 208 * Do a clear-stall. The "stall_pipe" flag in uhub_intr_callback() 220 /*------------------------------------------------------------------------* [all …]
|
H A D | usb_device.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 4 * Copyright (c) 2008-2023 Hans Petter Selasky 38 #include <sys/bus.h> 119 int usb_template = -1; 127 /*------------------------------------------------------------------------* 133 *------------------------------------------------------------------------*/ 138 struct usb_bus *bus; in usb_trigger_reprobe_on_off() local 140 usb_error_t err; in usb_trigger_reprobe_on_off() local 146 bus = devclass_get_softc(usb_devclass_ptr, max); in usb_trigger_reprobe_on_off() [all …]
|
/freebsd/sys/dev/xen/pcifront/ |
H A D | pcifront.c | 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 49 #include <machine/bus.h> 53 #include <sys/bus.h> 58 #include <machine/xen-os.h> 60 #include <machine/hypervisor-ifs.h> 65 #include <machine/xen-public/memory.h> 66 #include <machine/xen-public/io/pciif.h> 82 #define INVALID_EVTCHN (-1) 107 int bus; member [all …]
|
/freebsd/sys/dev/pci/ |
H A D | pci_host_generic_fdt.c | 1 /*- 41 #include <sys/bus.h> 77 uint8_t bus; member 95 if (ofw_bus_is_compatible(dev, "pci-host-ecam-generic")) { in generic_pcie_fdt_probe() 116 STAILQ_INIT(&sc->pci_ofw_devlist); in pci_host_generic_setup_fdt() 120 device_printf(dev, "parsing FDT for ECAM%d:\n", sc->base.ecam); in pci_host_generic_setup_fdt() 121 if (parse_pci_mem_ranges(dev, &sc->base)) in pci_host_generic_setup_fdt() 124 /* Attach OFW bus */ in pci_host_generic_setup_fdt() 129 if (sc->base.coherent == 0) { in pci_host_generic_setup_fdt() 130 sc->base.coherent = OF_hasprop(node, "dma-coherent"); in pci_host_generic_setup_fdt() [all …]
|
H A D | pci_host_generic_acpi.c | 1 /*- 43 #include <sys/bus.h> 61 #include <machine/bus.h> 76 #define PCIE_ADDR_OFFSET(bus, slot, func, reg) \ argument 77 ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \ 111 * generic_pcie_acpi_probe - look for root bridge flag 123 root = (devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0; in generic_pcie_acpi_probe() 133 * pci_host_generic_acpi_parse_resource - parse PCI memory, IO and bus spaces 145 r = sc->base.nranges; in pci_host_generic_acpi_parse_resource() 146 switch (res->Type) { in pci_host_generic_acpi_parse_resource() [all …]
|
/freebsd/sys/dev/iicbus/ |
H A D | iicbb.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 31 * Generic I2C bit-banging code 42 * (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de> 52 #include <sys/bus.h> 105 /* bus interface */ 136 device_set_desc(dev, "I2C bit-banging driver"); in iicbb_probe() 146 sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); in iicbb_attach() 147 if (!sc->iicbus) in iicbb_attach() 150 sc->scl_low_timeout = DEFAULT_SCL_LOW_TIMEOUT; in iicbb_attach() [all …]
|
/freebsd/sys/dev/iicbus/mux/ |
H A D | iic_gpiomux.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 29 * Driver for i2c bus muxes controlled by one or more gpio pins. 39 #include <sys/bus.h> 56 {"i2c-mux-gpio", true}, 74 #define IDLE_NOOP (-1) /* When asked to idle the bus, do nothing. */ 86 * except when we're asked to idle the bus. In that case, we transcribe in gpiomux_bus_select() 87 * sc->idleidx to the pins, unless that is IDLE_NOOP (leave the current in gpiomux_bus_select() 88 * bus selected), in which case we just bail. in gpiomux_bus_select() 91 if (sc->idleidx == IDLE_NOOP) in gpiomux_bus_select() [all …]
|
H A D | iicmux.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 32 #include <sys/bus.h> 48 /*---- 61 int err, i; iicmux_callback() local 309 int err; iicmux_attach() local 336 int err, i; iicmux_detach() local [all...] |
/freebsd/sys/dev/mmc/ |
H A D | mmc.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 35 * Group. This Simplified Specification is provided on a non-confidential 38 * Association, SD Group, SD-3C LLC or other third parties. 44 * is provided "AS-IS" without any representations or warranties of any 45 * kind. No responsibility is assumed by the SD Group, SD-3C LLC or the SD 47 * right of the SD Group, SD-3C LLC, the SD Card Association or any third 50 * SD Group, SD-3C LLC, the SD Card Association or any third party. Nothing 51 * herein shall be construed as an obligation by the SD Group, the SD-3C LLC 53 * information, know-how or other confidential information to any third party. [all …]
|
/freebsd/sys/dev/sdhci/ |
H A D | sdhci_acpi.c | 1 /*- 28 #include <sys/bus.h> 38 #include <machine/bus.h> 114 bus_barrier(sc->mem_res, 0, 0xFF, in sdhci_acpi_read_1() 116 return bus_read_1(sc->mem_res, off); in sdhci_acpi_read_1() 125 bus_barrier(sc->mem_res, 0, 0xFF, in sdhci_acpi_write_1() 127 bus_write_1(sc->mem_res, off, val); in sdhci_acpi_write_1() 136 bus_barrier(sc->mem_res, 0, 0xFF, in sdhci_acpi_read_2() 138 return bus_read_2(sc->mem_res, off); in sdhci_acpi_read_2() 147 bus_barrier(sc->mem_res, 0, 0xFF, in sdhci_acpi_write_2() [all …]
|
/freebsd/sys/dev/usb/controller/ |
H A D | usb_controller.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 40 #include <sys/bus.h> 139 /*------------------------------------------------------------------------* 143 *------------------------------------------------------------------------*/ 153 usb_root_mount_rel(struct usb_bus *bus) in usb_root_mount_rel() argument 155 if (bus->bus_roothold != NULL) { in usb_root_mount_rel() 156 DPRINTF("Releasing root mount hold %p\n", bus->bus_roothold); in usb_root_mount_rel() 157 root_mount_rel(bus->bus_roothold); in usb_root_mount_rel() 158 bus->bus_roothold = NULL; in usb_root_mount_rel() [all …]
|
/freebsd/sys/arm/freescale/imx/ |
H A D | imx_i2c.c | 1 /*- 2 * Copyright (C) 2008-2009 Semihalf, Michal Hajduk 36 * This driver currently implements only master-mode operations. 38 * This driver supports multi-master i2c buses, by detecting bus arbitration 40 * retries if some other master jumps onto the bus and interrupts one of our 41 * transfer cycles resulting in arbitration loss in mid-transfer. The caller 47 #include <sys/bus.h> 55 #include <machine/bus.h> 96 #define I2CSR_MBB (1 << 5) /* Bus busy */ 133 {"fsl,imx21-i2c", 1}, [all …]
|
/freebsd/sys/arm/mv/ |
H A D | mv_pci.c | 1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 6 * Copyright (c) 2010-2015 Semihalf 40 * Marvell integrated PCI/PCI-Express controller driver. 51 #include <sys/bus.h> 74 #include <machine/bus.h> 87 * Code and data related to fdt-based PCI configuration. 90 * always Marvell-specific so that was deleted and the code now lives here. 107 printf(" base_pci = 0x%08lx\n", range->base_pci); in mv_pci_range_dump() 108 printf(" base_par = 0x%08lx\n", range->base_parent); in mv_pci_range_dump() [all …]
|
H A D | mv_pci_ctrl.c | 1 /*- 37 * Marvell integrated PCI/PCI-Express Bus Controller Driver. 46 #include <sys/bus.h> 62 uint64_t bus; member 85 * Bus interface definitions 92 /* Bus interface */ 112 {"mrvl,pcie-ctrl", (uintptr_t)&ofw_bus_reg_to_rl}, 113 {"marvell,armada-370-pcie", 126 MALLOC_DEFINE(M_PCIB_CTRL, "PCIe Bus Controller", 127 "Marvell Integrated PCIe Bus Controller"); [all …]
|
/freebsd/sys/dev/vnic/ |
H A D | mrml_bridge.c | 32 #include <sys/bus.h> 44 #include <machine/bus.h> 62 /* Bus interface */ 95 if (!ofw_bus_is_compatible(dev, "cavium,thunder-8890-mrml-bridge")) in mrmlb_fdt_probe() 105 int err; in mrmlb_fdt_attach() local 107 err = mrmlb_ofw_bus_attach(dev); in mrmlb_fdt_attach() 108 if (err != 0) in mrmlb_fdt_attach() 109 return (err); in mrmlb_fdt_attach() 115 /* OFW bus interface */ 122 mrmlb_ofw_get_devinfo(device_t bus __unused, device_t child) in mrmlb_ofw_get_devinfo() [all …]
|
H A D | thunder_mdio_fdt.c | 1 /*- 31 #include <sys/bus.h> 42 #include <machine/bus.h> 68 {"cavium,octeon-3860-mdio", true}, 69 {"cavium,thunder-8890-mdio", true}, 79 if (!ofw_bus_search_compatible(dev, mdio_compat_data)->ocd_data) in thunder_mdio_fdt_probe() 122 /* Bus interface */ 154 if (!ofw_bus_is_compatible(dev, "cavium,thunder-8890-mdio-nexus")) in mdionexus_fdt_probe() 164 int err; in mdionexus_fdt_attach() local 166 err = mdionexus_ofw_bus_attach(dev); in mdionexus_fdt_attach() [all …]
|
/freebsd/sys/arm/ti/ |
H A D | ti_i2c.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 46 #include <sys/bus.h> 56 #include <machine/bus.h> 99 u_int frequency; /* Bus frequency in Hz */ 109 * OMAP4 i2c bus clock is 96MHz / ((psc + 1) * (scll + 7 + sclh + 5)). 117 /* { 3200000, 1, 113, 115, 7, 10}, - HS mode */ 124 * AM335x i2c bus clock is 48MHZ / ((psc + 1) * (scll + 7 + sclh + 5)) 138 #define TI_I2C_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 139 #define TI_I2C_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) [all …]
|
/freebsd/sys/powerpc/ps3/ |
H A D | ps3disk.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 34 #include <sys/bus.h> 47 #include <machine/bus.h> 50 #include <sys/bus.h> 56 #include "ps3-hvcall.h" 59 mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "ps3disk", MTX_DEF) 60 #define PS3DISK_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); 61 #define PS3DISK_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) 62 #define PS3DISK_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) [all …]
|
/freebsd/sys/powerpc/powernv/ |
H A D | opal_pci.c | 1 /*- 2 * Copyright (c) 2015-2016 Nathan Whitehorn 3 * Copyright (c) 2017-2018 Semihalf 31 #include <sys/bus.h> 48 #include <machine/bus.h> 89 static int opalpci_route_interrupt(device_t bus, device_t dev, int pin); 97 /* Bus interface */ 150 /* Bus interface */ 186 if (!OF_hasprop(ofw_bus_get_node(dev), "ibm,opal-phbid")) in opalpci_probe() 189 device_set_desc(dev, "OPAL Host-PCI bridge"); in opalpci_probe() [all …]
|
/freebsd/sys/arm64/arm64/ |
H A D | gic_v3_fdt.c | 1 /*- 32 #include <sys/bus.h> 62 /* Bus interface */ 101 if (!ofw_bus_is_compatible(dev, "arm,gic-v3")) in gic_v3_fdt_probe() 114 int err; in gic_v3_fdt_attach() local 119 sc->dev = dev; in gic_v3_fdt_attach() 120 sc->gic_bus = GIC_BUS_FDT; in gic_v3_fdt_attach() 123 * Recover number of the Re-Distributor regions. in gic_v3_fdt_attach() 125 if (OF_getencprop(ofw_bus_get_node(dev), "#redistributor-regions", in gic_v3_fdt_attach() 127 sc->gic_redists.nregions = 1; in gic_v3_fdt_attach() [all …]
|
/freebsd/sys/dev/pci/controller/ |
H A D | pci_n1sdp.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 9 * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the 37 #include <sys/bus.h> 94 paddr = AP_NS_SHARED_MEM_BASE + sc->acpi.segment * BDF_TABLE_SIZE; in n1sdp_init() 112 paddr_rc = (vm_offset_t)shared_data->rc_base_addr; in n1sdp_init() 113 error = bus_space_map(sc->acpi.base.res->r_bustag, paddr_rc, in n1sdp_init() 114 PCI_CFG_SPACE_SIZE, 0, &sc->n1_bsh); in n1sdp_init() 119 sizeof(uint32_t) * shared_data->nr_bdfs; in n1sdp_init() 120 sc->n1_discovery_data = malloc(bdfs_size, M_DEVBUF, in n1sdp_init() [all …]
|
/freebsd/sys/dev/gpio/ |
H A D | acpi_gpiobus.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 29 #include <sys/bus.h> 55 ACPI_HANDLE dev_handle; /* ACPI handle for bus */ 65 if (gpio_res->ConnectionType == ACPI_RESOURCE_GPIO_TYPE_INT) { in acpi_gpiobus_convflags() 66 switch (gpio_res->Polarity) { in acpi_gpiobus_convflags() 68 flags = gpio_res->Triggerin in acpi_gpiobus_convflags() 152 acpi_gpiobus_setup_devinfo(device_t bus,device_t child,ACPI_RESOURCE_GPIO * gpio_res) acpi_gpiobus_setup_devinfo() argument 183 device_t bus = ctx->sc->sc_busdev; acpi_gpiobus_enumerate_aei() local 324 int err; acpi_gpiobus_attach() local [all...] |
H A D | gpioiic.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 35 #include <sys/bus.h> 62 {"i2c-gpio", true}, /* Standard devicetree compat string */ 70 gpioiic_get_node(device_t bus, device_t dev) in gpioiic_get_node() argument 74 return (ofw_bus_get_node(bus)); in gpioiic_get_node() 81 int err; in gpioiic_setup_fdt_pins() local 83 node = ofw_bus_get_node(sc->dev); in gpioiic_setup_fdt_pins() 87 * property. The modern bindings specify separate scl-gpios and in gpioiic_setup_fdt_pins() 88 * sda-gpios properties. We cope with whichever is present. in gpioiic_setup_fdt_pins() [all …]
|
/freebsd/sys/arm/arm/ |
H A D | nexus.c | 1 /*- 44 #include <sys/bus.h> 54 #include <machine/bus.h> 118 /* Bus interface */ 194 nexus_print_child(device_t bus, device_t child) in nexus_print_child() argument 198 retval += bus_print_child_header(bus, child); in nexus_print_child() 205 nexus_add_child(device_t bus, u_int order, const char *name, int unit) in nexus_add_child() argument 213 resource_list_init(&ndev->nx_resources); in nexus_add_child() 215 child = device_add_child_ordered(bus, order, name, unit); in nexus_add_child() 223 nexus_get_rman(device_t bus, int type, u_int flags) in nexus_get_rman() argument [all …]
|
/freebsd/sys/arm/broadcom/bcm2835/ |
H A D | bcm2835_sdhci.c | 1 /*- 2 * SPDX-License-Identifier: BSD-2-Clause 32 #include <sys/bus.h> 43 #include <machine/bus.h> 78 ((((NUM_DMA_SEGS * BCM_SDHCI_BUFFER_SIZE) - 1) / PAGE_SIZE) + 1) 83 ((slot)->curcmd->data->len - (slot)->offset) 121 .clock_src = -1, 131 .clock_src = -1, 138 {"broadcom,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, 139 {"brcm,bcm2835-sdhci", (uintptr_t)&bcm2835_sdhci_conf}, [all …]
|