From 34b6af18a43151dab5b98dd499a35a1dfdf712d9 Mon Sep 17 00:00:00 2001 From: Rakesh Pillai Date: Wed, 17 Feb 2021 01:09:40 -0800 Subject: [PATCH] qcacmn: Init-Deinit changes for WCN7850 Add Init-Deinit changes for WCN7850 support in datapath Change-Id: I7f9850ee41f4638c6a28b5313549c67876c5f810 CRs-Fixed: 2888556 --- dp/inc/cdp_txrx_cmn_reg.h | 10 ++++++--- dp/wifi3.0/dp_main.c | 28 ++++++++++++++++++++++++-- dp/wifi3.0/dp_rx_err.c | 2 +- dp/wifi3.0/dp_types.h | 2 +- hal/wifi3.0/hal_api.h | 12 ++++++----- hif/src/hif_io32.h | 2 +- target_if/cfr/inc/target_if_cfr_6490.h | 4 ++-- target_if/cfr/src/target_if_cfr.c | 2 +- wlan_cfg/cfg_dp.h | 2 +- 9 files changed, 47 insertions(+), 17 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_reg.h b/dp/inc/cdp_txrx_cmn_reg.h index 0ffcc7b220..5c5f5ec4af 100644 --- a/dp/inc/cdp_txrx_cmn_reg.h +++ b/dp/inc/cdp_txrx_cmn_reg.h @@ -26,9 +26,12 @@ #include "hif_main.h" -#define MOB_DRV_LEGACY_DP 0xdeed/*FIXME Add MCL device IDs */ -#define LITHIUM_DP 0xfffd/*FIXME Add Litium device ID */ -/* Use these device IDs for attach in future */ +#define MOB_DRV_LEGACY_DP 0xdeed +/* Lithium device IDs */ +#define LITHIUM_DP 0xfffd +/* Beryllium device IDs */ +#define BERYLLIUM_DP 0xaffe +/* Use device IDs for attach in future */ #if defined(DP_TXRX_SOC_ATTACH) static inline ol_txrx_soc_handle @@ -110,6 +113,7 @@ ol_txrx_soc_handle cdp_soc_attach(u_int16_t devid, { switch (devid) { case LITHIUM_DP: /*FIXME Add lithium devide IDs */ + case BERYLLIUM_DP: case QCA8074_DEVICE_ID: /* Hawekeye */ case QCA8074V2_DEVICE_ID: /* Hawekeye V2*/ case QCA5018_DEVICE_ID: diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 5d98f8077a..a257445fe6 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -7688,8 +7688,8 @@ static QDF_STATUS dp_peer_delete_wifi3(struct cdp_soc_t *soc_hdl, * Return: MAC address on success, NULL on failure. * */ -static uint8 *dp_get_vdev_mac_addr_wifi3(struct cdp_soc_t *soc_hdl, - uint8_t vdev_id) +static uint8_t *dp_get_vdev_mac_addr_wifi3(struct cdp_soc_t *soc_hdl, + uint8_t vdev_id) { struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); struct dp_vdev *vdev = dp_vdev_get_ref_by_id(soc, vdev_id, @@ -14497,6 +14497,25 @@ static void dp_soc_cfg_init(struct dp_soc *soc) soc->wlan_cfg_ctx->int_rxdma2host_ring_mask[int_ctx] = 0; } } + soc->wlan_cfg_ctx->rxdma1_enable = 0; + break; + case TARGET_TYPE_WCN7850: + wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, + REO_DST_RING_SIZE_QCA6290); + soc->ast_override_support = 1; + + if (soc->cdp_soc.ol_ops->get_con_mode && + soc->cdp_soc.ol_ops->get_con_mode() == + QDF_GLOBAL_MONITOR_MODE) { + int int_ctx; + + for (int_ctx = 0; int_ctx < WLAN_CFG_INT_NUM_CONTEXTS; + int_ctx++) { + soc->wlan_cfg_ctx->int_rx_ring_mask[int_ctx] = 0; + soc->wlan_cfg_ctx->int_rxdma2host_ring_mask[int_ctx] = 0; + } + } + soc->wlan_cfg_ctx->rxdma1_enable = 0; break; case TARGET_TYPE_QCA8074: @@ -14585,6 +14604,11 @@ static void dp_soc_cfg_attach(struct dp_soc *soc) REO_DST_RING_SIZE_QCA6290); soc->wlan_cfg_ctx->rxdma1_enable = 0; break; + case TARGET_TYPE_WCN7850: + wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, + REO_DST_RING_SIZE_QCA6290); + soc->wlan_cfg_ctx->rxdma1_enable = 0; + break; case TARGET_TYPE_QCA8074: wlan_cfg_set_tso_desc_attach_defer(soc->wlan_cfg_ctx, 1); wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx, diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index fed462e27b..40b4d2bbdb 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -998,7 +998,7 @@ free_nbuf: } #if defined(QCA_WIFI_QCA6390) || defined(QCA_WIFI_QCA6490) || \ - defined(QCA_WIFI_QCA6750) + defined(QCA_WIFI_QCA6750) || defined(QCA_WIFI_WCN7850) /** * dp_rx_null_q_handle_invalid_peer_id_exception() - to find exception * @soc: pointer to dp_soc struct diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 06679e4715..65e4a4a64f 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -158,7 +158,7 @@ enum m_copy_mode { struct msdu_list { qdf_nbuf_t head; qdf_nbuf_t tail; - uint32 sum_len; + uint32_t sum_len; }; struct dp_soc_cmn; diff --git a/hal/wifi3.0/hal_api.h b/hal/wifi3.0/hal_api.h index f04234e1aa..a64c21e56a 100644 --- a/hal/wifi3.0/hal_api.h +++ b/hal/wifi3.0/hal_api.h @@ -35,7 +35,8 @@ #define HAL_IPA_TX_COMP_RING_IDX 2 /* calculate the register address offset from bar0 of shadow register x */ -#if defined(QCA_WIFI_QCA6390) || defined(QCA_WIFI_QCA6490) +#if defined(QCA_WIFI_QCA6390) || defined(QCA_WIFI_QCA6490) || \ + defined(QCA_WIFI_WCN7850) #define SHADOW_REGISTER_START_ADDRESS_OFFSET 0x000008FC #define SHADOW_REGISTER_END_ADDRESS_OFFSET \ ((SHADOW_REGISTER_START_ADDRESS_OFFSET) + (4 * (MAX_SHADOW_REGISTERS))) @@ -125,7 +126,8 @@ static inline void hal_reg_write_result_check(struct hal_soc *hal_soc, } } -#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) +#if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) && \ + !defined(QCA_WIFI_WCN7850) static inline void hal_lock_reg_access(struct hal_soc *soc, unsigned long *flags) { @@ -230,7 +232,7 @@ static inline void hal_tx_init_cmd_credit_ring(hal_soc_handle_t hal_soc_hdl, * that window would be a bug */ #if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) && \ - !defined(QCA_WIFI_QCA6750) + !defined(QCA_WIFI_QCA6750) && !defined(QCA_WIFI_WCN7850) static inline void hal_write32_mb(struct hal_soc *hal_soc, uint32_t offset, uint32_t value) { @@ -463,7 +465,7 @@ static inline void hal_srng_write_address_32_mb(struct hal_soc *hal_soc, #endif #if !defined(QCA_WIFI_QCA6390) && !defined(QCA_WIFI_QCA6490) && \ - !defined(QCA_WIFI_QCA6750) + !defined(QCA_WIFI_QCA6750) && !defined(QCA_WIFI_WCN7850) /** * hal_read32_mb() - Access registers to read configuration * @hal_soc: hal soc handle @@ -861,7 +863,7 @@ extern void hal_detach(void *hal_soc); #define HAL_SRNG_MSI_INTR 0x00020000 #define HAL_SRNG_CACHED_DESC 0x00040000 -#ifdef QCA_WIFI_QCA6490 +#if defined(QCA_WIFI_QCA6490) || defined(QCA_WIFI_WCN7850) #define HAL_SRNG_PREFETCH_TIMER 1 #else #define HAL_SRNG_PREFETCH_TIMER 0 diff --git a/hif/src/hif_io32.h b/hif/src/hif_io32.h index 91a6e7c1a4..be1ceb5cfe 100644 --- a/hif/src/hif_io32.h +++ b/hif/src/hif_io32.h @@ -32,7 +32,7 @@ #define MAX_UNWINDOWED_ADDRESS 0x80000 #if defined(QCA_WIFI_QCA6390) || defined(QCA_WIFI_QCA6490) || \ defined(QCA_WIFI_QCN9000) || defined(QCA_WIFI_QCA6750) || \ - defined(QCA_WIFI_QCN9224) + defined(QCA_WIFI_QCN9224) || defined(QCA_WIFI_WCN7850) #define WINDOW_ENABLE_BIT 0x40000000 #else #define WINDOW_ENABLE_BIT 0x80000000 diff --git a/target_if/cfr/inc/target_if_cfr_6490.h b/target_if/cfr/inc/target_if_cfr_6490.h index 84d5635cb8..a8b2309444 100644 --- a/target_if/cfr/inc/target_if_cfr_6490.h +++ b/target_if/cfr/inc/target_if_cfr_6490.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021 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 @@ -26,7 +26,7 @@ #ifndef _TARGET_IF_CFR_6490_H #define _TARGET_IF_CFR_6490_H -#ifdef QCA_WIFI_QCA6490 +#if defined(QCA_WIFI_QCA6490) || defined(QCA_WIFI_WCN7850) #define CFR_MAC_ID_24G 1 #define CFR_MAC_ID_5G 0 #endif /* QCA_WIFI_QCA6490 */ diff --git a/target_if/cfr/src/target_if_cfr.c b/target_if/cfr/src/target_if_cfr.c index 8259c63c4b..bab22f0bd8 100644 --- a/target_if/cfr/src/target_if_cfr.c +++ b/target_if/cfr/src/target_if_cfr.c @@ -480,7 +480,7 @@ target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc, #endif #ifdef WLAN_ENH_CFR_ENABLE -#ifdef QCA_WIFI_QCA6490 +#if defined(QCA_WIFI_QCA6490) || defined(QCA_WIFI_WCN7850) static uint8_t target_if_cfr_get_mac_id(struct wlan_objmgr_pdev *pdev) { struct wlan_objmgr_vdev *vdev; diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index eeca995f69..e5006d4ef7 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -262,7 +262,7 @@ #define WLAN_CFG_RX_RELEASE_RING_SIZE 1024 #define WLAN_CFG_RX_RELEASE_RING_SIZE_MIN 8 #if defined(QCA_WIFI_QCA6390) || defined(QCA_WIFI_QCA6490) || \ - defined(QCA_WIFI_QCA6750) + defined(QCA_WIFI_QCA6750) || defined(QCA_WIFI_WCN7850) #define WLAN_CFG_RX_RELEASE_RING_SIZE_MAX 1024 #else #define WLAN_CFG_RX_RELEASE_RING_SIZE_MAX 8192