1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2019 Marvell International Ltd.
5 #ifndef __OTX2_EVDEV_H__
6 #define __OTX2_EVDEV_H__
8 #include <rte_eventdev.h>
10 #include "otx2_common.h"
12 #include "otx2_mempool.h"
14 #define EVENTDEV_NAME_OCTEONTX2_PMD otx2_eventdev
16 #define sso_func_trace otx2_sso_dbg
18 #define OTX2_SSO_MAX_VHGRP RTE_EVENT_MAX_QUEUES_PER_DEV
19 #define OTX2_SSO_MAX_VHWS (UINT8_MAX)
21 /* SSO LF register offsets (BAR2) */
22 #define SSO_LF_GGRP_OP_ADD_WORK0 (0x0ull)
23 #define SSO_LF_GGRP_OP_ADD_WORK1 (0x8ull)
25 #define SSO_LF_GGRP_QCTL (0x20ull)
26 #define SSO_LF_GGRP_EXE_DIS (0x80ull)
27 #define SSO_LF_GGRP_INT (0x100ull)
28 #define SSO_LF_GGRP_INT_W1S (0x108ull)
29 #define SSO_LF_GGRP_INT_ENA_W1S (0x110ull)
30 #define SSO_LF_GGRP_INT_ENA_W1C (0x118ull)
31 #define SSO_LF_GGRP_INT_THR (0x140ull)
32 #define SSO_LF_GGRP_INT_CNT (0x180ull)
33 #define SSO_LF_GGRP_XAQ_CNT (0x1b0ull)
34 #define SSO_LF_GGRP_AQ_CNT (0x1c0ull)
35 #define SSO_LF_GGRP_AQ_THR (0x1e0ull)
36 #define SSO_LF_GGRP_MISC_CNT (0x200ull)
38 #define USEC2NSEC(__us) ((__us) * 1E3)
40 enum otx2_sso_lf_type {
45 struct otx2_sso_evdev {
46 OTX2_DEV; /* Base class */
47 uint8_t max_event_queues;
48 uint8_t max_event_ports;
49 uint8_t is_timeout_deq;
50 uint8_t nb_event_queues;
51 uint8_t nb_event_ports;
54 uint32_t min_dequeue_timeout_ns;
55 uint32_t max_dequeue_timeout_ns;
56 int32_t max_num_events;
59 uint32_t xaq_buf_size;
61 } __rte_cache_aligned;
63 static inline struct otx2_sso_evdev *
64 sso_pmd_priv(const struct rte_eventdev *event_dev)
66 return event_dev->data->dev_private;
69 /* Init and Fini API's */
70 int otx2_sso_init(struct rte_eventdev *event_dev);
71 int otx2_sso_fini(struct rte_eventdev *event_dev);
73 #endif /* __OTX2_EVDEV_H__ */