qcacmn: Initialize command/credit ring for qca8074 & qcn9000

Initialize command/credit ring for qca8074 & qcn9000.

Change-Id: I28087dd4d8f4afddd954c764c2e85da43eaf78f1
CRs-fixed: 2562649
此提交包含在:
Ankit Kumar
2019-10-29 10:29:00 +05:30
提交者 nshrivas
父節點 7e0bf6da72
當前提交 2bf9b7a18a
共有 20 個檔案被更改,包括 214 行新增17 行删除

查看文件

@@ -1412,6 +1412,7 @@ struct hal_hw_txrx_ops qcn9000_hal_hw_txrx_ops = {
hal_tx_comp_get_release_reason_generic,
hal_get_wbm_internal_error_generic,
hal_tx_desc_set_mesh_en_9000,
hal_tx_init_cmd_credit_ring_9000,
/* rx */
hal_rx_msdu_start_nss_get_9000,
@@ -1622,11 +1623,12 @@ struct hal_hw_srng_config hw_srng_table_9000[] = {
HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_BMSK >>
HWIO_TCL_R0_SW2TCL1_RING_BASE_MSB_RING_SIZE_SHFT,
},
{ /* TCL_CMD */
{ /* TCL_CMD/CREDIT */
/* qca8074v2 and qcn9000 uses this ring for data commands */
.start_ring_id = HAL_SRNG_SW2TCL_CMD,
.max_rings = 1,
.entry_size = (sizeof(struct tlv_32_hdr) +
sizeof(struct tcl_gse_cmd)) >> 2,
sizeof(struct tcl_data_cmd)) >> 2,
.lmac_ring = FALSE,
.ring_dir = HAL_SRNG_SRC_RING,
.reg_start = {

查看文件

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -207,3 +207,33 @@ static void hal_tx_desc_set_lmac_id_9000(void *desc, uint8_t lmac_id)
HAL_SET_FLD(desc, TCL_DATA_CMD_4, LMAC_ID) |=
HAL_TX_SM(TCL_DATA_CMD_4, LMAC_ID, lmac_id);
}
/**
* hal_tx_init_cmd_credit_ring_9000() - Initialize TCL command/credit SRNG
* @hal_soc_hdl: Handle to HAL SoC structure
* @hal_srng: Handle to HAL SRNG structure
*
* Return: none
*/
static inline void hal_tx_init_cmd_credit_ring_9000(hal_soc_handle_t hal_soc_hdl,
hal_ring_handle_t hal_ring_hdl)
{
uint8_t *desc_addr;
struct hal_srng_params srng_params;
uint32_t desc_size;
uint32_t num_desc;
hal_get_srng_params(hal_soc_hdl, hal_ring_hdl, &srng_params);
desc_addr = (uint8_t *)srng_params.ring_base_vaddr;
desc_size = sizeof(struct tcl_data_cmd);
num_desc = srng_params.num_entries;
while (num_desc) {
/* using CMD/CREDIT Ring to send DATA CMD tag */
HAL_TX_DESC_SET_TLV_HDR(desc_addr, WIFITCL_DATA_CMD_E,
desc_size);
desc_addr += (desc_size + sizeof(struct tlv_32_hdr));
num_desc--;
}
}