Home
last modified time | relevance | path

Searched refs:sc_res (Results 1 – 25 of 41) sorted by relevance

12

/freebsd/sys/dev/bhnd/cores/chipc/
H A Dchipc_spi.h67 struct resource *sc_res; /**< SPI registers */ member
75 #define SPI_BARRIER_WRITE(sc) bus_barrier((sc)->sc_res, 0, 0, \
77 #define SPI_BARRIER_READ(sc) bus_barrier((sc)->sc_res, 0, 0, \
79 #define SPI_BARRIER_RW(sc) bus_barrier((sc)->sc_res, 0, 0, \
83 #define SPI_WRITE(sc, reg, val) bus_write_4(sc->sc_res, (reg), (val));
85 #define SPI_READ(sc, reg) bus_read_4(sc->sc_res, (reg))
H A Dchipc_spi.c87 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, in chipc_spi_attach()
89 if (sc->sc_res == NULL) { in chipc_spi_attach()
147 if (sc->sc_res != NULL) in chipc_spi_attach()
149 sc->sc_res); in chipc_spi_attach()
169 bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); in chipc_spi_detach()
/freebsd/sys/powerpc/mpc85xx/
H A Datpic.c56 struct resource *sc_res[2]; member
123 val = bus_read_1(sc->sc_res[icu], ofs); in atpic_read()
131 bus_write_1(sc->sc_res[icu], ofs, val); in atpic_write()
132 bus_barrier(sc->sc_res[icu], ofs, 2 - ofs, in atpic_write()
199 sc->sc_res[ATPIC_MASTER] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, in atpic_isa_attach()
201 if (sc->sc_res[ATPIC_MASTER] == NULL) in atpic_isa_attach()
205 sc->sc_res[ATPIC_SLAVE] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, in atpic_isa_attach()
207 if (sc->sc_res[ATPIC_SLAVE] == NULL) in atpic_isa_attach()
231 if (sc->sc_res[ATPIC_SLAVE] != NULL) in atpic_isa_attach()
233 sc->sc_rid[ATPIC_SLAVE], sc->sc_res[ATPIC_SLAV in atpic_isa_attach()
[all...]
H A Dpci_mpc85xx.c153 struct resource *sc_res; member
322 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, in fsl_pcib_attach()
324 if (sc->sc_res == NULL) { in fsl_pcib_attach()
328 sc->sc_bst = rman_get_bustag(sc->sc_res); in fsl_pcib_attach()
329 sc->sc_bsh = rman_get_bushandle(sc->sc_res); in fsl_pcib_attach()
332 ipreg = bus_read_4(sc->sc_res, REG_PEX_IP_BLK_REV1); in fsl_pcib_attach()
441 if (sc->sc_res != NULL) in fsl_pcib_attach()
442 bus_release_resource(dev, sc->sc_res); in fsl_pcib_attach()
698 if (sc->sc_res != NULL) in fsl_pcib_detach()
699 bus_release_resource(dev, sc->sc_res); in fsl_pcib_detach()
[all …]
/freebsd/sys/dev/hwpmc/
H A Dpmu_dmc620.c62 struct resource *sc_res[2]; member
69 #define RD4(sc, r) bus_read_4((sc)->sc_res[0], (r))
70 #define WR4(sc, r, v) bus_write_4((sc)->sc_res[0], (r), (v))
138 i = bus_alloc_resources(dev, pmu_dmc620_res_spec, sc->sc_res); in pmu_dmc620_acpi_attach()
158 if (sc->sc_res[1] != NULL && bus_setup_intr(dev, sc->sc_res[1], in pmu_dmc620_acpi_attach()
161 bus_release_resources(dev, pmu_dmc620_res_spec, sc->sc_res); in pmu_dmc620_acpi_attach()
176 if (sc->sc_res[1] != NULL) { in pmu_dmc620_acpi_detach()
177 bus_teardown_intr(dev, sc->sc_res[1], sc->sc_ih); in pmu_dmc620_acpi_detach()
179 bus_release_resources(dev, pmu_dmc620_res_spec, sc->sc_res); in pmu_dmc620_acpi_detach()
/freebsd/sys/arm/freescale/imx/
H A Dimx_wdog.c57 struct resource *sc_res[2]; member
90 return (bus_read_2(sc->sc_res[MEMRES], offs)); in RD2()
97 bus_write_2(sc->sc_res[MEMRES], offs, val); in WR2()
164 imx_wdog_cpu_reset(BUS_SPACE_PHYSADDR(sc->sc_res[MEMRES], WDOG_CR_REG)); in imx_wdog_intr()
192 if (bus_alloc_resources(dev, imx_wdog_spec, sc->sc_res)) { in imx_wdog_attach()
207 bus_setup_intr(sc->sc_dev, sc->sc_res[IRQRES], in imx_wdog_attach()
H A Dimx_gpio.c118 struct resource *sc_res[3]; /* 1 x mem, 2 x IRQ */ member
824 if (bus_alloc_resources(dev, imx_gpio_spec, sc->sc_res)) { in imx51_gpio_attach()
826 bus_release_resources(dev, imx_gpio_spec, sc->sc_res); in imx51_gpio_attach()
831 sc->sc_iot = rman_get_bustag(sc->sc_res[0]); in imx51_gpio_attach()
832 sc->sc_ioh = rman_get_bushandle(sc->sc_res[0]); in imx51_gpio_attach()
839 if ((bus_setup_intr(dev, sc->sc_res[1 + irq], INTR_TYPE_CLK, in imx51_gpio_attach()
897 bus_teardown_intr(dev, sc->sc_res[irq + FIRST_IRQRES], in imx51_gpio_detach()
900 bus_release_resources(dev, imx_gpio_spec, sc->sc_res); in imx51_gpio_detach()
/freebsd/sys/dev/amdgpio/
H A Damdgpio.c69 return (bus_read_4(sc->sc_res[0], off)); in amdgpio_read_4()
76 bus_write_4(sc->sc_res[0], off, val); in amdgpio_write_4()
129 if (sc->sc_res[0] == NULL) in amdgpio_valid_pin()
453 if (bus_alloc_resources(dev, amdgpio_spec, sc->sc_res)) { in amdgpio_attach()
458 sc->sc_bst = rman_get_bustag(sc->sc_res[0]); in amdgpio_attach()
459 sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); in amdgpio_attach()
462 if (bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_MISC | INTR_MPSAFE, in amdgpio_attach()
513 bus_teardown_intr(dev, sc->sc_res[1], sc->sc_intr_handle); in amdgpio_attach()
515 bus_release_resources(dev, amdgpio_spec, sc->sc_res); in amdgpio_attach()
531 bus_teardown_intr(dev, sc->sc_res[1], sc->sc_intr_handle); in amdgpio_detach()
[all …]
/freebsd/sys/dev/gem/
H A Dif_gem_pci.c171 if (bus_alloc_resources(dev, gem_pci_res_spec, sc->sc_res)) { in gem_pci_attach()
173 bus_release_resources(dev, gem_pci_res_spec, sc->sc_res); in gem_pci_attach()
275 bus_read_region_1(sc->sc_res[GEM_RES_MEM], in gem_pci_attach()
295 if (bus_setup_intr(dev, sc->sc_res[GEM_RES_INTR], INTR_TYPE_NET | in gem_pci_attach()
305 bus_release_resources(dev, gem_pci_res_spec, sc->sc_res); in gem_pci_attach()
315 bus_teardown_intr(dev, sc->sc_res[GEM_RES_INTR], sc->sc_ih); in gem_pci_detach()
318 bus_release_resources(dev, gem_pci_res_spec, sc->sc_res); in gem_pci_detach()
H A Dif_gemvar.h118 struct resource *sc_res[2]; member
180 bus_barrier((sc)->sc_res[GEM_RES_MEM], (offs), (len), (flags))
183 bus_read_ ## n((sc)->sc_res[GEM_RES_MEM], (offs))
198 bus_write_ ## n((sc)->sc_res[GEM_RES_MEM], (offs), (v))
/freebsd/sys/dev/agp/
H A Dagp_i810.c206 struct resource *sc_res[2]; member
796 bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL)); in agp_i810_dump_regs()
807 bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL)); in agp_i830_dump_regs()
818 bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL)); in agp_i855_dump_regs()
829 bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL)); in agp_i915_dump_regs()
842 bus_read_4(sc->sc_res[0], AGP_I965_PGTBL_CTL2)); in agp_i965_dump_regs()
913 switch (bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL) & in agp_i915_get_stolen_size()
1098 pgetbl_ctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL); in agp_i965_get_gtt_total_entries()
1135 pgetbl_ctl2 = bus_read_4(sc->sc_res[0], AGP_I965_PGTBL_CTL2); in agp_gen5_adjust_pgtbl_size()
1137 bus_write_4(sc->sc_res[0], AGP_I965_PGTBL_CTL2, pgetbl_ctl2); in agp_gen5_adjust_pgtbl_size()
[all …]
/freebsd/sys/dev/stge/
H A Dif_stgereg.h90 bus_write_4((_sc)->sc_res[0], (reg), (val))
92 bus_write_2((_sc)->sc_res[0], (reg), (val))
94 bus_write_1((_sc)->sc_res[0], (reg), (val))
97 bus_read_4((_sc)->sc_res[0], (reg))
99 bus_read_2((_sc)->sc_res[0], (reg))
101 bus_read_1((_sc)->sc_res[0], (reg))
104 bus_barrier((_sc)->sc_res[0], reg, length, flags)
634 struct resource *sc_res[2]; member
/freebsd/sys/arm64/arm64/
H A Dcmn600.c51 #define RD4(sc, r) bus_read_4((sc)->sc_res[0], (r))
52 #define RD8(sc, r) bus_read_8((sc)->sc_res[0], (r))
53 #define WR4(sc, r, v) bus_write_4((sc)->sc_res[0], (r), (v))
54 #define WR8(sc, r, v) bus_write_8((sc)->sc_res[0], (r), (v))
100 struct resource *sc_res[3]; member
687 i = bus_alloc_resources(dev, cmn600_res_spec, sc->sc_res); in cmn600_acpi_attach()
721 if (bus_setup_intr(dev, sc->sc_res[2], INTR_TYPE_MISC | INTR_MPSAFE, in cmn600_acpi_attach()
723 bus_release_resources(dev, cmn600_res_spec, sc->sc_res); in cmn600_acpi_attach()
728 if (bus_bind_intr(dev, sc->sc_res[2], cpu)) { in cmn600_acpi_attach()
729 bus_teardown_intr(dev, sc->sc_res[2], sc->sc_ih); in cmn600_acpi_attach()
[all …]
/freebsd/sys/dev/dpaa/
H A Dfman_mdio.c55 bus_write_4(sc->sc_res, r, v)
57 bus_read_4(sc->sc_res, r)
77 struct resource *sc_res; member
126 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, 0, RF_ACTIVE); in pqmdio_fdt_attach()
H A Dfman_xmdio.c37 bus_write_4(sc->sc_res, r, v)
39 bus_read_4(sc->sc_res, r)
62 struct resource *sc_res; member
125 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, 0, RF_ACTIVE); in xmdio_fdt_attach()
/freebsd/sys/dev/cesa/
H A Dcesa.h92 bus_read_4((sc)->sc_res[RES_CESA_REGS], (reg))
94 bus_write_4((sc)->sc_res[RES_CESA_REGS], (reg), (val))
97 bus_read_4((sc)->sc_res[RES_TDMA_REGS], (reg))
99 bus_write_4((sc)->sc_res[RES_TDMA_REGS], (reg), (val))
226 struct resource *sc_res[RES_CESA_NUM]; member
/freebsd/sys/dev/etherswitch/mtkswitch/
H A Dmtkswitchvar.h59 struct resource *sc_res; member
129 bus_read_4((_sc)->sc_res, (_reg))
131 bus_write_4((_sc)->sc_res, (_reg), (_val))
/freebsd/sys/arm/allwinner/
H A Da10_dmac.c72 struct resource * sc_res[2]; member
86 #define DMA_READ(sc, reg) bus_read_4((sc)->sc_res[0], (reg))
87 #define DMA_WRITE(sc, reg, val) bus_write_4((sc)->sc_res[0], (reg), (val))
118 if (bus_alloc_resources(dev, a10dmac_spec, sc->sc_res)) { in a10dmac_attach()
161 error = bus_setup_intr(dev, sc->sc_res[1], INTR_MPSAFE | INTR_TYPE_MISC, in a10dmac_attach()
165 bus_release_resources(dev, a10dmac_spec, sc->sc_res); in a10dmac_attach()
/freebsd/sys/dev/cas/
H A Dif_casvar.h143 struct resource *sc_res[2]; member
201 bus_barrier((sc)->sc_res[CAS_RES_MEM], (offs), (len), (flags))
204 bus_read_ ## n((sc)->sc_res[CAS_RES_MEM], (offs))
210 bus_write_ ## n((sc)->sc_res[CAS_RES_MEM], (offs), (v))
/freebsd/sys/dev/cfi/
H A Dcfi_core.c206 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, in cfi_probe()
208 if (sc->sc_res == NULL) in cfi_probe()
211 sc->sc_tag = rman_get_bustag(sc->sc_res); in cfi_probe()
212 sc->sc_handle = rman_get_bushandle(sc->sc_res); in cfi_probe()
284 bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); in cfi_probe()
304 sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, in cfi_attach()
310 if (sc->sc_res == NULL) in cfi_attach()
313 sc->sc_tag = rman_get_bustag(sc->sc_res); in cfi_attach()
314 sc->sc_handle = rman_get_bushandle(sc->sc_res); in cfi_attach()
502 bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_rid, sc->sc_res); in cfi_detach()
/freebsd/sys/arm64/apple/
H A Dapple_pinctrl.c64 bus_read_4((sc)->sc_res[APPLE_PINCTRL_MEMRES], reg)
66 bus_write_4((sc)->sc_res[APPLE_PINCTRL_MEMRES], reg, val)
91 struct resource *sc_res[APPLE_PINCTRL_NRES]; member
144 if (bus_alloc_resources(dev, apple_pinctrl_res_spec, sc->sc_res) != 0) { in apple_pinctrl_attach()
184 bus_release_resources(dev, apple_pinctrl_res_spec, sc->sc_res); in apple_pinctrl_attach()
/freebsd/sys/arm/ti/
H A Dti_pinmux.c416 if (bus_alloc_resources(dev, ti_pinmux_res_spec, sc->sc_res)) { in ti_pinmux_attach()
421 sc->sc_bst = rman_get_bustag(sc->sc_res[0]); in ti_pinmux_attach()
422 sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); in ti_pinmux_attach()
/freebsd/sys/arm/broadcom/bcm2835/
H A Dbcm2835_gpio.c115 struct resource * sc_res[BCM_GPIO_IRQS + 1]; member
758 if (sc->sc_res[1] == NULL || sc->sc_res[2] == NULL) in bcm_gpio_intr_attach()
765 if (bus_setup_intr(dev, sc->sc_res[1], INTR_TYPE_MISC | INTR_MPSAFE, in bcm_gpio_intr_attach()
768 if (bus_setup_intr(dev, sc->sc_res[2], INTR_TYPE_MISC | INTR_MPSAFE, in bcm_gpio_intr_attach()
782 bus_teardown_intr(dev, sc->sc_res[1], sc->sc_intrhand[0]); in bcm_gpio_intr_detach()
784 bus_teardown_intr(dev, sc->sc_res[2], sc->sc_intrhand[1]); in bcm_gpio_intr_detach()
803 if (bus_alloc_resources(dev, bcm_gpio_res_spec, sc->sc_res) != 0) { in bcm_gpio_attach()
807 sc->sc_bst = rman_get_bustag(sc->sc_res[0]); in bcm_gpio_attach()
808 sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); in bcm_gpio_attach()
852 bus_release_resources(dev, bcm_gpio_res_spec, sc->sc_res); in bcm_gpio_attach()
/freebsd/sys/dev/safexcel/
H A Dsafexcel_var.h407 struct resource *sc_res; member
422 #define SAFEXCEL_WRITE(sc, off, val) bus_write_4((sc)->sc_res, (off), (val))
423 #define SAFEXCEL_READ(sc, off) bus_read_4((sc)->sc_res, (off))
/freebsd/sys/arm64/rockchip/
H A Drk_gpio.c102 struct resource *sc_res[2]; member
282 if (bus_alloc_resources(dev, rk_gpio_spec, sc->sc_res)) { in rk_gpio_attach()
284 bus_release_resources(dev, rk_gpio_spec, sc->sc_res); in rk_gpio_attach()
289 sc->sc_bst = rman_get_bustag(sc->sc_res[0]); in rk_gpio_attach()
290 sc->sc_bsh = rman_get_bushandle(sc->sc_res[0]); in rk_gpio_attach()
305 if ((err = bus_setup_intr(dev, sc->sc_res[1], in rk_gpio_attach()
402 bus_release_resources(dev, rk_gpio_spec, sc->sc_res); in rk_gpio_detach()

12