From patchwork Thu Jul 17 16:38:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Figa X-Patchwork-Id: 4577341 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 363899F1D6 for ; Thu, 17 Jul 2014 16:42:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DFF120120 for ; Thu, 17 Jul 2014 16:42:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71FAE2008F for ; Thu, 17 Jul 2014 16:42:26 +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 1X7ojN-0004Ah-CU; Thu, 17 Jul 2014 16:40:29 +0000 Received: from mailout4.w1.samsung.com ([210.118.77.14]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X7oj7-000314-M0 for linux-arm-kernel@lists.infradead.org; Thu, 17 Jul 2014 16:40:14 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8V00BQ77M52M00@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 17 Jul 2014 17:39:41 +0100 (BST) X-AuditID: cbfec7f4-b7fac6d000006cfe-c1-53c7fc55d499 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 48.96.27902.55CF7C35; Thu, 17 Jul 2014 17:39:49 +0100 (BST) Received: from AMDC1227.digital.local ([106.116.147.199]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N8V00HDB7M9BP70@eusync3.samsung.com>; Thu, 17 Jul 2014 17:39:49 +0100 (BST) From: Tomasz Figa To: linux-samsung-soc@vger.kernel.org Subject: [PATCH v3 2/7] ARM: l2c: Add interface to ask hypervisor to configure L2C Date: Thu, 17 Jul 2014 18:38:57 +0200 Message-id: <1405615142-21426-3-git-send-email-t.figa@samsung.com> X-Mailer: git-send-email 1.9.3 In-reply-to: <1405615142-21426-1-git-send-email-t.figa@samsung.com> References: <1405615142-21426-1-git-send-email-t.figa@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMLMWRmVeSWpSXmKPExsVy+t/xq7qhf44HG+w/ZG7xaP5jZoveBVfZ LLZ3zmC3mPJnOZPFpsfXWC0u75rDZjF7ST+LxYzz+5gsbl/mtTi3fQuLxdojd9ktXvetYbZY P+M1i8WqXX8YLfZf8XLg92hp7mHz+PZ1EovH5b5eJo9F37M8ds66y+5x59oeNo/NS+o9+ras YvQ4fmM7k8fnTXIBXFFcNimpOZllqUX6dglcGaevrWMsuM9T0fIwuIHxKFcXIyeHhICJxPZb v1kgbDGJC/fWs3UxcnEICSxllOh/doEFwuljkvj27Q0zSBWbgJrE54ZHbCC2iICqxOe2Bewg RcwCB5glLmx6ADZKWCBE4uzfM4wgNgtQUeOpXrBmXgEnieUds5kh1slJ9G6DGMop4Cwxd/9j sKFCQDVb2hYwTWDkXcDIsIpRNLU0uaA4KT3XUK84Mbe4NC9dLzk/dxMjJKC/7GBcfMzqEKMA B6MSD2/n52PBQqyJZcWVuYcYJTiYlUR4s+8fDxbiTUmsrEotyo8vKs1JLT7EyMTBKdXA6M/U c1sh14fhz+Zdn8O3fWJZcaKVZcHFX2F6S6YGhM3xDGK09W7u/qsWysc5cfHezAI+PZ+NCdWP z8b9mrcj9VMh/1vu8Merlh2dp7qH4+4Wh10Pu9m+7I32+n2T8bWJ6ZIHp+6wl/47/EllzxXN Ak1n7eeHJ89xjF9UZW+7q+luuHhpifjhG0osxRmJhlrMRcWJABIFMXdGAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140717_094013_866145_FDC57EAE X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -5.0 (-----) Cc: Kukjin Kim , lauraa@codeaurora.org, tony@atomide.com, linus.walleij@linaro.org, linux-kernel@vger.kernel.org, drake@endlessm.com, loeliger@gmail.com, santosh.shilimkar@ti.com, Russell King - ARM Linux , linux-omap@vger.kernel.org, Tomasz Figa , Tomasz Figa , linux-arm-kernel@lists.infradead.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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 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 --- arch/arm/include/asm/outercache.h | 3 +++ arch/arm/mm/cache-l2x0.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index 891a56b..563b92f 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 385c047..21a625a0 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -109,6 +109,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);