aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/xdma
Commit message (Collapse)AuthorAgeFilesLines
* xdma: Use proper prototype for SYSINIT functionsZhenlei Huang2025-10-131-1/+1
| | | | MFC after: 1 week
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1610-20/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Fix xdma_if.m in an ACPI only kernelAndrew Turner2022-10-271-0/+4
| | | | | | | | - We depend on header polution to include sys/malloc.h. Include it directly. - Only define FDT-specific fuctions when building a FDT kernel. Sponsored by: Innovate UK
* Include opt_platform.h to ensure FDT is definedAndrew Turner2022-10-041-0/+2
| | | | | | We need to include opt_platform.h as it's where FDT will be defined. Sponsored by: The FreeBSD Foundation
* xdma: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-102-6/+2
|
* xdma: Inline variables with simple values used once in a KASSERT().John Baldwin2022-04-133-15/+5
|
* xdma pl330: Remove unused variables.John Baldwin2022-04-131-17/+0
|
* xdma: Fix another -Wunused-but-set-variable warning previously missedJessica Clarke2021-12-101-3/+0
| | | | MFC after: 1 week
* xdma: Fix -Wunused-but-set-variable warningsJessica Clarke2021-12-102-14/+0
| | | | MFC after: 1 week
* Enter the network epoch in the xdma interrupt handler if requiredRuslan Bukin2020-02-083-5/+16
| | | | | | | | | by a peripheral device driver. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=357686
* Fix a KASSERT since chained mbufs are accepted by the xdma bounceRuslan Bukin2020-02-081-1/+1
| | | | | | | | | buffer loader. m_copydata() will copy entire chain to a single buffer. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=357682
* Fix xae(4) driver attachement on the Government Furnished Equipment (GFE)Ruslan Bukin2020-02-072-0/+19
| | | | | | | | | | | | | | | | | | | | | riscv cores. GFE cores come with standard DTS file that lacks standard 'dmas =' property, which means xae(4) could not find a DMA controller to use. The 'dmas' property could not be added to the DTS file because the ethernet controller and DMA engine parts in Linux are implemented in a single driver. Instead of 'dmas' property the standard Xilinx 'axistream-connected' property is provided, so fallback to use it instead. Suggested by: James Clarke <jrtc27@jrtc27.com> Reviewed by: James Clarke <jrtc27@jrtc27.com> Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=357653
* xdma: avoid NULL deref in error caseEd Maste2019-08-301-2/+1
| | | | | | | | | Reported by: Dr Silvio Cesare of InfoSect MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=351621
* Remove unused header.Ruslan Bukin2019-07-221-1/+0
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350213
* o Add support for BERI IOMMU deviceRuslan Bukin2019-07-225-2/+321
| | | | | | | | | | | | | | | | o Add an experimental IOMMU support to xDMA framework The BERI IOMMU device is the part of CHERI device-model project [1]. It translates memory addresses for various BERI peripherals modelled in software. It accepts FreeBSD/mips64 page directories format and manages BERI TLB. 1. https://github.com/CTSRD-CHERI/device-model Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=350212
* Fix transfers that don't use busdma or bounce buffer (e.g. software dmas).Ruslan Bukin2019-07-041-4/+3
| | | | | | | | | Busdma data loaded by different function (the bug introduced in r349727). Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=349732
* Negate the logic of XCHAN_CAP_NOBUFS macro and rename it toRuslan Bukin2019-07-042-9/+9
| | | | | | | | | | | | | XCHAN_CAP_BOUNCE. The only application that uses bounce buffering for now is the Government Furnished Equipment (GFE) P2's dma core (AXIDMA) with its own dedicated cacheless bounce buffer. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=349727
* Don't copy the data from bounce buffer back to the mbuf if channel doesRuslan Bukin2019-05-291-1/+2
| | | | | | | | | not use bounce buffering. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=348364
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-206-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* xdma(4): Fix invalid pointer use (breaks arm.SOCFPGA build)Conrad Meyer2019-05-161-2/+1
| | | | | | | | | | | | In xdma_handle_mem_node(), vmem_size_t and vmem_addr_t pointers were passed to an FDT API that emits u_long values to the output parameter pointer. This broke on systems with both xdma and 32-bit vmem size/addr types (SOCFPGA). Reported by: tinderbox Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=347828
* o Implement a bounce buffer based on device reserved memory.Ruslan Bukin2019-05-087-64/+221
| | | | | | | | | | | | | | | | | | | Grab device reserved physical memory regions from FDT using standard "memory-region" property and use vmem(9) to allocate buffers from it. The same vmem could be used by DMA engine drivers to allocate memory for DMA descriptors. This is required for platforms that provide uncached memory region reserved exclusively for DMA operations. o Change sleepable sx(9) lock type to non-sleepable mutex(9) since network drivers usually hold mutex during DMA operations. So we don't take sleepable lock after non-sleepable. Tested on U.S. Government Furnished Equipment (GFE) 64-bit RISC-V cores. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=347337
* o Rewrite softdma_process_tx() of Altera SoftDMA engine driverRuslan Bukin2019-04-293-42/+30
| | | | | | | | | | | | | | so it does not require a bounce buffer. The only need for this was to align the buffer address. Implement unaligned access and we don't need to copy data twice. o Remove contigmalloc-based bounce buffer from xDMA code since it is not suitable for arbitrary memory provided by platform, which is sometimes a dedicated piece of memory that is not managed by OS at all. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=346896
* Eliminate kmem_alloc_contig()'s unused arena parameter.Alan Cox2018-08-201-2/+2
| | | | | | | | | Reviewed by: hselasky, kib, markj Discussed with: jeff Differential Revision: https://reviews.freebsd.org/D16799 Notes: svn path=/head/; revision=338107
* Add driver for ARM PrimeCell PL330 DMA engine.Ruslan Bukin2018-04-132-0/+778
| | | | | | | | Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D10201 Notes: svn path=/head/; revision=332469
* Don't include sys/bus_dma.h directly, use machine/bus.h instead.Ruslan Bukin2018-04-133-3/+4
| | | | | | | Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=332468
* Tune xDMA interface slightly:Ruslan Bukin2018-04-1210-384/+1445
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Move descriptors allocation to DMA engine driver o Add generic xdma_request() routine o Add less-generic scatter-gather application based on xdma interface Typical operation flow in peripheral device driver is: 1. Get xDMA controller sc->xdma_tx = xdma_ofw_get(sc->dev, "tx"); 2. Allocate virtual channel sc->xchan_tx = xdma_channel_alloc(sc->xdma_tx, caps); 3. Setup transfer status callback xdma_setup_intr(sc->xchan_tx, my_tx_intr, sc, &sc->ih_tx); 4. Request a transfer(s) ret = xdma_request(sc->xchan_tx, &req); 5. Free the channel xdma_channel_free(sc->xdma_tx); 6. Free the controller xdma_put(sc->xdma_tx); Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14971 Notes: svn path=/head/; revision=332435
* Clean up MD pollution of bus_dma.h:Jason A. Harmening2017-07-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --Remove special-case handling of sparc64 bus_dmamap* functions. Replace with a more generic mechanism that allows MD busdma implementations to generate inline mapping functions by defining WANT_INLINE_DMAMAP in <machine/bus_dma.h>. This is currently useful for sparc64, x86, and arm64, which all implement non-load dmamap operations as simple wrappers around map objects which may be bus- or device-specific. --Remove NULL-checked bus_dmamap macros. Implement the equivalent NULL checks in the inlined x86 implementation. For non-x86 platforms, these checks are a minor pessimization as those platforms do not currently allow NULL maps. NULL maps were originally allowed on arm64, which appears to have been the motivation behind adding arm[64]-specific barriers to bus_dma.h, but that support was removed in r299463. --Simplify the internal interface used by the bus_dmamap_load* variants and move it to bus_dma_internal.h --Fix some drivers that directly include sys/bus_dma.h despite the recommendations of bus_dma(9) Reviewed by: kib (previous revision), marius Differential Revision: https://reviews.freebsd.org/D10729 Notes: svn path=/head/; revision=320528
* Add parenthesis.Ruslan Bukin2016-12-301-3/+3
| | | | | | | | Noticed by: hps Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=310828
* o Fix unlocking.Ruslan Bukin2016-12-302-4/+5
| | | | | | | | | o Fix types for ds_addr/ds_len. Sponsored by: DARPA, AFRL Notes: svn path=/head/; revision=310824
* Add xDMA -- the DMA abstraction layer, initial verison.Ruslan Bukin2016-12-204-0/+1332
xDMA is a DMA framework designed to abstract the interaction between device drivers and DMA engines. Project wiki: https://wiki.freebsd.org/xdma Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8807 Notes: svn path=/head/; revision=310330