From patchwork Wed Sep 24 11:05:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 37808 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AE301202DB for ; Wed, 24 Sep 2014 11:08:28 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id s18sf5260615lam.9 for ; Wed, 24 Sep 2014 04:08:27 -0700 (PDT) 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=upOwNQFPvj8A+TPJEkojmdZcSa/FrvxHCjvQA9YMJUo=; b=C045jeQ6R0ebecOSSXMiKXgQOZcd/V55VttE6dfbOoOdTlQgegFyUCTUAhHjYDd0pT avQc97bOWQUglykiu4iB49KPqgXB8rLkzO1DpnGKJKaLfz4J3RUGPeXyzXNEip9+Bpiw V9VrnpA2ORM+3nU2wD6uCTZj9aYeGTULddLhXnLwAx4QHB9E4gGJJ0T9WfweTRP3SwkL Y6FmN14yAkeG5XH6o8xbFKrIAXiH0Acmds/1pEbafUWdpBtws8MSjTil2unZVPj0y8LR L85uRW+1c1IqNMKnglxC3sNwK/J+QMkctrybKqKhHIuyh8gXexhSZy3LNq3ZjmcTXrta eKeA== X-Gm-Message-State: ALoCoQmlPY7N58kxZGUWbE2TFds6LVrO1uOC5+Bwxy0kln5lMaChEsmmuU+EHlazCaLfCOgwtfTm X-Received: by 10.152.26.225 with SMTP id o1mr899815lag.4.1411556906982; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.71 with SMTP id t7ls150303lae.60.gmail; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) X-Received: by 10.112.128.135 with SMTP id no7mr4980517lbb.74.1411556906839; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id uq6si22445583lbc.21.2014.09.24.04.08.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 24 Sep 2014 04:08:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id b12so10306012lbj.39 for ; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) X-Received: by 10.112.76.6 with SMTP id g6mr5554258lbw.22.1411556906737; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) 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.130.169 with SMTP id of9csp562536lbb; Wed, 24 Sep 2014 04:08:26 -0700 (PDT) X-Received: by 10.68.125.202 with SMTP id ms10mr8106012pbb.71.1411556905271; Wed, 24 Sep 2014 04:08:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ig8si25053035pad.95.2014.09.24.04.08.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Sep 2014 04:08:25 -0700 (PDT) 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 1XWkPh-00032V-Tt; Wed, 24 Sep 2014 11:07:13 +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 1XWkOl-0002M7-4D for linux-arm-kernel@lists.infradead.org; Wed, 24 Sep 2014 11:06:15 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) 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 <0NCE00EEOKACZZ70@mailout4.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Sep 2014 12:08:36 +0100 (BST) X-AuditID: cbfec7f5-b7f776d000003e54-3e-5422a58c2270 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 23.F0.15956.C85A2245; Wed, 24 Sep 2014 12:05:48 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NCE00JS4K5ISSA0@eusync4.samsung.com>; Wed, 24 Sep 2014 12:05:48 +0100 (BST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v5 2/7] ARM: l2c: Add interface to ask hypervisor to configure L2C Date: Wed, 24 Sep 2014 13:05:36 +0200 Message-id: <1411556741-5810-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1411556741-5810-1-git-send-email-m.szyprowski@samsung.com> References: <1411556741-5810-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMLMWRmVeSWpSXmKPExsVy+t/xa7o9S5VCDA4sYLV4NP8xs0Xvgqts Fmeb3rBbbO+cwW4x5c9yJotNj6+xWlzeNYfNYvaSfhaLGef3MVncvsxrcW77FhaLtUfuslu8 7lvDbLFq1x9Gi/1XvBz4PVqae9g8vn2dxOJxua+XyWPR9yyPnbPusnvcubaHzWPzknqPvi2r GD2O39jO5PF5k1wAVxSXTUpqTmZZapG+XQJXxrrHO1gKHvNXvLmyiaWBsY+3i5GTQ0LARGLn o21sELaYxIV764FsLg4hgaWMEscOHWWCcPqYJFZP2g9WxSZgKNH1tgvMFhHIlvjxbTILSBGz QCuzxOMn31hBEsICIRL9a/8yg9gsAqoSD/e8A2vgFXCXmLB5DxPEOjmJ/y9XgNmcAh4Sjx// Y+xi5ADa5i7RtMllAiPvAkaGVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxghAf11B+PSY1aH GAU4GJV4eCeKK4UIsSaWFVfmHmKU4GBWEuF91QMU4k1JrKxKLcqPLyrNSS0+xMjEwSnVwGjS v7xJ4MDU244FIm67BF9aLwmdPC1Jp+/JQg3GdfdKF+id0b40uTh43dFm2WTn7Vryaq63Cm+k fPva7BLitbP9it/cst0pzkLOvnez+su3Jq2pW9H1ayaHeoKd/W/e81IH90u7Vvewmd3seL6d Y7nb8ro7O+/6fk/LOby86iCPtitv+XODP0osxRmJhlrMRcWJAGKF6ldGAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140924_040615_344185_E0218C0F X-CRM114-Status: GOOD ( 13.26 ) X-Spam-Score: -5.7 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.14 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.14 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Kukjin Kim , lauraa@codeaurora.org, tony@atomide.com, linus.walleij@linaro.org, Tomasz Figa , drake@endlessm.com, loeliger@gmail.com, Kyungmin Park , santosh.shilimkar@ti.com, Russell King - ARM Linux , 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.217.180 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 b0735634f12c..84c6c55ab896 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); @@ -909,6 +914,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);