From patchwork Mon Apr 11 08:38:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 65480 Delivered-To: patch@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1338764lbl; Mon, 11 Apr 2016 01:41:01 -0700 (PDT) X-Received: by 10.98.86.28 with SMTP id k28mr31152174pfb.43.1460364058824; Mon, 11 Apr 2016 01:40:58 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by4si2344374pad.130.2016.04.11.01.40.58; Mon, 11 Apr 2016 01:40:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752739AbcDKIk4 (ORCPT + 7 others); Mon, 11 Apr 2016 04:40:56 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:34733 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752776AbcDKIjk (ORCPT ); Mon, 11 Apr 2016 04:39:40 -0400 Received: by mail-wm0-f47.google.com with SMTP id l6so135707776wml.1 for ; Mon, 11 Apr 2016 01:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t2vrrbZS0xtKR4lIt5EeRWcnAVhrU+GLk9BXwtwo7iE=; b=jfY/CC0Iyd461ieZ4GtFwQjZNN3wYUg0Wixt9kKCR7vRkt7dfYsf43Nll7pMkURj1B okJYL4r0Psg2pnNS51VaTLM8sJ044DFc021iMy32T8f/7Bhcyr4VVmkOH/iEofRcQqBH UkaMJajkAARpr6WNPoK5gH1yavMG87KXXffrc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t2vrrbZS0xtKR4lIt5EeRWcnAVhrU+GLk9BXwtwo7iE=; b=lRcIE4ETdcgqtt/zVHLh7JJyKxMKVxQP+cZnu22t17SylA2uKtmX3zUaT/Wsx1Zgk4 AHSMA1N0nZdkEpbhfTKp/lRozCHo/yhL//X9WyTszYSItOU5nnDVzrSvmueNpgQu/UYC bG+byIJ3Stu/rUNVdA1q8D0Lx9xEv5fJMOeYYCCpdf7RgsVTJWw8YxPe7pqhYOtWf++z 9tK6tFqehv1pKA1Ri/IHC3vJ+sx4DngiEsJ8hVcSMFEuZzZdfyWYyHMPoN4aO/WoqCNe TD4Uq8fEoAWzFIeaRH70g/ld5eh9Rm0upVXRbdXpnP1Kkgays3lPcUG1f8LWKJXgkkPP /iTA== X-Gm-Message-State: AD7BkJJUUMGITIy87FM0kZakVP+uh3n4wWtq+dWvnQVSmW1J4wI79NtvOVysRs+ItE3RlDy7 X-Received: by 10.28.57.214 with SMTP id g205mr17343447wma.24.1460363968515; Mon, 11 Apr 2016 01:39:28 -0700 (PDT) Received: from mms734.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id d1sm16078604wmh.18.2016.04.11.01.39.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 01:39:28 -0700 (PDT) From: Stanimir Varbanov To: Rob Herring , Mark Rutland , Vinod Koul , Andy Gross Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, dmaengine@vger.kernel.org, Archit Taneja , Sinan Kaya , Pramod Gurav , Stanimir Varbanov Subject: [PATCH v3 4/6] dmaengine: qcom: bam_dma: add controlled-remotely dt property Date: Mon, 11 Apr 2016 11:38:41 +0300 Message-Id: <1460363923-16296-5-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1460363923-16296-1-git-send-email-stanimir.varbanov@linaro.org> References: <1460363923-16296-1-git-send-email-stanimir.varbanov@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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: Stanimir Varbanov Reviewed-by: Andy Gross Tested-by: Pramod Gurav --- drivers/dma/qcom/bam_dma.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 789d5f836bf7..d0f878a78fae 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -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);