From 627278cdfe2d68412dcf7f3e3e29c0e0759a854e Mon Sep 17 00:00:00 2001 From: Pramod Simha Date: Tue, 14 Aug 2018 11:58:29 -0700 Subject: [PATCH] qcacmn: Change Shadow Register configuration for QCA6390 - Change the SR mapping address for QCA6390 - Use ring direction field from HAL ring config instead of HAL ring directly as ring is not yet initialized here. Change-Id: I900b2329367cc02ae2f9d7f164e5f867d8253d90 CRs-Fixed: 2299919 --- hal/wifi3.0/hal_hw_headers.h | 4 ++++ hal/wifi3.0/hal_srng.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hal/wifi3.0/hal_hw_headers.h b/hal/wifi3.0/hal_hw_headers.h index aaed61ffa812..2907a47a5dc4 100644 --- a/hal/wifi3.0/hal_hw_headers.h +++ b/hal/wifi3.0/hal_hw_headers.h @@ -78,7 +78,11 @@ #define HAL_SRNG_REO_ALTERNATE_SELECT 0x7 /* calculate the register address offset from bar0 of shadow register x */ +#ifdef QCA_WIFI_QCA6390 +#define SHADOW_REGISTER(x) (0x000008FC + (4 * (x))) +#else #define SHADOW_REGISTER(x) (0x00003024 + (4 * (x))) +#endif /* TODO: Check if the following can be provided directly by HW headers */ #define SRNG_LOOP_CNT_MASK REO_DESTINATION_RING_15_LOOPING_COUNT_MASK diff --git a/hal/wifi3.0/hal_srng.c b/hal/wifi3.0/hal_srng.c index a47df7730dfc..52c502907da8 100644 --- a/hal/wifi3.0/hal_srng.c +++ b/hal/wifi3.0/hal_srng.c @@ -84,6 +84,8 @@ static void hal_update_srng_hp_tp_address(void *hal_soc, struct hal_srng *srng; struct hal_soc *hal = (struct hal_soc *)hal_soc; int ring_id; + struct hal_hw_srng_config *ring_config = + HAL_SRNG_CONFIG(hal, ring_type); ring_id = hal_get_srng_ring_id(hal_soc, ring_type, ring_num, 0); if (ring_id < 0) @@ -91,7 +93,7 @@ static void hal_update_srng_hp_tp_address(void *hal_soc, srng = hal_get_srng(hal_soc, ring_id); - if (srng->ring_dir == HAL_SRNG_DST_RING) + if (ring_config->ring_dir == HAL_SRNG_DST_RING) srng->u.dst_ring.tp_addr = SHADOW_REGISTER(shadow_config_index) + hal->dev_base_addr; else