From patchwork Tue Dec 1 09:14:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 7734491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 659D6BEEE1 for ; Tue, 1 Dec 2015 09:20:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 866D8206AB for ; Tue, 1 Dec 2015 09:20:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [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 94CEA206A9 for ; Tue, 1 Dec 2015 09:20:45 +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 1a3h5K-000223-E2; Tue, 01 Dec 2015 09:18:54 +0000 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a3h30-0007lt-48 for linux-arm-kernel@lists.infradead.org; Tue, 01 Dec 2015 09:16:40 +0000 Received: by wmww144 with SMTP id w144so4132108wmw.0 for ; Tue, 01 Dec 2015 01:16:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ow1482y0FNiRmClaR5YqX9uJHR2YkAQjjxvFSy2r+ck=; b=cTZEmNTifk/Xe2S2AJmtmbvsTH+dPqsJHoowhoKXWwgsIiN/VnEnNwlZOL+LbcYz9N 9xCB2S+1yHCNlFY2iLbvz2P3HutonLF2Jm5hXLQxwEfcfAr8Jn9T91QXhbSQq2DuzCgZ ucqXd4g5whvDnjD6kmGAh3rLkNuQU2ThCPtVPR0GbVEdpg0onvfd3V9xxQ8G3/nxjr7j ykLXbf2hfeFj8UijP20RI+/2TDUcpk6ex7GOT/jtBrxnUjWFP2JrgTQ+zFZzdbkUuGmr eLfTq0jGasoOij9JDwocXWvC5aQOPjoyeEHOcO/sRD2upSYyGdrONqUV6SKEiM34tNTL MG3g== 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=ow1482y0FNiRmClaR5YqX9uJHR2YkAQjjxvFSy2r+ck=; b=KSXPZ+9dTnHPH/4zNJqeMVSOs7/4R0hn/WI+I/ZmE6B30YJjdgUuXcW0PGqJI3RRmt upzp+uXvnGBYqmrdM5M+jf2DHb3rHh2oa27ZzXBL/7OTNXU2alUwPYLZ0yKql8ZR/txJ dAGKeIeMnqp8XEHdPTqiUp6/f8es1evW7SxkH5dxSQfV5iX81xwyUtfu2m+Rxx6/T2pQ dlyCwsuDDWDGD1fZ0qdD+oKJqSCKzsi2aRiyyy+XsKzbxrO5glbBXE33IEFwNkH2bts3 r4eRHbzL5veJnLUI260Im7DqmJj2n4T0ZHHAQ3eViI6rTgiD6Wf6GdTEiEz3yGnZQQz2 C/ZA== X-Gm-Message-State: ALoCoQnjlWFinQpt2RqH5ZxChfwkdj9ZYwEnokdUpQfjVzCDPKPznK/7O+9ht9YFVTTWAQnloGqV X-Received: by 10.194.92.4 with SMTP id ci4mr92529280wjb.175.1448961368216; Tue, 01 Dec 2015 01:16:08 -0800 (PST) Received: from mms734.qualcomm.mm-sol.com ([37.157.136.206]) by smtp.gmail.com with ESMTPSA id t64sm25290428wmf.23.2015.12.01.01.16.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Dec 2015 01:16:07 -0800 (PST) From: Stanimir Varbanov To: 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, Vinod Koul Subject: [PATCH 4/4] dmaengine: qcom_bam_dma: add controlled remotely dt property Date: Tue, 1 Dec 2015 11:14:59 +0200 Message-Id: <1448961299-15161-5-git-send-email-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1448961299-15161-1-git-send-email-stanimir.varbanov@linaro.org> References: <1448961299-15161-1-git-send-email-stanimir.varbanov@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151201_011630_842928_72AB7107 X-CRM114-Status: GOOD ( 14.19 ) X-Spam-Score: -2.6 (--) 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: Mark Rutland , Archit Taneja , Pawel Moll , Ian Campbell , Stanimir Varbanov , Rob Herring , Andy Gross 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 --- .../devicetree/bindings/dma/qcom_bam_dma.txt | 2 ++ drivers/dma/qcom_bam_dma.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt index 1c9d48ea4914..87b6b2bf5e1e 100644 --- a/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt +++ b/Documentation/devicetree/bindings/dma/qcom_bam_dma.txt @@ -13,6 +13,8 @@ Required properties: - clock-names: must contain "bam_clk" entry - qcom,ee : indicates the active Execution Environment identifier (0-7) used in the secure world. +- qcom,controlled-remotely : optional, indicates that the bam is controled by + remote proccessor i.e. execution enviroment. Example: diff --git a/drivers/dma/qcom_bam_dma.c b/drivers/dma/qcom_bam_dma.c index 6d290de9ab2b..5dedab77180a 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; @@ -1039,6 +1040,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)); @@ -1126,6 +1130,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);