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