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

Commit 5172c9eb authored by Stanimir Varbanov's avatar Stanimir Varbanov Committed by Vinod Koul
Browse files

dmaengine: qcom: bam_dma: add controlled-remotely dt property



Some of the peripherals has bam which is controlled by remote
processor, thus the bam dma driver must avoid register writes
which initialise bam hw block. Those registers are protected
from xPU block and any writes to them will lead to secure
violation and system reboot.

Adding the contolled_remotely flag in bam driver to avoid
not permitted register writes in bam_init function.

Signed-off-by: default avatarStanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: default avatarAndy Gross <andy.gross@linaro.org>
Tested-by: default avatarPramod Gurav <gpramod@codeaurora.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent c778ed46
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -387,6 +387,7 @@ struct bam_device {

	/* execution environment ID, from DT */
	u32 ee;
	bool controlled_remotely;

	const struct reg_offset_data *layout;

@@ -1042,6 +1043,9 @@ static int bam_init(struct bam_device *bdev)
	val = readl_relaxed(bam_addr(bdev, 0, BAM_NUM_PIPES));
	bdev->num_channels = val & BAM_NUM_PIPES_MASK;

	if (bdev->controlled_remotely)
		return 0;

	/* s/w reset bam */
	/* after reset all pipes are disabled and idle */
	val = readl_relaxed(bam_addr(bdev, 0, BAM_CTRL));
@@ -1129,6 +1133,9 @@ static int bam_dma_probe(struct platform_device *pdev)
		return ret;
	}

	bdev->controlled_remotely = of_property_read_bool(pdev->dev.of_node,
						"qcom,controlled-remotely");

	bdev->bamclk = devm_clk_get(bdev->dev, "bam_clk");
	if (IS_ERR(bdev->bamclk))
		return PTR_ERR(bdev->bamclk);