1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020-2021 NXP
5 #ifndef __BBDEV_LA12XX_H__
6 #define __BBDEV_LA12XX_H__
8 #define BBDEV_IPC_ENC_OP_TYPE 1
9 #define BBDEV_IPC_DEC_OP_TYPE 2
11 #define MAX_LDPC_ENC_FECA_QUEUES 4
12 #define MAX_LDPC_DEC_FECA_QUEUES 4
14 #define MAX_CHANNEL_DEPTH 16
15 /* private data structure */
16 struct bbdev_la12xx_private {
18 uint8_t num_valid_queues;
19 uint8_t max_nb_queues;
20 uint8_t num_ldpc_enc_queues;
21 uint8_t num_ldpc_dec_queues;
23 struct bbdev_la12xx_q_priv *queues_priv[32];
26 struct hugepage_info {
32 struct bbdev_la12xx_q_priv {
33 struct bbdev_la12xx_private *bbdev_priv;
34 uint32_t q_id; /**< Channel ID */
35 uint32_t feca_blk_id; /** FECA block ID for processing */
36 uint32_t feca_blk_id_be32; /**< FECA Block ID for this queue */
37 uint8_t en_napi; /* 0: napi disabled, 1: napi enabled */
38 uint16_t queue_size; /**< Queue depth */
39 int32_t eventfd; /**< Event FD value */
40 enum rte_bbdev_op_type op_type; /**< Operation type */
41 uint32_t la12xx_core_id;
42 /* LA12xx core ID on which this will be scheduled */
43 struct rte_mempool *mp; /**< Pool from where buffers would be cut */
44 void *bbdev_op[MAX_CHANNEL_DEPTH];
45 /**< Stores bbdev op for each index */
46 void *msg_ch_vaddr[MAX_CHANNEL_DEPTH];
47 /**< Stores msg channel addr for modem->host */
48 uint32_t host_pi; /**< Producer_Index for HOST->MODEM */
49 uint32_t host_ci; /**< Consumer Index for MODEM->HOST */
50 host_ipc_params_t *host_params; /**< Host parameters */
53 #define lower_32_bits(x) ((uint32_t)((uint64_t)x))
54 #define upper_32_bits(x) ((uint32_t)(((uint64_t)(x) >> 16) >> 16))