Lines Matching +full:use +full:- +full:dma +full:- +full:rx

1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
3 * Copyright (c) 2014-2025, Advanced Micro Devices, Inc.
11 #include <linux/dma-mapping.h>
28 #define XGBE_DRV_NAME "amd-xgbe"
42 #define XGBE_TX_MAX_BUF_SIZE (0x3fff & ~(64 - 1))
49 * - Maximum number of SKB frags
50 * - Maximum descriptors for contiguous TSO/GSO packet
51 * - Possible context descriptor
52 * - Possible TSO header descriptor
66 /* DMA cache settings - Outer sharable, write-back, write-allocate */
70 /* DMA cache settings - System, no caches used */
74 /* DMA cache settings - PCI device */
79 /* DMA channel interrupt modes */
90 #define XGMAC_ETH_PREAMBLE (12 + 8) /* Inter-frame gap + preamble */
99 #define XGBE_MAC_ADDR_PROPERTY "mac-address"
100 #define XGBE_PHY_MODE_PROPERTY "phy-mode"
101 #define XGBE_DMA_IRQS_PROPERTY "amd,per-channel-interrupt"
102 #define XGBE_SPEEDSET_PROPERTY "amd,speed-set"
104 /* Device-tree clock names */
109 #define XGBE_ACPI_DMA_FREQ "amd,dma-freq"
110 #define XGBE_ACPI_PTP_FREQ "amd,ptp-freq"
134 /* Timestamp support - values based on 50MHz PTP clock
152 (((_x) + XGMAC_FIFO_UNIT - 1) & ~(XGMAC_FIFO_UNIT - 1))
159 * Always use XGBE_GET_DESC_DATA to access the descriptor data
160 * since the index is free-running and needs to be and-ed
165 ((_ring)->rdata + \
166 ((_idx) & ((_ring)->rdesc_count - 1)))
182 (((_x) + XGMAC_FLOW_CONTROL_UNIT - 1) & ~(XGMAC_FLOW_CONTROL_UNIT - 1))
184 (((_x) < 1024) ? 0 : ((_x) / XGMAC_FLOW_CONTROL_UNIT) - 2)
196 /* Auto-negotiation */
252 bitmap_copy((_dst)->link_modes._dname, \
253 (_src)->link_modes._sname, \
293 /* Common Rx and Tx descriptor mapping */
320 /* Tx-related ring data */
326 /* Rx-related ring data */
336 * and the packet associated with the descriptor (always use
341 dma_addr_t rdesc_dma; /* DMA address of descriptor */
344 dma_addr_t skb_dma; /* DMA address of SKB data */
345 unsigned int skb_dma_len; /* Length of SKB DMA area */
347 struct xgbe_tx_ring_data tx; /* Tx-related data */
348 struct xgbe_rx_ring_data rx; /* Rx-related data */ member
354 * context descriptor) has not been DMA'd yet the current state
366 /* Ring lock - used just for TX rings at the moment */
372 /* Virtual/DMA addresses and count of allocated descriptor memory */
378 * (always use the XGBE_GET_DESC_DATA macro to access this data)
382 /* Page allocation for RX buffers */
388 * cur - Tx: index of descriptor to be used for current transfer
389 * Rx: index of descriptor to check for packet availability
390 * dirty - Tx: index of descriptor to check for transfer complete
391 * Rx: index of descriptor to check for buffer reallocation
410 * a DMA channel.
418 /* Queue index and base address of queue's DMA registers */
633 /* Rx Stats */
735 /* For RX coalescing */
741 /* For RX and TX threshold config */
745 /* For RX and TX Store and Forward Mode config */
749 /* For TX DMA Operate on Second Frame config */
811 /* Retrieve new/next mode when trying to auto-negotiate */
816 /* Retrieve current auto-negotiation mode */
819 /* Configure auto-negotiation settings */
822 /* Set/override auto-negotiation advertisement settings */
826 /* Process results of auto-negotiation */
829 /* Pre/Post auto-negotiation support */
911 unsigned int rwk; /* PMT remote wake-up packet */
915 unsigned int ts; /* IEEE 1588-2008 Advanced Timestamp */
918 unsigned int rx_coe; /* Rx Checksum Offload */
928 unsigned int dma_width; /* DMA width */
932 unsigned int dma_debug; /* DMA Debug Registers */
936 unsigned int l3l4_filter_num; /* Number of L3-L4 Filters */
941 unsigned int rx_ch_cnt; /* Number of DMA Receive Channels */
942 unsigned int tx_ch_cnt; /* Number of DMA Transmit Channels */
983 void __iomem *rxtx_regs; /* SerDes Rx/Tx CSRs */
1045 /* AXI DMA settings */
1056 /* Rings for Tx/Rx on a DMA channel */
1074 /* Tx/Rx common settings */
1087 /* Rx settings */
1096 /* Rx coalescing settings */
1101 /* Current Rx buffer size */
1188 /* Auto-negotiation state machine support */