qcacmn: add HAL files for peach
Add HAL files for peach. Change-Id: If38aa7767bee700e414c82e8bf9aa2acee450250 CRs-Fixed: 3674686
This commit is contained in:
parent
ecbe06079f
commit
390062031e
@ -1687,6 +1687,7 @@ void hal_qca8074_attach(struct hal_soc *hal_soc);
|
||||
* @hal_soc: HAL soc
|
||||
*/
|
||||
void hal_kiwi_attach(struct hal_soc *hal_soc);
|
||||
void hal_peach_attach(struct hal_soc *hal_soc);
|
||||
|
||||
void hal_qcn9224v2_attach(struct hal_soc *hal_soc);
|
||||
void hal_wcn6450_attach(struct hal_soc *hal_soc);
|
||||
|
@ -65,9 +65,12 @@ void hal_qca5018_attach(struct hal_soc *hal);
|
||||
#ifdef QCA_WIFI_QCA5332
|
||||
void hal_qca5332_attach(struct hal_soc *hal);
|
||||
#endif
|
||||
#ifdef QCA_WIFI_KIWI
|
||||
#ifdef INCLUDE_HAL_KIWI
|
||||
void hal_kiwi_attach(struct hal_soc *hal);
|
||||
#endif
|
||||
#ifdef INCLUDE_HAL_PEACH
|
||||
void hal_peach_attach(struct hal_soc *hal);
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_VERBOSE_DEBUG
|
||||
bool is_hal_verbose_debug_enabled;
|
||||
@ -443,14 +446,19 @@ static void hal_target_based_configure(struct hal_soc *hal)
|
||||
hal_qca6750_attach(hal);
|
||||
break;
|
||||
#endif
|
||||
#ifdef QCA_WIFI_KIWI
|
||||
#ifdef INCLUDE_HAL_KIWI
|
||||
case TARGET_TYPE_KIWI:
|
||||
case TARGET_TYPE_MANGO:
|
||||
case TARGET_TYPE_PEACH:
|
||||
hal->use_register_windowing = true;
|
||||
hal_kiwi_attach(hal);
|
||||
break;
|
||||
#endif
|
||||
#ifdef INCLUDE_HAL_PEACH
|
||||
case TARGET_TYPE_PEACH:
|
||||
hal->use_register_windowing = true;
|
||||
hal_peach_attach(hal);
|
||||
break;
|
||||
#endif
|
||||
#if defined(QCA_WIFI_QCA8074) && defined(WIFI_TARGET_TYPE_3_0)
|
||||
case TARGET_TYPE_QCA8074:
|
||||
hal_qca8074_attach(hal);
|
||||
|
2554
hal/wifi3.0/peach/hal_peach.c
Normal file
2554
hal/wifi3.0/peach/hal_peach.c
Normal file
File diff suppressed because it is too large
Load Diff
207
hal/wifi3.0/peach/hal_peach_rx.h
Normal file
207
hal/wifi3.0/peach/hal_peach_rx.h
Normal file
@ -0,0 +1,207 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef _HAL_PEACH_RX_H_
|
||||
#define _HAL_PEACH_RX_H_
|
||||
#include "qdf_util.h"
|
||||
#include "qdf_types.h"
|
||||
#include "qdf_lock.h"
|
||||
#include "qdf_mem.h"
|
||||
#include "qdf_nbuf.h"
|
||||
#include "tcl_data_cmd.h"
|
||||
//#include "mac_tcl_reg_seq_hwioreg.h"
|
||||
#include "phyrx_rssi_legacy.h"
|
||||
#include "rx_msdu_start.h"
|
||||
#include "tlv_tag_def.h"
|
||||
#include "hal_hw_headers.h"
|
||||
#include "hal_internal.h"
|
||||
#include "cdp_txrx_mon_struct.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "hal_rx.h"
|
||||
#include "hal_tx.h"
|
||||
#include "dp_types.h"
|
||||
#include "hal_api_mon.h"
|
||||
#include "phyrx_other_receive_info_ru_details.h"
|
||||
|
||||
#define HAL_RX_MSDU0_BUFFER_ADDR_LSB(link_desc_va) \
|
||||
(uint8_t *)(link_desc_va) + \
|
||||
RX_MSDU_LINK_MSDU_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET
|
||||
|
||||
#define HAL_RX_MSDU_DESC_INFO_PTR_GET(msdu0) \
|
||||
(uint8_t *)(msdu0) + \
|
||||
RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_FIRST_MSDU_IN_MPDU_FLAG_OFFSET
|
||||
|
||||
#define HAL_ENT_MPDU_DESC_INFO(ent_ring_desc) \
|
||||
(uint8_t *)(ent_ring_desc) + \
|
||||
RX_MPDU_DETAILS_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
|
||||
|
||||
#define HAL_DST_MPDU_DESC_INFO(dst_ring_desc) \
|
||||
(uint8_t *)(dst_ring_desc) + \
|
||||
REO_DESTINATION_RING_RX_MPDU_DESC_INFO_DETAILS_MSDU_COUNT_OFFSET
|
||||
|
||||
#define HAL_RX_GET_MAC_ADDR1_VALID(rx_mpdu_start) \
|
||||
HAL_RX_GET(rx_mpdu_start, RX_MPDU_INFO, MAC_ADDR_AD1_VALID)
|
||||
|
||||
#define HAL_RX_GET_SW_FRAME_GROUP_ID(rx_mpdu_start) \
|
||||
HAL_RX_GET(rx_mpdu_start, RX_MPDU_INFO, SW_FRAME_GROUP_ID)
|
||||
|
||||
#define HAL_RX_GET_SW_PEER_ID(rx_mpdu_start) \
|
||||
HAL_RX_GET(rx_mpdu_start, RX_MPDU_INFO, SW_PEER_ID)
|
||||
|
||||
#define HAL_REO_R0_CONFIG(soc, reg_val, reo_params) \
|
||||
do { \
|
||||
reg_val &= \
|
||||
~(HWIO_REO_R0_GENERAL_ENABLE_AGING_LIST_ENABLE_BMSK |\
|
||||
HWIO_REO_R0_GENERAL_ENABLE_AGING_FLUSH_ENABLE_BMSK); \
|
||||
reg_val |= \
|
||||
HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, \
|
||||
AGING_LIST_ENABLE, 1) |\
|
||||
HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, \
|
||||
AGING_FLUSH_ENABLE, 1);\
|
||||
HAL_REG_WRITE((soc), \
|
||||
HWIO_REO_R0_GENERAL_ENABLE_ADDR( \
|
||||
REO_REG_REG_BASE), \
|
||||
(reg_val)); \
|
||||
reg_val = \
|
||||
HAL_REG_READ((soc), \
|
||||
HWIO_REO_R0_MISC_CTL_ADDR( \
|
||||
REO_REG_REG_BASE)); \
|
||||
reg_val &= \
|
||||
~(HWIO_REO_R0_MISC_CTL_FRAGMENT_DEST_RING_BMSK); \
|
||||
reg_val |= \
|
||||
HAL_SM(HWIO_REO_R0_MISC_CTL, \
|
||||
FRAGMENT_DEST_RING, \
|
||||
(reo_params)->frag_dst_ring); \
|
||||
reg_val &= \
|
||||
(~HWIO_REO_R0_MISC_CTL_BAR_DEST_RING_BMSK |\
|
||||
(REO_REMAP_TCL << HWIO_REO_R0_MISC_CTL_BAR_DEST_RING_SHFT)); \
|
||||
HAL_REG_WRITE((soc), \
|
||||
HWIO_REO_R0_MISC_CTL_ADDR( \
|
||||
REO_REG_REG_BASE), \
|
||||
(reg_val)); \
|
||||
} while (0)
|
||||
|
||||
#define HAL_RX_MSDU_DESC_INFO_GET(msdu_details_ptr) \
|
||||
((struct rx_msdu_desc_info *) \
|
||||
_OFFSET_TO_BYTE_PTR(msdu_details_ptr, \
|
||||
RX_MSDU_DETAILS_RX_MSDU_DESC_INFO_DETAILS_RESERVED_0A_OFFSET))
|
||||
|
||||
#define HAL_RX_LINK_DESC_MSDU0_PTR(link_desc) \
|
||||
((struct rx_msdu_details *) \
|
||||
_OFFSET_TO_BYTE_PTR((link_desc),\
|
||||
RX_MSDU_LINK_MSDU_0_BUFFER_ADDR_INFO_DETAILS_BUFFER_ADDR_31_0_OFFSET))
|
||||
|
||||
#if defined(QCA_WIFI_PEACH) && defined(WLAN_CFR_ENABLE) && \
|
||||
defined(WLAN_ENH_CFR_ENABLE)
|
||||
|
||||
#define PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS_CHAN_CAPTURE_STATUS_BMASK 0x00000006
|
||||
#define PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS_CHAN_CAPTURE_STATUS_LSB 1
|
||||
#define PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS_CHAN_CAPTURE_STATUS_MSB 2
|
||||
|
||||
#define HAL_GET_RX_LOCATION_INFO_CHAN_CAPTURE_STATUS(rx_tlv) \
|
||||
((HAL_RX_GET_64((rx_tlv), \
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS, \
|
||||
RTT_CFR_STATUS) & \
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS_CHAN_CAPTURE_STATUS_BMASK) >> \
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS_CHAN_CAPTURE_STATUS_LSB)
|
||||
|
||||
static inline
|
||||
void hal_rx_get_bb_info_peach(void *rx_tlv,
|
||||
void *ppdu_info_hdl)
|
||||
{
|
||||
struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
|
||||
|
||||
ppdu_info->cfr_info.bb_captured_channel =
|
||||
HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_CHANNEL);
|
||||
|
||||
ppdu_info->cfr_info.bb_captured_timeout =
|
||||
HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_TIMEOUT);
|
||||
|
||||
ppdu_info->cfr_info.bb_captured_reason =
|
||||
HAL_RX_GET_64(rx_tlv, RXPCU_PPDU_END_INFO, BB_CAPTURED_REASON);
|
||||
}
|
||||
|
||||
static inline
|
||||
void hal_rx_get_rtt_info_peach(void *rx_tlv,
|
||||
void *ppdu_info_hdl)
|
||||
{
|
||||
struct hal_rx_ppdu_info *ppdu_info = ppdu_info_hdl;
|
||||
|
||||
ppdu_info->cfr_info.rx_location_info_valid =
|
||||
HAL_RX_GET_64(rx_tlv, PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RX_LOCATION_INFO_VALID);
|
||||
|
||||
ppdu_info->cfr_info.rtt_che_buffer_pointer_low32 =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RTT_CHE_BUFFER_POINTER_LOW32);
|
||||
|
||||
ppdu_info->cfr_info.rtt_che_buffer_pointer_high8 =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RTT_CHE_BUFFER_POINTER_HIGH8);
|
||||
|
||||
ppdu_info->cfr_info.chan_capture_status =
|
||||
HAL_GET_RX_LOCATION_INFO_CHAN_CAPTURE_STATUS(rx_tlv);
|
||||
|
||||
ppdu_info->cfr_info.rx_start_ts =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RX_START_TS);
|
||||
|
||||
ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t)
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RTT_CFO_MEASUREMENT);
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info0 =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
GAIN_CHAIN0);
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info0 |=
|
||||
(((uint32_t)HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
GAIN_CHAIN1)) << 16);
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info1 =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
GAIN_CHAIN2);
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info1 |=
|
||||
(((uint32_t)HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
GAIN_CHAIN3)) << 16);
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info2 = 0;
|
||||
|
||||
ppdu_info->cfr_info.agc_gain_info3 = 0;
|
||||
|
||||
ppdu_info->cfr_info.mcs_rate =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RTT_MCS_RATE);
|
||||
|
||||
ppdu_info->cfr_info.gi_type =
|
||||
HAL_RX_GET_64(rx_tlv,
|
||||
PHYRX_LOCATION_RX_LOCATION_INFO_DETAILS,
|
||||
RTT_GI_TYPE);
|
||||
}
|
||||
#endif
|
||||
#endif
|
209
hal/wifi3.0/peach/hal_peach_tx.h
Normal file
209
hal/wifi3.0/peach/hal_peach_tx.h
Normal file
@ -0,0 +1,209 @@
|
||||
/*
|
||||
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. 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
|
||||
* above copyright notice and this permission notice appear in all
|
||||
* copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "tcl_data_cmd.h"
|
||||
//#include "mac_tcl_reg_seq_hwioreg.h"
|
||||
#include "phyrx_rssi_legacy.h"
|
||||
#include "hal_be_hw_headers.h"
|
||||
#include "hal_internal.h"
|
||||
#include "cdp_txrx_mon_struct.h"
|
||||
#include "qdf_trace.h"
|
||||
#include "hal_rx.h"
|
||||
#include "hal_tx.h"
|
||||
#include "dp_types.h"
|
||||
#include "hal_api_mon.h"
|
||||
|
||||
#define DSCP_TID_TABLE_SIZE 24
|
||||
#define NUM_WORDS_PER_DSCP_TID_TABLE (DSCP_TID_TABLE_SIZE / 4)
|
||||
|
||||
/**
|
||||
* hal_tx_set_dscp_tid_map_peach() - Configure default DSCP to TID map table
|
||||
* @hal_soc: HAL SoC context
|
||||
* @map: DSCP-TID mapping table
|
||||
* @id: mapping table ID - 0-31
|
||||
*
|
||||
* DSCP are mapped to 8 TID values using TID values programmed
|
||||
* in any of the 32 DSCP_TID_MAPS (id = 0-31).
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static void hal_tx_set_dscp_tid_map_peach(struct hal_soc *hal_soc, uint8_t *map,
|
||||
uint8_t id)
|
||||
{
|
||||
int i;
|
||||
uint32_t addr, cmn_reg_addr;
|
||||
uint32_t value = 0, regval;
|
||||
uint8_t val[DSCP_TID_TABLE_SIZE], cnt = 0;
|
||||
|
||||
struct hal_soc *soc = (struct hal_soc *)hal_soc;
|
||||
|
||||
if (id >= HAL_MAX_HW_DSCP_TID_MAPS_11AX)
|
||||
return;
|
||||
|
||||
cmn_reg_addr = HWIO_TCL_R0_CONS_RING_CMN_CTRL_REG_ADDR(
|
||||
MAC_TCL_REG_REG_BASE);
|
||||
|
||||
addr = HWIO_TCL_R0_DSCP_TID_MAP_n_ADDR(
|
||||
MAC_TCL_REG_REG_BASE,
|
||||
id * NUM_WORDS_PER_DSCP_TID_TABLE);
|
||||
|
||||
/* Enable read/write access */
|
||||
regval = HAL_REG_READ(soc, cmn_reg_addr);
|
||||
regval |=
|
||||
(1 <<
|
||||
HWIO_TCL_R0_CONS_RING_CMN_CTRL_REG_DSCP_TID_MAP_PROGRAM_EN_SHFT);
|
||||
|
||||
HAL_REG_WRITE(soc, cmn_reg_addr, regval);
|
||||
|
||||
/* Write 8 (24 bits) DSCP-TID mappings in each iteration */
|
||||
for (i = 0; i < 64; i += 8) {
|
||||
value = (map[i] |
|
||||
(map[i + 1] << 0x3) |
|
||||
(map[i + 2] << 0x6) |
|
||||
(map[i + 3] << 0x9) |
|
||||
(map[i + 4] << 0xc) |
|
||||
(map[i + 5] << 0xf) |
|
||||
(map[i + 6] << 0x12) |
|
||||
(map[i + 7] << 0x15));
|
||||
|
||||
qdf_mem_copy(&val[cnt], (void *)&value, 3);
|
||||
cnt += 3;
|
||||
}
|
||||
|
||||
for (i = 0; i < DSCP_TID_TABLE_SIZE; i += 4) {
|
||||
regval = *(uint32_t *)(val + i);
|
||||
HAL_REG_WRITE(soc, addr,
|
||||
(regval & HWIO_TCL_R0_DSCP_TID_MAP_n_RMSK));
|
||||
addr += 4;
|
||||
}
|
||||
|
||||
/* Disable read/write access */
|
||||
regval = HAL_REG_READ(soc, cmn_reg_addr);
|
||||
regval &=
|
||||
~(HWIO_TCL_R0_CONS_RING_CMN_CTRL_REG_DSCP_TID_MAP_PROGRAM_EN_BMSK);
|
||||
|
||||
HAL_REG_WRITE(soc, cmn_reg_addr, regval);
|
||||
}
|
||||
|
||||
/**
|
||||
* hal_tx_update_dscp_tid_peach() - Update the dscp tid map table as updated
|
||||
* by the user
|
||||
* @hal_soc: HAL SoC context
|
||||
* @tid: TID
|
||||
* @id : MAP ID
|
||||
* @dscp: DSCP_TID map index
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static void hal_tx_update_dscp_tid_peach(struct hal_soc *hal_soc, uint8_t tid,
|
||||
uint8_t id, uint8_t dscp)
|
||||
{
|
||||
int index;
|
||||
uint32_t addr;
|
||||
uint32_t value;
|
||||
uint32_t regval;
|
||||
struct hal_soc *soc = (struct hal_soc *)hal_soc;
|
||||
|
||||
addr = HWIO_TCL_R0_DSCP_TID_MAP_n_ADDR(
|
||||
MAC_TCL_REG_REG_BASE, id);
|
||||
|
||||
index = dscp % HAL_TX_NUM_DSCP_PER_REGISTER;
|
||||
addr += 4 * (dscp / HAL_TX_NUM_DSCP_PER_REGISTER);
|
||||
value = tid << (HAL_TX_BITS_PER_TID * index);
|
||||
|
||||
regval = HAL_REG_READ(soc, addr);
|
||||
regval &= ~(HAL_TX_TID_BITS_MASK << (HAL_TX_BITS_PER_TID * index));
|
||||
regval |= value;
|
||||
|
||||
HAL_REG_WRITE(soc, addr, (regval & HWIO_TCL_R0_DSCP_TID_MAP_n_RMSK));
|
||||
}
|
||||
|
||||
/**
|
||||
* hal_tx_init_cmd_credit_ring_peach() - Initialize command/credit SRNG
|
||||
* @hal_soc_hdl: Handle to HAL SoC structure
|
||||
* @hal_ring_hdl: Handle to HAL SRNG structure
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static inline void
|
||||
hal_tx_init_cmd_credit_ring_peach(hal_soc_handle_t hal_soc_hdl,
|
||||
hal_ring_handle_t hal_ring_hdl)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef DP_TX_IMPLICIT_RBM_MAPPING
|
||||
|
||||
#define RBM_MAPPING_BMSK HWIO_TCL_R0_RBM_MAPPING0_SW2TCL1_RING_BMSK
|
||||
#define RBM_MAPPING_SHFT HWIO_TCL_R0_RBM_MAPPING0_SW2TCL2_RING_SHFT
|
||||
|
||||
#define RBM_PPE2TCL_OFFSET \
|
||||
(HWIO_TCL_R0_RBM_MAPPING0_PPE2TCL1_RING_SHFT >> 2)
|
||||
#define RBM_TCL_CMD_CREDIT_OFFSET \
|
||||
(HWIO_TCL_R0_RBM_MAPPING0_SW2TCL_CREDIT_RING_SHFT >> 2)
|
||||
|
||||
/**
|
||||
* hal_tx_config_rbm_mapping_be_peach() - Update return buffer manager ring id
|
||||
* @hal_soc_hdl: HAL SoC context
|
||||
* @hal_ring_hdl: Source ring pointer
|
||||
* @rbm_id: return buffer manager ring id
|
||||
*
|
||||
* Return: void
|
||||
*/
|
||||
static inline void
|
||||
hal_tx_config_rbm_mapping_be_peach(hal_soc_handle_t hal_soc_hdl,
|
||||
hal_ring_handle_t hal_ring_hdl,
|
||||
uint8_t rbm_id)
|
||||
{
|
||||
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
|
||||
struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;
|
||||
uint32_t reg_addr = 0;
|
||||
uint32_t reg_val = 0;
|
||||
uint32_t val = 0;
|
||||
uint8_t ring_num;
|
||||
enum hal_ring_type ring_type;
|
||||
|
||||
ring_type = srng->ring_type;
|
||||
ring_num = hal_soc->hw_srng_table[ring_type].start_ring_id;
|
||||
ring_num = srng->ring_id - ring_num;
|
||||
|
||||
reg_addr = HWIO_TCL_R0_RBM_MAPPING0_ADDR(MAC_TCL_REG_REG_BASE);
|
||||
|
||||
if (ring_type == PPE2TCL)
|
||||
ring_num = ring_num + RBM_PPE2TCL_OFFSET;
|
||||
else if (ring_type == TCL_CMD_CREDIT)
|
||||
ring_num = ring_num + RBM_TCL_CMD_CREDIT_OFFSET;
|
||||
|
||||
/* get current value stored in register address */
|
||||
val = HAL_REG_READ(hal_soc, reg_addr);
|
||||
|
||||
/* mask out other stored value */
|
||||
val &= (~(RBM_MAPPING_BMSK << (RBM_MAPPING_SHFT * ring_num)));
|
||||
|
||||
reg_val = val | ((RBM_MAPPING_BMSK & rbm_id) <<
|
||||
(RBM_MAPPING_SHFT * ring_num));
|
||||
|
||||
/* write rbm mapped value to register address */
|
||||
HAL_REG_WRITE(hal_soc, reg_addr, reg_val);
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
hal_tx_config_rbm_mapping_be_peach(hal_soc_handle_t hal_soc_hdl,
|
||||
hal_ring_handle_t hal_ring_hdl,
|
||||
uint8_t rbm_id)
|
||||
{
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user