qcacmn: Support for IPQ8074 2G PHYB mode 2/3

This mode is supported through hw_mode_id 7. A special mode for
IPQ8074 platform alone to bring up single pdev alone on 2G mode.
FW would advertise the mode 7 support through the WMI service
ready message and this mode will be the default mode for AP-HK10 alone.

Added preferred_hw_mode and target_pdev_id into dp structures so that
they can be used to configure the dp rings for this particular mode.
Also changed the lmac_id to target_pdev_id mapping for mode 7.

Change-Id: I3aae46fea13132eebaf7d37cff68ef517253d229
This commit is contained in:
Nandha Kishore Easwaran
2020-03-30 16:32:34 +05:30
committed by nshrivas
parent c6ca857257
commit 1039ae6642
4 changed files with 45 additions and 4 deletions

View File

@@ -1156,6 +1156,7 @@ typedef union cdp_config_param_t {
/* psoc params */
bool cdp_psoc_param_en_rate_stats;
int cdp_psoc_param_en_nss_cfg;
int cdp_psoc_param_preferred_hw_mode;
} cdp_config_param_type;
/**
@@ -1257,10 +1258,12 @@ enum cdp_vdev_param_type {
* to set values in psoc
* @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
* @CDP_SET_NSS_CFG: set nss cfg
* @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
*/
enum cdp_psoc_param_type {
CDP_ENABLE_RATE_STATS,
CDP_SET_NSS_CFG,
CDP_SET_PREFERRED_HW_MODE,
};
#define TXRX_FW_STATS_TXSTATS 1

View File

@@ -1405,8 +1405,8 @@ static inline struct dp_pdev *
}
/**
* dp_get_target_pdev_id_for_host_pdev_id() - Return target pdev corresponding
* to host pdev id
* dp_calculate_target_pdev_id_from_host_pdev_id() - Return target pdev
* corresponding to host pdev id
* @soc: soc pointer
* @mac_for_pdev: pdev_id corresponding to host pdev for WIN, mac id for MCL
*
@@ -1419,7 +1419,7 @@ static inline struct dp_pdev *
* For MCL, return the offset-1 translated mac_id
*/
static inline int
dp_get_target_pdev_id_for_host_pdev_id
dp_calculate_target_pdev_id_from_host_pdev_id
(struct dp_soc *soc, uint32_t mac_for_pdev)
{
struct dp_pdev *pdev;
@@ -1433,6 +1433,25 @@ dp_get_target_pdev_id_for_host_pdev_id
return wlan_cfg_get_target_pdev_id(soc->wlan_cfg_ctx, pdev->lmac_id);
}
/**
* dp_get_target_pdev_id_for_host_pdev_id() - Return target pdev corresponding
* to host pdev id
* @soc: soc pointer
* @mac_for_pdev: pdev_id corresponding to host pdev for WIN, mac id for MCL
*
* returns target pdev_id for host pdev id.
* For WIN, return the value stored in pdev object.
* For MCL, return the offset-1 translated mac_id.
*/
static inline int
dp_get_target_pdev_id_for_host_pdev_id
(struct dp_soc *soc, uint32_t mac_for_pdev)
{
struct dp_pdev *pdev = soc->pdev_list[mac_for_pdev];
return pdev->target_pdev_id;
}
/**
* dp_get_host_pdev_id_for_target_pdev_id() - Return host pdev corresponding
* to target pdev id

View File

@@ -3764,6 +3764,14 @@ static inline QDF_STATUS dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
pdev->lmac_id = wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, pdev_id);
soc->pdev_count++;
pdev->target_pdev_id =
dp_calculate_target_pdev_id_from_host_pdev_id(soc, pdev_id);
if (soc->preferred_hw_mode == WMI_HOST_HW_MODE_2G_PHYB &&
pdev->lmac_id == PHYB_2G_LMAC_ID) {
pdev->target_pdev_id = PHYB_2G_TARGET_PDEV_ID;
}
TAILQ_INIT(&pdev->vdev_list);
qdf_spinlock_create(&pdev->vdev_list_lock);
pdev->vdev_count = 0;
@@ -8616,7 +8624,9 @@ dp_set_psoc_param(struct cdp_soc_t *cdp_soc,
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
FL("nss-wifi<0> nss config is enabled"));
break;
case CDP_SET_PREFERRED_HW_MODE:
soc->preferred_hw_mode = val.cdp_psoc_param_preferred_hw_mode;
break;
default:
break;
}

View File

@@ -110,6 +110,10 @@
#define REO_CMD_EVENT_HIST_MAX 64
/* 2G PHYB */
#define PHYB_2G_LMAC_ID 2
#define PHYB_2G_TARGET_PDEV_ID 2
#ifndef REMOVE_PKT_LOG
enum rx_pktlog_mode {
DP_RX_PKTLOG_DISABLED = 0,
@@ -1260,6 +1264,8 @@ struct dp_soc {
qdf_atomic_t num_tx_outstanding;
/* Num Tx allowed */
uint32_t num_tx_allowed;
/* Preferred HW mode */
uint8_t preferred_hw_mode;
/**
* Flag to indicate whether WAR to address single cache entry
@@ -1487,6 +1493,9 @@ struct dp_pdev {
/* LMAC Id */
int lmac_id;
/* Target pdev Id */
int target_pdev_id;
/* TXRX SOC handle */
struct dp_soc *soc;