18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright 2013-2016 Freescale Semiconductor Inc.
48c2ecf20Sopenharmony_ci * Copyright 2017-2018 NXP
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef _DPSECI_H_
78c2ecf20Sopenharmony_ci#define _DPSECI_H_
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci/*
108c2ecf20Sopenharmony_ci * Data Path SEC Interface API
118c2ecf20Sopenharmony_ci * Contains initialization APIs and runtime control APIs for DPSECI
128c2ecf20Sopenharmony_ci */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cistruct fsl_mc_io;
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/**
178c2ecf20Sopenharmony_ci * General DPSECI macros
188c2ecf20Sopenharmony_ci */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci/**
218c2ecf20Sopenharmony_ci * Maximum number of Tx/Rx queues per DPSECI object
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_ci#define DPSECI_MAX_QUEUE_NUM		16
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/**
268c2ecf20Sopenharmony_ci * All queues considered; see dpseci_set_rx_queue()
278c2ecf20Sopenharmony_ci */
288c2ecf20Sopenharmony_ci#define DPSECI_ALL_QUEUES	(u8)(-1)
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciint dpseci_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpseci_id,
318c2ecf20Sopenharmony_ci		u16 *token);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciint dpseci_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/**
368c2ecf20Sopenharmony_ci * Enable the Congestion Group support
378c2ecf20Sopenharmony_ci */
388c2ecf20Sopenharmony_ci#define DPSECI_OPT_HAS_CG		0x000020
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/**
418c2ecf20Sopenharmony_ci * struct dpseci_cfg - Structure representing DPSECI configuration
428c2ecf20Sopenharmony_ci * @options: Any combination of the following flags:
438c2ecf20Sopenharmony_ci *		DPSECI_OPT_HAS_CG
448c2ecf20Sopenharmony_ci * @num_tx_queues: num of queues towards the SEC
458c2ecf20Sopenharmony_ci * @num_rx_queues: num of queues back from the SEC
468c2ecf20Sopenharmony_ci * @priorities: Priorities for the SEC hardware processing;
478c2ecf20Sopenharmony_ci *		each place in the array is the priority of the tx queue
488c2ecf20Sopenharmony_ci *		towards the SEC;
498c2ecf20Sopenharmony_ci *		valid priorities are configured with values 1-8;
508c2ecf20Sopenharmony_ci */
518c2ecf20Sopenharmony_cistruct dpseci_cfg {
528c2ecf20Sopenharmony_ci	u32 options;
538c2ecf20Sopenharmony_ci	u8 num_tx_queues;
548c2ecf20Sopenharmony_ci	u8 num_rx_queues;
558c2ecf20Sopenharmony_ci	u8 priorities[DPSECI_MAX_QUEUE_NUM];
568c2ecf20Sopenharmony_ci};
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ciint dpseci_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ciint dpseci_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciint dpseci_reset(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ciint dpseci_is_enabled(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
658c2ecf20Sopenharmony_ci		      int *en);
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/**
688c2ecf20Sopenharmony_ci * struct dpseci_attr - Structure representing DPSECI attributes
698c2ecf20Sopenharmony_ci * @id: DPSECI object ID
708c2ecf20Sopenharmony_ci * @num_tx_queues: number of queues towards the SEC
718c2ecf20Sopenharmony_ci * @num_rx_queues: number of queues back from the SEC
728c2ecf20Sopenharmony_ci * @options: any combination of the following flags:
738c2ecf20Sopenharmony_ci *		DPSECI_OPT_HAS_CG
748c2ecf20Sopenharmony_ci */
758c2ecf20Sopenharmony_cistruct dpseci_attr {
768c2ecf20Sopenharmony_ci	int id;
778c2ecf20Sopenharmony_ci	u8 num_tx_queues;
788c2ecf20Sopenharmony_ci	u8 num_rx_queues;
798c2ecf20Sopenharmony_ci	u32 options;
808c2ecf20Sopenharmony_ci};
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ciint dpseci_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
838c2ecf20Sopenharmony_ci			  struct dpseci_attr *attr);
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci/**
868c2ecf20Sopenharmony_ci * enum dpseci_dest - DPSECI destination types
878c2ecf20Sopenharmony_ci * @DPSECI_DEST_NONE: Unassigned destination; The queue is set in parked mode
888c2ecf20Sopenharmony_ci *	and does not generate FQDAN notifications; user is expected to dequeue
898c2ecf20Sopenharmony_ci *	from the queue based on polling or other user-defined method
908c2ecf20Sopenharmony_ci * @DPSECI_DEST_DPIO: The queue is set in schedule mode and generates FQDAN
918c2ecf20Sopenharmony_ci *	notifications to the specified DPIO; user is expected to dequeue from
928c2ecf20Sopenharmony_ci *	the queue only after notification is received
938c2ecf20Sopenharmony_ci * @DPSECI_DEST_DPCON: The queue is set in schedule mode and does not generate
948c2ecf20Sopenharmony_ci *	FQDAN notifications, but is connected to the specified DPCON object;
958c2ecf20Sopenharmony_ci *	user is expected to dequeue from the DPCON channel
968c2ecf20Sopenharmony_ci */
978c2ecf20Sopenharmony_cienum dpseci_dest {
988c2ecf20Sopenharmony_ci	DPSECI_DEST_NONE = 0,
998c2ecf20Sopenharmony_ci	DPSECI_DEST_DPIO,
1008c2ecf20Sopenharmony_ci	DPSECI_DEST_DPCON
1018c2ecf20Sopenharmony_ci};
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ci/**
1048c2ecf20Sopenharmony_ci * struct dpseci_dest_cfg - Structure representing DPSECI destination parameters
1058c2ecf20Sopenharmony_ci * @dest_type: Destination type
1068c2ecf20Sopenharmony_ci * @dest_id: Either DPIO ID or DPCON ID, depending on the destination type
1078c2ecf20Sopenharmony_ci * @priority: Priority selection within the DPIO or DPCON channel; valid values
1088c2ecf20Sopenharmony_ci *	are 0-1 or 0-7, depending on the number of priorities in that channel;
1098c2ecf20Sopenharmony_ci *	not relevant for 'DPSECI_DEST_NONE' option
1108c2ecf20Sopenharmony_ci */
1118c2ecf20Sopenharmony_cistruct dpseci_dest_cfg {
1128c2ecf20Sopenharmony_ci	enum dpseci_dest dest_type;
1138c2ecf20Sopenharmony_ci	int dest_id;
1148c2ecf20Sopenharmony_ci	u8 priority;
1158c2ecf20Sopenharmony_ci};
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci/**
1188c2ecf20Sopenharmony_ci * DPSECI queue modification options
1198c2ecf20Sopenharmony_ci */
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_ci/**
1228c2ecf20Sopenharmony_ci * Select to modify the user's context associated with the queue
1238c2ecf20Sopenharmony_ci */
1248c2ecf20Sopenharmony_ci#define DPSECI_QUEUE_OPT_USER_CTX		0x00000001
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci/**
1278c2ecf20Sopenharmony_ci * Select to modify the queue's destination
1288c2ecf20Sopenharmony_ci */
1298c2ecf20Sopenharmony_ci#define DPSECI_QUEUE_OPT_DEST			0x00000002
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/**
1328c2ecf20Sopenharmony_ci * Select to modify the queue's order preservation
1338c2ecf20Sopenharmony_ci */
1348c2ecf20Sopenharmony_ci#define DPSECI_QUEUE_OPT_ORDER_PRESERVATION	0x00000004
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci/**
1378c2ecf20Sopenharmony_ci * struct dpseci_rx_queue_cfg - DPSECI RX queue configuration
1388c2ecf20Sopenharmony_ci * @options: Flags representing the suggested modifications to the queue;
1398c2ecf20Sopenharmony_ci *	Use any combination of 'DPSECI_QUEUE_OPT_<X>' flags
1408c2ecf20Sopenharmony_ci * @order_preservation_en: order preservation configuration for the rx queue
1418c2ecf20Sopenharmony_ci * valid only if 'DPSECI_QUEUE_OPT_ORDER_PRESERVATION' is contained in 'options'
1428c2ecf20Sopenharmony_ci * @user_ctx: User context value provided in the frame descriptor of each
1438c2ecf20Sopenharmony_ci *	dequeued frame;	valid only if 'DPSECI_QUEUE_OPT_USER_CTX' is contained
1448c2ecf20Sopenharmony_ci *	in 'options'
1458c2ecf20Sopenharmony_ci * @dest_cfg: Queue destination parameters; valid only if
1468c2ecf20Sopenharmony_ci *	'DPSECI_QUEUE_OPT_DEST' is contained in 'options'
1478c2ecf20Sopenharmony_ci */
1488c2ecf20Sopenharmony_cistruct dpseci_rx_queue_cfg {
1498c2ecf20Sopenharmony_ci	u32 options;
1508c2ecf20Sopenharmony_ci	int order_preservation_en;
1518c2ecf20Sopenharmony_ci	u64 user_ctx;
1528c2ecf20Sopenharmony_ci	struct dpseci_dest_cfg dest_cfg;
1538c2ecf20Sopenharmony_ci};
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ciint dpseci_set_rx_queue(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
1568c2ecf20Sopenharmony_ci			u8 queue, const struct dpseci_rx_queue_cfg *cfg);
1578c2ecf20Sopenharmony_ci
1588c2ecf20Sopenharmony_ci/**
1598c2ecf20Sopenharmony_ci * struct dpseci_rx_queue_attr - Structure representing attributes of Rx queues
1608c2ecf20Sopenharmony_ci * @user_ctx: User context value provided in the frame descriptor of each
1618c2ecf20Sopenharmony_ci *	dequeued frame
1628c2ecf20Sopenharmony_ci * @order_preservation_en: Status of the order preservation configuration on the
1638c2ecf20Sopenharmony_ci *	queue
1648c2ecf20Sopenharmony_ci * @dest_cfg: Queue destination configuration
1658c2ecf20Sopenharmony_ci * @fqid: Virtual FQID value to be used for dequeue operations
1668c2ecf20Sopenharmony_ci */
1678c2ecf20Sopenharmony_cistruct dpseci_rx_queue_attr {
1688c2ecf20Sopenharmony_ci	u64 user_ctx;
1698c2ecf20Sopenharmony_ci	int order_preservation_en;
1708c2ecf20Sopenharmony_ci	struct dpseci_dest_cfg dest_cfg;
1718c2ecf20Sopenharmony_ci	u32 fqid;
1728c2ecf20Sopenharmony_ci};
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ciint dpseci_get_rx_queue(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
1758c2ecf20Sopenharmony_ci			u8 queue, struct dpseci_rx_queue_attr *attr);
1768c2ecf20Sopenharmony_ci
1778c2ecf20Sopenharmony_ci/**
1788c2ecf20Sopenharmony_ci * struct dpseci_tx_queue_attr - Structure representing attributes of Tx queues
1798c2ecf20Sopenharmony_ci * @fqid: Virtual FQID to be used for sending frames to SEC hardware
1808c2ecf20Sopenharmony_ci * @priority: SEC hardware processing priority for the queue
1818c2ecf20Sopenharmony_ci */
1828c2ecf20Sopenharmony_cistruct dpseci_tx_queue_attr {
1838c2ecf20Sopenharmony_ci	u32 fqid;
1848c2ecf20Sopenharmony_ci	u8 priority;
1858c2ecf20Sopenharmony_ci};
1868c2ecf20Sopenharmony_ci
1878c2ecf20Sopenharmony_ciint dpseci_get_tx_queue(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
1888c2ecf20Sopenharmony_ci			u8 queue, struct dpseci_tx_queue_attr *attr);
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci/**
1918c2ecf20Sopenharmony_ci * struct dpseci_sec_attr - Structure representing attributes of the SEC
1928c2ecf20Sopenharmony_ci *	hardware accelerator
1938c2ecf20Sopenharmony_ci * @ip_id: ID for SEC
1948c2ecf20Sopenharmony_ci * @major_rev: Major revision number for SEC
1958c2ecf20Sopenharmony_ci * @minor_rev: Minor revision number for SEC
1968c2ecf20Sopenharmony_ci * @era: SEC Era
1978c2ecf20Sopenharmony_ci * @deco_num: The number of copies of the DECO that are implemented in this
1988c2ecf20Sopenharmony_ci *	version of SEC
1998c2ecf20Sopenharmony_ci * @zuc_auth_acc_num: The number of copies of ZUCA that are implemented in this
2008c2ecf20Sopenharmony_ci *	version of SEC
2018c2ecf20Sopenharmony_ci * @zuc_enc_acc_num: The number of copies of ZUCE that are implemented in this
2028c2ecf20Sopenharmony_ci *	version of SEC
2038c2ecf20Sopenharmony_ci * @snow_f8_acc_num: The number of copies of the SNOW-f8 module that are
2048c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2058c2ecf20Sopenharmony_ci * @snow_f9_acc_num: The number of copies of the SNOW-f9 module that are
2068c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2078c2ecf20Sopenharmony_ci * @crc_acc_num: The number of copies of the CRC module that are implemented in
2088c2ecf20Sopenharmony_ci *	this version of SEC
2098c2ecf20Sopenharmony_ci * @pk_acc_num:  The number of copies of the Public Key module that are
2108c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2118c2ecf20Sopenharmony_ci * @kasumi_acc_num: The number of copies of the Kasumi module that are
2128c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2138c2ecf20Sopenharmony_ci * @rng_acc_num: The number of copies of the Random Number Generator that are
2148c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2158c2ecf20Sopenharmony_ci * @md_acc_num: The number of copies of the MDHA (Hashing module) that are
2168c2ecf20Sopenharmony_ci *	implemented in this version of SEC
2178c2ecf20Sopenharmony_ci * @arc4_acc_num: The number of copies of the ARC4 module that are implemented
2188c2ecf20Sopenharmony_ci *	in this version of SEC
2198c2ecf20Sopenharmony_ci * @des_acc_num: The number of copies of the DES module that are implemented in
2208c2ecf20Sopenharmony_ci *	this version of SEC
2218c2ecf20Sopenharmony_ci * @aes_acc_num: The number of copies of the AES module that are implemented in
2228c2ecf20Sopenharmony_ci *	this version of SEC
2238c2ecf20Sopenharmony_ci * @ccha_acc_num: The number of copies of the ChaCha20 module that are
2248c2ecf20Sopenharmony_ci *	implemented in this version of SEC.
2258c2ecf20Sopenharmony_ci * @ptha_acc_num: The number of copies of the Poly1305 module that are
2268c2ecf20Sopenharmony_ci *	implemented in this version of SEC.
2278c2ecf20Sopenharmony_ci **/
2288c2ecf20Sopenharmony_cistruct dpseci_sec_attr {
2298c2ecf20Sopenharmony_ci	u16 ip_id;
2308c2ecf20Sopenharmony_ci	u8 major_rev;
2318c2ecf20Sopenharmony_ci	u8 minor_rev;
2328c2ecf20Sopenharmony_ci	u8 era;
2338c2ecf20Sopenharmony_ci	u8 deco_num;
2348c2ecf20Sopenharmony_ci	u8 zuc_auth_acc_num;
2358c2ecf20Sopenharmony_ci	u8 zuc_enc_acc_num;
2368c2ecf20Sopenharmony_ci	u8 snow_f8_acc_num;
2378c2ecf20Sopenharmony_ci	u8 snow_f9_acc_num;
2388c2ecf20Sopenharmony_ci	u8 crc_acc_num;
2398c2ecf20Sopenharmony_ci	u8 pk_acc_num;
2408c2ecf20Sopenharmony_ci	u8 kasumi_acc_num;
2418c2ecf20Sopenharmony_ci	u8 rng_acc_num;
2428c2ecf20Sopenharmony_ci	u8 md_acc_num;
2438c2ecf20Sopenharmony_ci	u8 arc4_acc_num;
2448c2ecf20Sopenharmony_ci	u8 des_acc_num;
2458c2ecf20Sopenharmony_ci	u8 aes_acc_num;
2468c2ecf20Sopenharmony_ci	u8 ccha_acc_num;
2478c2ecf20Sopenharmony_ci	u8 ptha_acc_num;
2488c2ecf20Sopenharmony_ci};
2498c2ecf20Sopenharmony_ci
2508c2ecf20Sopenharmony_ciint dpseci_get_sec_attr(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
2518c2ecf20Sopenharmony_ci			struct dpseci_sec_attr *attr);
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ciint dpseci_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags,
2548c2ecf20Sopenharmony_ci			   u16 *major_ver, u16 *minor_ver);
2558c2ecf20Sopenharmony_ci
2568c2ecf20Sopenharmony_ci/**
2578c2ecf20Sopenharmony_ci * enum dpseci_congestion_unit - DPSECI congestion units
2588c2ecf20Sopenharmony_ci * @DPSECI_CONGESTION_UNIT_BYTES: bytes units
2598c2ecf20Sopenharmony_ci * @DPSECI_CONGESTION_UNIT_FRAMES: frames units
2608c2ecf20Sopenharmony_ci */
2618c2ecf20Sopenharmony_cienum dpseci_congestion_unit {
2628c2ecf20Sopenharmony_ci	DPSECI_CONGESTION_UNIT_BYTES = 0,
2638c2ecf20Sopenharmony_ci	DPSECI_CONGESTION_UNIT_FRAMES
2648c2ecf20Sopenharmony_ci};
2658c2ecf20Sopenharmony_ci
2668c2ecf20Sopenharmony_ci/**
2678c2ecf20Sopenharmony_ci * CSCN message is written to message_iova once entering a
2688c2ecf20Sopenharmony_ci * congestion state (see 'threshold_entry')
2698c2ecf20Sopenharmony_ci */
2708c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_WRITE_MEM_ON_ENTER		0x00000001
2718c2ecf20Sopenharmony_ci
2728c2ecf20Sopenharmony_ci/**
2738c2ecf20Sopenharmony_ci * CSCN message is written to message_iova once exiting a
2748c2ecf20Sopenharmony_ci * congestion state (see 'threshold_exit')
2758c2ecf20Sopenharmony_ci */
2768c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_WRITE_MEM_ON_EXIT		0x00000002
2778c2ecf20Sopenharmony_ci
2788c2ecf20Sopenharmony_ci/**
2798c2ecf20Sopenharmony_ci * CSCN write will attempt to allocate into a cache (coherent write);
2808c2ecf20Sopenharmony_ci * valid only if 'DPSECI_CGN_MODE_WRITE_MEM_<X>' is selected
2818c2ecf20Sopenharmony_ci */
2828c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_COHERENT_WRITE			0x00000004
2838c2ecf20Sopenharmony_ci
2848c2ecf20Sopenharmony_ci/**
2858c2ecf20Sopenharmony_ci * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' CSCN message is sent to
2868c2ecf20Sopenharmony_ci * DPIO/DPCON's WQ channel once entering a congestion state
2878c2ecf20Sopenharmony_ci * (see 'threshold_entry')
2888c2ecf20Sopenharmony_ci */
2898c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_NOTIFY_DEST_ON_ENTER		0x00000008
2908c2ecf20Sopenharmony_ci
2918c2ecf20Sopenharmony_ci/**
2928c2ecf20Sopenharmony_ci * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' CSCN message is sent to
2938c2ecf20Sopenharmony_ci * DPIO/DPCON's WQ channel once exiting a congestion state
2948c2ecf20Sopenharmony_ci * (see 'threshold_exit')
2958c2ecf20Sopenharmony_ci */
2968c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_NOTIFY_DEST_ON_EXIT		0x00000010
2978c2ecf20Sopenharmony_ci
2988c2ecf20Sopenharmony_ci/**
2998c2ecf20Sopenharmony_ci * if 'dpseci_dest_cfg.dest_type != DPSECI_DEST_NONE' when the CSCN is written
3008c2ecf20Sopenharmony_ci * to the sw-portal's DQRR, the DQRI interrupt is asserted immediately
3018c2ecf20Sopenharmony_ci * (if enabled)
3028c2ecf20Sopenharmony_ci */
3038c2ecf20Sopenharmony_ci#define DPSECI_CGN_MODE_INTR_COALESCING_DISABLED	0x00000020
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci/**
3068c2ecf20Sopenharmony_ci * struct dpseci_congestion_notification_cfg - congestion notification
3078c2ecf20Sopenharmony_ci *	configuration
3088c2ecf20Sopenharmony_ci * @units: units type
3098c2ecf20Sopenharmony_ci * @threshold_entry: above this threshold we enter a congestion state.
3108c2ecf20Sopenharmony_ci *	set it to '0' to disable it
3118c2ecf20Sopenharmony_ci * @threshold_exit: below this threshold we exit the congestion state.
3128c2ecf20Sopenharmony_ci * @message_ctx: The context that will be part of the CSCN message
3138c2ecf20Sopenharmony_ci * @message_iova: I/O virtual address (must be in DMA-able memory),
3148c2ecf20Sopenharmony_ci *	must be 16B aligned;
3158c2ecf20Sopenharmony_ci * @dest_cfg: CSCN can be send to either DPIO or DPCON WQ channel
3168c2ecf20Sopenharmony_ci * @notification_mode: Mask of available options; use 'DPSECI_CGN_MODE_<X>'
3178c2ecf20Sopenharmony_ci *	values
3188c2ecf20Sopenharmony_ci */
3198c2ecf20Sopenharmony_cistruct dpseci_congestion_notification_cfg {
3208c2ecf20Sopenharmony_ci	enum dpseci_congestion_unit units;
3218c2ecf20Sopenharmony_ci	u32 threshold_entry;
3228c2ecf20Sopenharmony_ci	u32 threshold_exit;
3238c2ecf20Sopenharmony_ci	u64 message_ctx;
3248c2ecf20Sopenharmony_ci	u64 message_iova;
3258c2ecf20Sopenharmony_ci	struct dpseci_dest_cfg dest_cfg;
3268c2ecf20Sopenharmony_ci	u16 notification_mode;
3278c2ecf20Sopenharmony_ci};
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ciint dpseci_set_congestion_notification(struct fsl_mc_io *mc_io, u32 cmd_flags,
3308c2ecf20Sopenharmony_ci	u16 token, const struct dpseci_congestion_notification_cfg *cfg);
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ciint dpseci_get_congestion_notification(struct fsl_mc_io *mc_io, u32 cmd_flags,
3338c2ecf20Sopenharmony_ci	u16 token, struct dpseci_congestion_notification_cfg *cfg);
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_ci#endif /* _DPSECI_H_ */
336