drivers/dma/ti/k3-psil-am654.c

Source file repositories/reference/linux-study-clean/drivers/dma/ti/k3-psil-am654.c

File Facts

System
Linux kernel
Corpus path
drivers/dma/ti/k3-psil-am654.c
Extension
.c
Size
4049 bytes
Lines
176
Domain
Driver Families
Bucket
drivers/dma
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

// SPDX-License-Identifier: GPL-2.0
/*
 *  Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
 *  Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
 */

#include <linux/kernel.h>

#include "k3-psil-priv.h"

#define PSIL_PDMA_XY_TR(x)				\
	{						\
		.thread_id = x,				\
		.ep_config = {				\
			.ep_type = PSIL_EP_PDMA_XY,	\
		},					\
	}

#define PSIL_PDMA_XY_PKT(x)				\
	{						\
		.thread_id = x,				\
		.ep_config = {				\
			.ep_type = PSIL_EP_PDMA_XY,	\
			.pkt_mode = 1,			\
		},					\
	}

#define PSIL_ETHERNET(x)				\
	{						\
		.thread_id = x,				\
		.ep_config = {				\
			.ep_type = PSIL_EP_NATIVE,	\
			.pkt_mode = 1,			\
			.needs_epib = 1,		\
			.psd_size = 16,			\
		},					\
	}

#define PSIL_SA2UL(x, tx)				\
	{						\
		.thread_id = x,				\
		.ep_config = {				\
			.ep_type = PSIL_EP_NATIVE,	\
			.pkt_mode = 1,			\
			.needs_epib = 1,		\
			.psd_size = 64,			\
			.notdpkt = tx,			\
		},					\
	}

/* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */
static struct psil_ep am654_src_ep_map[] = {
	/* SA2UL */
	PSIL_SA2UL(0x4000, 0),
	PSIL_SA2UL(0x4001, 0),
	PSIL_SA2UL(0x4002, 0),
	PSIL_SA2UL(0x4003, 0),
	/* PRU_ICSSG0 */
	PSIL_ETHERNET(0x4100),
	PSIL_ETHERNET(0x4101),
	PSIL_ETHERNET(0x4102),
	PSIL_ETHERNET(0x4103),
	/* PRU_ICSSG1 */
	PSIL_ETHERNET(0x4200),
	PSIL_ETHERNET(0x4201),
	PSIL_ETHERNET(0x4202),
	PSIL_ETHERNET(0x4203),
	/* PRU_ICSSG2 */
	PSIL_ETHERNET(0x4300),
	PSIL_ETHERNET(0x4301),
	PSIL_ETHERNET(0x4302),
	PSIL_ETHERNET(0x4303),
	/* PDMA0 - McASPs */
	PSIL_PDMA_XY_TR(0x4400),
	PSIL_PDMA_XY_TR(0x4401),
	PSIL_PDMA_XY_TR(0x4402),
	/* PDMA1 - SPI0-4 */
	PSIL_PDMA_XY_PKT(0x4500),
	PSIL_PDMA_XY_PKT(0x4501),
	PSIL_PDMA_XY_PKT(0x4502),
	PSIL_PDMA_XY_PKT(0x4503),
	PSIL_PDMA_XY_PKT(0x4504),
	PSIL_PDMA_XY_PKT(0x4505),
	PSIL_PDMA_XY_PKT(0x4506),
	PSIL_PDMA_XY_PKT(0x4507),
	PSIL_PDMA_XY_PKT(0x4508),
	PSIL_PDMA_XY_PKT(0x4509),
	PSIL_PDMA_XY_PKT(0x450a),
	PSIL_PDMA_XY_PKT(0x450b),
	PSIL_PDMA_XY_PKT(0x450c),

Annotation

Implementation Notes