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

Commit c76ce6f8 authored by Rama Krishna Phani A's avatar Rama Krishna Phani A Committed by Anvesh Salveru
Browse files

msm: sps: Correct descriptor fifo address to dump contents



Few clients of BAM will use SMMU for data transfers.
Assign correct descriptor fifo address for SMMU clients
of BAM while dumping contents.

Change-Id: I21584e6778315f51cac0d202d41f4c81a56fcbf0
Signed-off-by: default avatarRama Krishna Phani A <rphani@codeaurora.org>
parent f094710b
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
 */
/* Bus-Access-Manager (BAM) Hardware manager. */

@@ -2140,13 +2140,16 @@ void print_bam_pipe_desc_fifo(void *virt_addr, u32 pipe_index, u32 option)
	u32 pipe = pipe_index;
	u32 desc_fifo_addr;
	u32 desc_fifo_size;
	u32 *desc_fifo;
	u32 __iomem *desc_fifo;
	int i;
	char desc_info[MAX_MSG_LEN];
	struct sps_bam *dev;

	if (base == NULL)
		return;

	dev = to_sps_bam_dev(virt_addr);

	desc_fifo_addr = bam_read_reg(base, P_DESC_FIFO_ADDR, pipe);
	desc_fifo_size = bam_read_reg_field(base, P_FIFO_SIZES, pipe,
						P_DESC_FIFO_SIZE);
@@ -2167,7 +2170,14 @@ void print_bam_pipe_desc_fifo(void *virt_addr, u32 pipe_index, u32 option)
		"BAM_P_DESC_FIFO_SIZE: 0x%x (%d)\n\n",
		desc_fifo_addr, desc_fifo_size, desc_fifo_size);

	desc_fifo = (u32 *) phys_to_virt(desc_fifo_addr);
	if (dev->props.options & SPS_BAM_SMMU_EN) {
		struct sps_pipe *pipe_indx = dev->pipes[pipe_index];

		SPS_DUMP("%s", "SMMU is enabled\n");
		desc_fifo = pipe_indx->map->desc.base;
	} else {
		desc_fifo = (u32 __iomem *) phys_to_virt(desc_fifo_addr);
	}

	if (option == 100) {
		SPS_DUMP("%s",