162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci
662306a36Sopenharmony_ci#ifndef K3_PSIL_PRIV_H_
762306a36Sopenharmony_ci#define K3_PSIL_PRIV_H_
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/dma/k3-psil.h>
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_cistruct psil_ep {
1262306a36Sopenharmony_ci	u32 thread_id;
1362306a36Sopenharmony_ci	struct psil_endpoint_config ep_config;
1462306a36Sopenharmony_ci};
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci/**
1762306a36Sopenharmony_ci * struct psil_ep_map - PSI-L thread ID configuration maps
1862306a36Sopenharmony_ci * @name:	Name of the map, set it to the name of the SoC
1962306a36Sopenharmony_ci * @src:	Array of source PSI-L thread configurations
2062306a36Sopenharmony_ci * @src_count:	Number of entries in the src array
2162306a36Sopenharmony_ci * @dst:	Array of destination PSI-L thread configurations
2262306a36Sopenharmony_ci * @dst_count:	Number of entries in the dst array
2362306a36Sopenharmony_ci *
2462306a36Sopenharmony_ci * In case of symmetric configuration for a matching src/dst thread (for example
2562306a36Sopenharmony_ci * 0x4400 and 0xc400) only the src configuration can be present. If no dst
2662306a36Sopenharmony_ci * configuration found the code will look for (dst_thread_id & ~0x8000) to find
2762306a36Sopenharmony_ci * the symmetric match.
2862306a36Sopenharmony_ci */
2962306a36Sopenharmony_cistruct psil_ep_map {
3062306a36Sopenharmony_ci	char *name;
3162306a36Sopenharmony_ci	struct psil_ep	*src;
3262306a36Sopenharmony_ci	int src_count;
3362306a36Sopenharmony_ci	struct psil_ep	*dst;
3462306a36Sopenharmony_ci	int dst_count;
3562306a36Sopenharmony_ci};
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_cistruct psil_endpoint_config *psil_get_ep_config(u32 thread_id);
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* SoC PSI-L endpoint maps */
4062306a36Sopenharmony_ciextern struct psil_ep_map am654_ep_map;
4162306a36Sopenharmony_ciextern struct psil_ep_map j721e_ep_map;
4262306a36Sopenharmony_ciextern struct psil_ep_map j7200_ep_map;
4362306a36Sopenharmony_ciextern struct psil_ep_map am64_ep_map;
4462306a36Sopenharmony_ciextern struct psil_ep_map j721s2_ep_map;
4562306a36Sopenharmony_ciextern struct psil_ep_map am62_ep_map;
4662306a36Sopenharmony_ciextern struct psil_ep_map am62a_ep_map;
4762306a36Sopenharmony_ciextern struct psil_ep_map j784s4_ep_map;
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#endif /* K3_PSIL_PRIV_H_ */
50