Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fc8c2ab authored by Amit Mehta's avatar Amit Mehta Committed by Madan Koyyalamudi
Browse files

qcacmn: Set default value for REO dest ctrl register

Currently in some case we are receiving non error packets on REO2TCL
ring, which is causing issue.

Fix is to set DEST_RING_MAPPING_0 to SW1 for REO dest ctrl
register, So that non error packets with reo_destination_indication
with 0x0 in the reo entrance ring will be routed to SW1 ring.

Change-Id: I67f78f35e7dba899943307902d99d0325a60498f
CRs-Fixed: 3150186
parent 87b0fe29
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -701,7 +702,7 @@ int dp_ipa_ring_resource_setup(struct dp_soc *soc,
	 * Set DEST_RING_MAPPING_4 to SW2 as default value for
	 * DESTINATION_RING_CTRL_IX_0.
	 */
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_TCL, 0) |
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW1, 1) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW2, 2) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW3, 3) |
@@ -988,7 +989,7 @@ QDF_STATUS dp_ipa_enable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
		return QDF_STATUS_E_AGAIN;

	/* Call HAL API to remap REO rings to REO2IPA ring */
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_TCL, 0) |
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW4, 1) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW1, 2) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW4, 3) |
@@ -1025,6 +1026,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
	struct dp_pdev *pdev =
		dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
	uint32_t ix0;
	uint32_t ix1;
	uint32_t ix2;
	uint32_t ix3;

@@ -1040,7 +1042,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
		return QDF_STATUS_E_AGAIN;

	/* Call HAL API to remap REO rings to REO2IPA ring */
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_TCL, 0) |
	ix0 = HAL_REO_REMAP_IX0(REO_REMAP_SW1, 0) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW1, 1) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW2, 2) |
	      HAL_REO_REMAP_IX0(REO_REMAP_SW3, 3) |
@@ -1050,7 +1052,7 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
	      HAL_REO_REMAP_IX0(REO_REMAP_FW, 7);

	if (wlan_cfg_is_rx_hash_enabled(soc->wlan_cfg_ctx)) {
		dp_reo_remap_config(soc, &ix2, &ix3);
		dp_reo_remap_config(soc, &ix1, &ix2, &ix3);

		hal_reo_read_write_ctrl_ix(soc->hal_soc, false, &ix0, NULL,
					   &ix2, &ix3);
+2 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -255,7 +256,7 @@ QDF_STATUS dp_ipa_handle_rx_buf_smmu_mapping(struct dp_soc *soc,
					     uint32_t size,
					     bool create);

bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap1,
bool dp_reo_remap_config(struct dp_soc *soc,uint32_t *remap0, uint32_t *remap1,
			 uint32_t *remap2);
bool dp_ipa_is_mdm_platform(void);

+7 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -3398,12 +3399,14 @@ static void dp_soc_reset_intr_mask(struct dp_soc *soc)
 * @remap2: output parameter indicates reo remap 2 register value
 * Return: bool type, true if remap is configured else false.
 */
bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap1, uint32_t *remap2)
bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0,
			 uint32_t *remap1, uint32_t *remap2)
{
	uint32_t ring[4] = {REO_REMAP_SW1, REO_REMAP_SW2,
						REO_REMAP_SW3};
	hal_compute_reo_remap_ix2_ix3(soc->hal_soc, ring,
				      3, remap1, remap2);
	hal_compute_reo_remap_ix0(soc->hal_soc, remap0);
	dp_debug("remap1 %x remap2 %x", *remap1, *remap2);

	return true;
@@ -3529,7 +3532,7 @@ static uint8_t dp_reo_ring_selection(uint32_t value, uint32_t *ring)
	return num;
}

static bool dp_reo_remap_config(struct dp_soc *soc,
static bool dp_reo_remap_config(struct dp_soc *soc, uint32_t *remap0,
				uint32_t *remap1,
				uint32_t *remap2)
{
@@ -3547,6 +3550,7 @@ static bool dp_reo_remap_config(struct dp_soc *soc,
		num = dp_reo_ring_selection(value, ring);
		hal_compute_reo_remap_ix2_ix3(soc->hal_soc, ring,
					      num, remap1, remap2);
		hal_compute_reo_remap_ix0(soc->hal_soc, remap0);

		break;
	case dp_nss_cfg_first_radio:
@@ -12537,6 +12541,7 @@ void *dp_soc_init(struct dp_soc *soc, HTC_HANDLE htc_handle,
		 * are offloaded to NSS
		 */
		if (dp_reo_remap_config(soc,
					&reo_params.remap0,
					&reo_params.remap1,
					&reo_params.remap2))
			reo_params.rx_hash_enabled = true;
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -2417,6 +2418,15 @@ void hal_compute_reo_remap_ix2_ix3(hal_soc_handle_t hal_soc_hdl,
					num_rings, remap1, remap2);
}

static inline
void hal_compute_reo_remap_ix0(hal_soc_handle_t hal_soc_hdl, uint32_t *remap0)
{
	struct hal_soc *hal_soc = (struct hal_soc *)hal_soc_hdl;

	if (hal_soc->ops->hal_compute_reo_remap_ix0)
		hal_soc->ops->hal_compute_reo_remap_ix0(remap0);
}

/**
 * hal_setup_link_idle_list - Setup scattered idle list using the
 * buffer list provided
+12 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2022 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
@@ -1700,6 +1701,17 @@ static void hal_reo_setup_generic(struct hal_soc *soc,
	 * 7: NOT_USED.
	*/
	if (reo_params->rx_hash_enabled) {
		if (reo_params->remap0)
			HAL_REG_WRITE(soc,
				      HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR(
				      SEQ_WCSS_UMAC_REO_REG_OFFSET),
				      reo_params->remap0);

		hal_debug("HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR 0x%x",
			HAL_REG_READ(soc,
				     HWIO_REO_R0_DESTINATION_RING_CTRL_IX_0_ADDR(
				     SEQ_WCSS_UMAC_REO_REG_OFFSET)));

		HAL_REG_WRITE(soc,
			HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR(
			SEQ_WCSS_UMAC_REO_REG_OFFSET),
Loading