From patchwork Tue May 12 14:48:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 11543321 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FAF3139F for ; Tue, 12 May 2020 14:49:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 03006206D3 for ; Tue, 12 May 2020 14:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YVvU5cm8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 03006206D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UEILzvaWGryHQ+SZ+GvBPlVxjdyNZtQUKT67//1oGd4=; b=YVvU5cm8n70kKS jcQfOqNhUWGOzp4zaTCanSgtGVQ7nxszpL/P2g5lqeNVE/TX5OblRCdoUH1Sez/X/3cf8l4u1Rgta QGCfMly+uPeKYBps8QnS60hK/2ZeeXdVGeQDA8toV6MvfuT+jrj1ZYG47hX9iMRoIcc/iPwObUu8Y vwQHK7iLeFb45AFrtDaQFWaI/feYjW8bPwQt2pRMuZMBwDj57GWehcsK1ivnZyQWC1oGYxJsfAK4L 8HrxDLunx76RqJXIEvOCA7R3ZGTSGQ46RV21V/hInv2gZa/5Y8dFHmpNJ258SiIwB3dd4gWaYwZh4 Gn0+lMhIp6EK8Y0o5RMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWDY-0006XO-BL; Tue, 12 May 2020 14:49:12 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWD6-00067y-Pp for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 14:48:47 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 24BEEAC58; Tue, 12 May 2020 14:48:43 +0000 (UTC) From: Mian Yousaf Kaukab To: swarren@wwwdotorg.org, robh+dt@kernel.org, robin.murphy@arm.com Subject: [PATCH 1/4] misc: sram: add support for remapping reserved regions only Date: Tue, 12 May 2020 16:48:00 +0200 Message-Id: <20200512144803.24344-1-ykaukab@suse.de> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_074845_145826_96001C89 X-CRM114-Status: GOOD ( 18.17 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, Mian Yousaf Kaukab , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, talho@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org, afaerber@suse.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Some SRAM kernel users may be interested in SRAM’s reserved regions only, though a bigger SRAM is available on the platform. Add an optional flag 'reserved-only' which allows to ioremap reserved regions only. Rest of SRAM is not remapped. ioremap type is selected depending upon no-memory-wc as usual. Signed-off-by: Mian Yousaf Kaukab --- *Tested only on Jetson TX2. Jetson AGX Xavier is untested.* drivers/misc/sram.c | 73 ++++++++++++++++++++++++++++++++++----------- drivers/misc/sram.h | 3 ++ 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 6c1a23cb3e8c..44e459f39e22 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -97,7 +97,7 @@ static int sram_add_partition(struct sram_dev *sram, struct sram_reserve *block, struct sram_partition *part = &sram->partition[sram->partitions]; mutex_init(&part->lock); - part->base = sram->virt_base + block->start; + part->base = block->virt_start; if (block->pool) { ret = sram_add_pool(sram, block, start, part); @@ -153,6 +153,25 @@ static int sram_reserve_cmp(void *priv, struct list_head *a, return ra->start - rb->start; } +static int sram_remap_resource(struct sram_dev *sram, + struct resource *res, void __iomem **virt) +{ + void __iomem *addr; + + if (sram->no_memory_wc) + addr = devm_ioremap_resource(sram->dev, res); + else + addr = devm_ioremap_resource_wc(sram->dev, res); + + if (IS_ERR(addr)) { + dev_err(sram->dev, "could not map SRAM region\n"); + return PTR_ERR(addr); + } + + *virt = addr; + return 0; +} + static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) { struct device_node *np = sram->dev->of_node, *child; @@ -239,6 +258,16 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) block->start, block->start + block->size); } + /* ioremap reserved block as whole sram is not remapped */ + if (sram->reserved_only) { + ret = sram_remap_resource(sram, &child_res, + &block->virt_start); + if (ret) + goto err_chunks; + } else { + block->virt_start = sram->virt_base + block->start; + } + block++; } child = NULL; @@ -282,8 +311,11 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res) } } - /* current start is in a reserved block, so continue after it */ - if (block->start == cur_start) { + /* + * Current start is in a reserved block, so continue after it. + * Or if only using reserved blocks + */ + if (block->start == cur_start || sram->reserved_only) { cur_start = block->start + block->size; continue; } @@ -342,6 +374,7 @@ static int sram_probe(struct platform_device *pdev) struct sram_dev *sram; int ret; int (*init_func)(void); + struct resource *res; sram = devm_kzalloc(&pdev->dev, sizeof(*sram), GFP_KERNEL); if (!sram) @@ -349,19 +382,22 @@ static int sram_probe(struct platform_device *pdev) sram->dev = &pdev->dev; - if (of_property_read_bool(pdev->dev.of_node, "no-memory-wc")) - sram->virt_base = devm_platform_ioremap_resource(pdev, 0); - else - sram->virt_base = devm_platform_ioremap_resource_wc(pdev, 0); - if (IS_ERR(sram->virt_base)) { - dev_err(&pdev->dev, "could not map SRAM registers\n"); - return PTR_ERR(sram->virt_base); - } + sram->no_memory_wc = + of_property_read_bool(pdev->dev.of_node, "no-memory-wc"); + sram->reserved_only = + of_property_read_bool(pdev->dev.of_node, "reserved-only"); - sram->pool = devm_gen_pool_create(sram->dev, ilog2(SRAM_GRANULARITY), - NUMA_NO_NODE, NULL); - if (IS_ERR(sram->pool)) - return PTR_ERR(sram->pool); + if (!sram->reserved_only) { + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + ret = sram_remap_resource(sram, res, &sram->virt_base); + if (ret) + return ret; + + sram->pool = devm_gen_pool_create(sram->dev, + ilog2(SRAM_GRANULARITY), NUMA_NO_NODE, NULL); + if (IS_ERR(sram->pool)) + return PTR_ERR(sram->pool); + } sram->clk = devm_clk_get(sram->dev, NULL); if (IS_ERR(sram->clk)) @@ -383,8 +419,9 @@ static int sram_probe(struct platform_device *pdev) goto err_free_partitions; } - dev_dbg(sram->dev, "SRAM pool: %zu KiB @ 0x%p\n", - gen_pool_size(sram->pool) / 1024, sram->virt_base); + if (sram->pool) + dev_dbg(sram->dev, "SRAM pool: %zu KiB @ 0x%p\n", + gen_pool_size(sram->pool) / 1024, sram->virt_base); return 0; @@ -403,7 +440,7 @@ static int sram_remove(struct platform_device *pdev) sram_free_partitions(sram); - if (gen_pool_avail(sram->pool) < gen_pool_size(sram->pool)) + if (sram->pool && gen_pool_avail(sram->pool) < gen_pool_size(sram->pool)) dev_err(sram->dev, "removed while SRAM allocated\n"); if (sram->clk) diff --git a/drivers/misc/sram.h b/drivers/misc/sram.h index 9c1d21ff7347..a485fa29458b 100644 --- a/drivers/misc/sram.h +++ b/drivers/misc/sram.h @@ -23,6 +23,8 @@ struct sram_dev { struct sram_partition *partition; u32 partitions; + bool no_memory_wc; + bool reserved_only; }; struct sram_reserve { @@ -33,6 +35,7 @@ struct sram_reserve { bool pool; bool protect_exec; const char *label; + void __iomem *virt_start; }; #ifdef CONFIG_SRAM_EXEC From patchwork Tue May 12 14:48:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 11543319 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4FBF15AB for ; Tue, 12 May 2020 14:48:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73C36206D6 for ; Tue, 12 May 2020 14:48:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i6WtjLt/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73C36206D6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2NeARtuPNCpHLj/87KHUGH8qp/0aT2dvc9JJnqFg2Uk=; b=i6WtjLt/m6eZnS 1/w7IyEOIZ4I4L5TprXvNssorthXv6JuSjQKDaxSVsbfVJurIfN4XHrc/QEz8FCPUpAFNWeUdYPmF u7P6UKiWjT5qDWkIF0IpiMNY2cNk8layKaIdk6XpMqyTzAEwMVDBQRr2j4fGyUmixBCx2G9o8zLOk vG5ewIhp9waXJA5jSDbre+enBJ9jUsb+KyWts3HbmljJJz/R+RPV86T6OQZbgZb3E1MFnkE0Kh1vU ZxZR8b7tq+44ehCMPFHMRYY2qOwN3PNRNX1M5vWdld5b7Wzw6cVN15/mMNn+GbC9c/Q+Wj+DxyCM7 Wvbxb795Hr4iNyQAYY3A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWDI-0006IJ-7u; Tue, 12 May 2020 14:48:56 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWD6-00068I-Pp for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 14:48:46 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 93249ACCE; Tue, 12 May 2020 14:48:43 +0000 (UTC) From: Mian Yousaf Kaukab To: swarren@wwwdotorg.org, robh+dt@kernel.org, robin.murphy@arm.com Subject: [PATCH 2/4] dt-bindings: sram: add documentation for reserved-only flag Date: Tue, 12 May 2020 16:48:01 +0200 Message-Id: <20200512144803.24344-2-ykaukab@suse.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200512144803.24344-1-ykaukab@suse.de> References: <20200512144803.24344-1-ykaukab@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_074844_985914_364C7590 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, Mian Yousaf Kaukab , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, talho@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org, afaerber@suse.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add documentation for the new optional flag added for SRAM driver. Signed-off-by: Mian Yousaf Kaukab --- Documentation/devicetree/bindings/sram/sram.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentation/devicetree/bindings/sram/sram.yaml index 19d116ff9ddc..4bcc309fa841 100644 --- a/Documentation/devicetree/bindings/sram/sram.yaml +++ b/Documentation/devicetree/bindings/sram/sram.yaml @@ -55,6 +55,12 @@ properties: as write combining. WC is used by default. type: boolean + reserved-only: + description: + The flag indicating, that only SRAM reserved regions have to be remapped. + remapping type is selected depending upon no-memory-wc as usual. + type: boolean + patternProperties: "^([a-z]*-)?sram(-section)?@[a-f0-9]+$": type: object From patchwork Tue May 12 14:48:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 11543317 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4C90E139F for ; Tue, 12 May 2020 14:48:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2A1F1206A5 for ; Tue, 12 May 2020 14:48:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c6YmTj1/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2A1F1206A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AeC54esBc12u6Kzpw30MDg1jAiAznUKGOE4T49F4kBw=; b=c6YmTj1/X1xoe5 +3qcNo2hHoPWYfn3H1TP3UEX2zsfiYKIIJUIaMPdeXV6MmmAXNXsWPqiE1QO7i2nx+jBfAztd4UDd d3jvyL87L85ZIm9wIqkD77AWe3GHYgfwRANKnX5vsTKfMQdPlzbk0BoxbeeFo1G4SxEHg/KA8r92Y Mcbxa8YE6/UxU2DycY1DU+wsYNrHzmzjibCjPS8tw7Z18HdQLuyLr4BjsSWeb3SFvB82cFEuOhBPj D5cOB67nTx0X1L2flrfr/g17Or37AjgM1yk3OVZ5vT0mtgQd4Dpvb/jd8pTVjhEJkqNwvvwgaDPHo U6ve9OUgvLce01h1c9Pg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWD9-00069l-5G; Tue, 12 May 2020 14:48:47 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWD6-00068K-Po for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 14:48:46 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 0E9E4ACC3; Tue, 12 May 2020 14:48:44 +0000 (UTC) From: Mian Yousaf Kaukab To: swarren@wwwdotorg.org, robh+dt@kernel.org, robin.murphy@arm.com Subject: [PATCH 3/4] arm64: tegra186: add reserved-only flag in sysram node Date: Tue, 12 May 2020 16:48:02 +0200 Message-Id: <20200512144803.24344-3-ykaukab@suse.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200512144803.24344-1-ykaukab@suse.de> References: <20200512144803.24344-1-ykaukab@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_074844_988927_F2499E83 X-CRM114-Status: GOOD ( 12.65 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, Mian Yousaf Kaukab , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, talho@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org, afaerber@suse.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bpmp driver has reserved regions in sysram. Since sysram is only used by the bpmp driver, add ‘reserved-only’ flag to the sysram node so that only regions used by the bpmp driver are remapped. Other regions of the sysram may not be accessible to the kernel and a speculative access to them can cause SError. Signed-off-by: Mian Yousaf Kaukab --- arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi index 58100fb9cd8b..07ce7e7b270c 100644 --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi @@ -1219,6 +1219,7 @@ sysram@30000000 { #address-cells = <2>; #size-cells = <2>; ranges = <0 0x0 0x0 0x30000000 0x0 0x50000>; + reserved-only; cpu_bpmp_tx: shmem@4e000 { compatible = "nvidia,tegra186-bpmp-shmem"; From patchwork Tue May 12 14:48:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mian Yousaf Kaukab X-Patchwork-Id: 11543323 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 59B6D139F for ; Tue, 12 May 2020 14:49:33 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3807E206D3 for ; Tue, 12 May 2020 14:49:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DsR3VS8L" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3807E206D3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xYT1s6NhLdXEWX8dkUfVu0mWpBJFE07qKyoh/+8++Zo=; b=DsR3VS8LlLrkCf rKzLmrBAiIg6HLM8F/+oK3XDxwOlcKZMUgQANuduOp+SqPL3q/OsmzPO9nny0Gkg8uhTH96XrvVRY yEY+zDxUMvxUGNrt8dA5thq6siYvHPMmnw6pjM2k9rpvs3WQpypJ4NcgTsYTZExjbxdQjghBaY8s2 B5fZ0R8E7GbU4mhKDedWFkmzjMSgKjhfjXOi9ASa6TcAJ/bPV96b7KU/hGVaZSwjRzlFJRe3klV+5 SSTBso1gi3QrvuFV1skAiUViIMIULvmwNIroNx5zYYN2KGq8RcXNKZGvDWHVpz/KERgR/CETNvmsH 3EXPelBQ31Bd50fu0sWg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWDm-0006mz-SR; Tue, 12 May 2020 14:49:26 +0000 Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYWD6-00068L-Pq for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 14:48:47 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7C1A9ACF1; Tue, 12 May 2020 14:48:44 +0000 (UTC) From: Mian Yousaf Kaukab To: swarren@wwwdotorg.org, robh+dt@kernel.org, robin.murphy@arm.com Subject: [PATCH 4/4] arm64: tegra194: add reserved-only flag in sysram node Date: Tue, 12 May 2020 16:48:03 +0200 Message-Id: <20200512144803.24344-4-ykaukab@suse.de> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200512144803.24344-1-ykaukab@suse.de> References: <20200512144803.24344-1-ykaukab@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_074844_997401_8199A88D X-CRM114-Status: GOOD ( 12.55 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org, Mian Yousaf Kaukab , linux-kernel@vger.kernel.org, jonathanh@nvidia.com, talho@nvidia.com, thierry.reding@gmail.com, linux-tegra@vger.kernel.org, afaerber@suse.de, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org bpmp driver has reserved regions in sysram. Since sysram is only used by the bpmp driver, add ‘reserved-only’ flag to the sysram node so that only regions used by the bpmp driver are remapped. Other regions of the sysram may not be accessible to the kernel and a speculative access to them can cause SError. Signed-off-by: Mian Yousaf Kaukab --- arch/arm64/boot/dts/nvidia/tegra194.dtsi | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi index e1ae01c2d039..9a5276d9c2a6 100644 --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi @@ -1743,6 +1743,7 @@ sysram@40000000 { #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0x0 0x40000000 0x50000>; + reserved-only; cpu_bpmp_tx: shmem@4e000 { compatible = "nvidia,tegra194-bpmp-shmem";