From patchwork Mon Nov 17 11:48:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 40913 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DB9B24035 for ; Mon, 17 Nov 2014 11:51:29 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id 10sf11329391lbg.9 for ; Mon, 17 Nov 2014 03:51:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=lUvOVwPccLmw2jQEteOoiHS89y8HxgkaU7CU8hLQw6s=; b=i5gSLFIs9hEBMIeBO5z4yZNe6uPgw55/C6ZpVCCkc6CeCF0zoRizlvyO1UublNXJ08 cAx79vgzRAsR/l05rPQzx6ssRvorwRPaJo/w33a40g36iJCIDbfk4mg6wg1yUXW5Qxkj yj0sXi0EOmlo3jRRxhSj9juhIww7+BR6dWtw0Pa4eBDw8ZePaz1yUy2ky/hupKzP+tYv alJzti8RKFw/k7XugY8hRBHHENqfERLdH2qPwoScS4G6WkTYFsWalh8Vtb+/N8a54byA fXamaAk+rbEhPNBeS60/LZJ0o8PTRv2jdwOdAxy/HTSWLht+GnPnu3Jzul66DxhVlr8u fEZg== X-Gm-Message-State: ALoCoQm1dYDoiiOZE5Is+M8itEeD3TvQQVPYYlFHHNJgecGurUkKjzkCRFaZ4jn2X36/cM4YHLSj X-Received: by 10.180.85.97 with SMTP id g1mr2247565wiz.0.1416225088326; Mon, 17 Nov 2014 03:51:28 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.45.7 with SMTP id i7ls1181705lam.107.gmail; Mon, 17 Nov 2014 03:51:28 -0800 (PST) X-Received: by 10.112.63.133 with SMTP id g5mr26810285lbs.33.1416225088170; Mon, 17 Nov 2014 03:51:28 -0800 (PST) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id p9si51634840lal.21.2014.11.17.03.51.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Nov 2014 03:51:28 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by mail-la0-f53.google.com with SMTP id pn19so1197302lab.26 for ; Mon, 17 Nov 2014 03:51:28 -0800 (PST) X-Received: by 10.152.37.69 with SMTP id w5mr26437625laj.67.1416225088073; Mon, 17 Nov 2014 03:51:28 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp1140140lbc; Mon, 17 Nov 2014 03:51:27 -0800 (PST) X-Received: by 10.68.137.101 with SMTP id qh5mr29546381pbb.13.1416225086439; Mon, 17 Nov 2014 03:51:26 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id rb7si34990288pab.142.2014.11.17.03.51.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 03:51:26 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1XqKow-0004sN-Js; Mon, 17 Nov 2014 11:50:14 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqKno-0002lw-Ub for linux-arm-kernel@lists.infradead.org; Mon, 17 Nov 2014 11:49:05 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NF600FAEM9TJP90@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 17 Nov 2014 11:51:29 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-25-5469e09484be Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id EA.BE.24279.490E9645; Mon, 17 Nov 2014 11:48:36 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NF60089VM4TUL60@eusync2.samsung.com>; Mon, 17 Nov 2014 11:48:36 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v9 2/7] ARM: l2c: Add interface to ask hypervisor to configure L2C Date: Mon, 17 Nov 2014 12:48:24 +0100 Message-id: <1416224909-4290-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1416224909-4290-1-git-send-email-m.szyprowski@samsung.com> References: <1416224909-4290-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGLMWRmVeSWpSXmKPExsVy+t/xK7pTHmSGGMxsULX4O+kYu8Wj+Y+Z LXoXXGWzONv0ht1ie+cMdospf5YzWWx6fI3V4vKuOWwWs5f0s1jMOL+PyeL2ZV6Lc9u3sFis PXKX3WLp9YtMFqeuf2azWLXrD6PF/iteDoIea+atYfRoae5h8/j9axKjx7evk1g8Lvf1Mnks +p7lsXPWXXaPO9f2sHlsXlLvceVEE6tH35ZVjB6fN8kF8ERx2aSk5mSWpRbp2yVwZcyd2s5S 8Ji/Yvr2CcwNjH28XYycHBICJhKzV6xmh7DFJC7cW8/WxcjFISSwlFHi0NWTTBBOH5PEmWfr mUCq2AQMJbredrGB2CICbhL/1h0C62AW+MwscenRGtYuRg4OYYEQiTuTLUBqWARUJTr39jGC 2LwC7hI/p59igtgmJ/H/5Qowm1PAQ+Lb9wNsIK1CQDWtjzgnMPIuYGRYxSiaWppcUJyUnmuk V5yYW1yal66XnJ+7iRES9l93MC49ZnWIUYCDUYmH90BRZogQa2JZcWXuIUYJDmYlEd6Yi0Ah 3pTEyqrUovz4otKc1OJDjEwcnFINjB2PlFNz7C849cwRyMuav/yx4Ie9q+fvWcaodddrgaNx pP+DfZ+7VCuOLLDu0Ml/cEk5SLzlVJ1huWiauZiR3cZvnL9miRlpnJqYs9TPaqvTjhX6l1ym J5S8a7nxKmrd640LAqfM2ftwQm2T/4HlPwPnlR+4rfhd5fLf05IvOY5u6FmQF7jr+HwlluKM REMt5qLiRACfIYPnWQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141117_034905_196249_7CA6492A X-CRM114-Status: GOOD ( 13.22 ) X-Spam-Score: -5.0 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.13 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [210.118.77.13 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Mark Rutland , linux-samsung-soc@vger.kernel.org, Russell King - ARM Linux , Arnd Bergmann , tony@atomide.com, linus.walleij@linaro.org, Tomasz Figa , drake@endlessm.com, loeliger@gmail.com, Kyungmin Park , Kukjin Kim , Olof Johansson , lauraa@codeaurora.org, linux-omap@vger.kernel.org, Marek Szyprowski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Tomasz Figa Because certain secure hypervisor do not allow writes to individual L2C registers, but rather expect set of parameters to be passed as argument to secure monitor calls, there is a need to provide an interface for the L2C driver to ask the firmware to configure the hardware according to specified parameters. This patch adds such. Signed-off-by: Tomasz Figa Signed-off-by: Marek Szyprowski --- arch/arm/include/asm/outercache.h | 3 +++ arch/arm/mm/cache-l2x0.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index 891a56b35bcf..563b92fc2f41 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h @@ -23,6 +23,8 @@ #include +struct l2x0_regs; + struct outer_cache_fns { void (*inv_range)(unsigned long, unsigned long); void (*clean_range)(unsigned long, unsigned long); @@ -36,6 +38,7 @@ struct outer_cache_fns { /* This is an ARM L2C thing */ void (*write_sec)(unsigned long, unsigned); + void (*configure)(const struct l2x0_regs *); }; extern struct outer_cache_fns outer_cache; diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index e5948c5adaa7..d214be207517 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -110,6 +110,11 @@ static inline void l2c_unlock(void __iomem *base, unsigned num) static void l2c_configure(void __iomem *base) { + if (outer_cache.configure) { + outer_cache.configure(&l2x0_saved_regs); + return; + } + if (l2x0_data->configure) l2x0_data->configure(base); @@ -910,6 +915,7 @@ static int __init __l2c_init(const struct l2c_init_data *data, fns = data->outer_cache; fns.write_sec = outer_cache.write_sec; + fns.configure = outer_cache.configure; if (data->fixup) data->fixup(l2x0_base, cache_id, &fns);