linux-stable/include/linux/platform_data/amd_xdma.h
Lizhi Hou 17ce252266 dmaengine: xilinx: xdma: Add xilinx xdma driver
Add driver to enable PCIe board which uses XDMA (the DMA/Bridge Subsystem
for PCI Express). For example, Xilinx Alveo PCIe devices.
    https://www.xilinx.com/products/boards-and-kits/alveo.html

The XDMA engine support up to 4 Host to Card (H2C) and 4 Card to Host (C2H)
channels. Memory transfers are specified on a per-channel basis in
descriptor linked lists, which the DMA fetches from host memory and
processes. Events such as descriptor completion and errors are signaled
using interrupts. The hardware detail is provided by
    https://docs.xilinx.com/r/en-US/pg195-pcie-dma/Introduction

This driver implements dmaengine APIs.
    - probe the available DMA channels
    - use dma_slave_map for channel lookup
    - use virtual channel to manage dmaengine tx descriptors
    - implement device_prep_slave_sg callback to handle host scatter gather
      list
    - implement device_config to config device address for DMA transfer

Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Sonal Santan <sonal.santan@amd.com>
Signed-off-by: Max Zhen <max.zhen@amd.com>
Signed-off-by: Brian Xu <brian.xu@amd.com>
Tested-by: Martin Tuma <tumic@gpxsee.org>
Link: https://lore.kernel.org/r/1674145926-29449-2-git-send-email-lizhi.hou@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2023-02-10 11:32:26 +05:30

34 lines
781 B
C

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (C) 2022, Advanced Micro Devices, Inc.
*/
#ifndef _PLATDATA_AMD_XDMA_H
#define _PLATDATA_AMD_XDMA_H
#include <linux/dmaengine.h>
/**
* struct xdma_chan_info - DMA channel information
* This information is used to match channel when request dma channel
* @dir: Channel transfer direction
*/
struct xdma_chan_info {
enum dma_transfer_direction dir;
};
#define XDMA_FILTER_PARAM(chan_info) ((void *)(chan_info))
struct dma_slave_map;
/**
* struct xdma_platdata - platform specific data for XDMA engine
* @max_dma_channels: Maximum dma channels in each direction
*/
struct xdma_platdata {
u32 max_dma_channels;
u32 device_map_cnt;
struct dma_slave_map *device_map;
};
#endif /* _PLATDATA_AMD_XDMA_H */