qcacmn: Add API to change Rx Fragment DST ring

Add API to change the Rx Fragment DST ring based on the SoC NSS
config
CRs-Fixed: 2175933

Change-Id: I2e3f0b82d301538f54d9790d55eeccdd0f6fa154
This commit is contained in:
Aniruddha Paul
2018-01-08 11:24:34 +05:30
committed by snandini
parent 6c40b760d5
commit 91dfd50160
4 changed files with 52 additions and 6 deletions

View File

@@ -1762,6 +1762,42 @@ static bool dp_reo_remap_config(struct dp_soc *soc,
} }
#endif #endif
/*
* dp_reo_frag_dst_set() - configure reo register to set the
* fragment destination ring
* @soc : Datapath soc
* @frag_dst_ring : output parameter to set fragment destination ring
*
* Based on offload_radio below fragment destination rings is selected
* 0 - TCL
* 1 - SW1
* 2 - SW2
* 3 - SW3
* 4 - SW4
* 5 - Release
* 6 - FW
* 7 - alternate select
*
* return: void
*/
static void dp_reo_frag_dst_set(struct dp_soc *soc, uint8_t *frag_dst_ring)
{
uint8_t offload_radio = wlan_cfg_get_dp_soc_nss_cfg(soc->wlan_cfg_ctx);
switch (offload_radio) {
case 0:
*frag_dst_ring = HAL_SRNG_REO_EXCEPTION;
break;
case 3:
*frag_dst_ring = HAL_SRNG_REO_ALTERNATE_SELECT;
break;
default:
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
FL("dp_reo_frag_dst_set invalid offload radio config"));
break;
}
}
/* /*
* dp_soc_cmn_setup() - Common SoC level initializion * dp_soc_cmn_setup() - Common SoC level initializion
* @soc: Datapath SOC handle * @soc: Datapath SOC handle
@@ -1973,6 +2009,11 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
wlan_cfg_get_defrag_timeout_check(soc->wlan_cfg_ctx); wlan_cfg_get_defrag_timeout_check(soc->wlan_cfg_ctx);
out: out:
/*
* set the fragment destination ring
*/
dp_reo_frag_dst_set(soc, &reo_params.frag_dst_ring);
hal_reo_setup(soc->hal_soc, &reo_params); hal_reo_setup(soc->hal_soc, &reo_params);
qdf_atomic_set(&soc->cmn_init_done, 1); qdf_atomic_set(&soc->cmn_init_done, 1);

View File

@@ -1003,12 +1003,16 @@ extern void hal_setup_link_idle_list(void *hal_soc,
/* REO parameters to be passed to hal_reo_setup */ /* REO parameters to be passed to hal_reo_setup */
struct hal_reo_params { struct hal_reo_params {
/* rx hash steering enabled or disabled */ /** rx hash steering enabled or disabled */
bool rx_hash_enabled; bool rx_hash_enabled;
/* reo remap 1 register */ /** reo remap 1 register */
uint32_t remap1; uint32_t remap1;
/* reo remap 2 register */ /** reo remap 2 register */
uint32_t remap2; uint32_t remap2;
/** fragment destination ring */
uint8_t frag_dst_ring;
/** padding */
uint8_t padding[3];
}; };
/** /**

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are * modification, are permitted provided that the following conditions are
@@ -182,6 +182,7 @@ enum hal_srng_ring_id {
}; };
#define HAL_SRNG_REO_EXCEPTION HAL_SRNG_REO2SW1 #define HAL_SRNG_REO_EXCEPTION HAL_SRNG_REO2SW1
#define HAL_SRNG_REO_ALTERNATE_SELECT 0x7
#define HAL_MAX_LMACS 3 #define HAL_MAX_LMACS 3
#define HAL_MAX_RINGS_PER_LMAC (HAL_SRNG_LMAC1_ID_END - HAL_SRNG_LMAC1_ID_START) #define HAL_MAX_RINGS_PER_LMAC (HAL_SRNG_LMAC1_ID_END - HAL_SRNG_LMAC1_ID_START)

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -231,7 +231,7 @@ void hal_reo_setup(void *hal_soc,
HAL_REG_WRITE(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR( HAL_REG_WRITE(soc, HWIO_REO_R0_GENERAL_ENABLE_ADDR(
SEQ_WCSS_UMAC_REO_REG_OFFSET), SEQ_WCSS_UMAC_REO_REG_OFFSET),
HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, HAL_SM(HWIO_REO_R0_GENERAL_ENABLE,
FRAGMENT_DEST_RING, HAL_SRNG_REO_EXCEPTION) | FRAGMENT_DEST_RING, reo_params->frag_dst_ring) |
HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_LIST_ENABLE, 1) | HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_LIST_ENABLE, 1) |
HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_FLUSH_ENABLE, 1)); HAL_SM(HWIO_REO_R0_GENERAL_ENABLE, AGING_FLUSH_ENABLE, 1));
/* Other ring enable bits and REO_ENABLE will be set by FW */ /* Other ring enable bits and REO_ENABLE will be set by FW */