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: 8798731 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1619E9F54F for ; Mon, 11 Apr 2016 08:50:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3D08720220 for ; Mon, 11 Apr 2016 08:50:42 +0000 (UTC) Received: from bombadil.infradead.org (unknown [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62D8E201CD for ; Mon, 11 Apr 2016 08:50:41 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1apXP5-0008Bw-7j; Mon, 11 Apr 2016 08:41:03 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1apXNu-0005z3-3I for linux-arm-kernel@lists.infradead.org; Mon, 11 Apr 2016 08:39:54 +0000 Received: by mail-wm0-x231.google.com with SMTP id n3so94264066wmn.0 for ; Mon, 11 Apr 2016 01:39:29 -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=JO9SOONOB7TDSLYEfp9bYhf2r/zjCL3xPWvTJtw1kImJaaaTPNSvTBOvC9YGN8ugED WbnoMMUqqU2qUXtzuLC7BjCe4prXlSI9jlUGRHyubrZHL3C1ORwafDvx+o0TXPzvUf3D GMwGiZZTif4FB3bhuQtHJ+8+gCDnQ6Vx2drLS/7RNTPMnhpAsBO3XbiP2Alk25u9758a cO7mnoTk82BvcglO4s+ylXNx54dUHydtBFthgNI1o5LYA0WBsKOvr8N9JQffDcvzlwnQ n3HcmXnByqsdI3m1nIJlmO86UPS1AifnqhlkD8Iz1tMYgI+ufWakH1Po4GalJV0OAHN8 9jCg== X-Gm-Message-State: AD7BkJKl8U8B+WNkLEnm2MXjY2DErwwI9Fr63z34+B3lau2MHUzZ8ibJQf0so11aIkHMvOBV 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160411_013950_737409_C26DE719 X-CRM114-Status: GOOD ( 12.63 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Archit Taneja , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Stanimir Varbanov , Sinan Kaya , dmaengine@vger.kernel.org, Pramod Gurav , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RDNS_NONE,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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);