From patchwork Mon Oct 27 11:05:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 39603 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5D0B2118A for ; Mon, 27 Oct 2014 11:08:21 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf4081360lbv.0 for ; Mon, 27 Oct 2014 04:08:20 -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=jHl1WDj/NPlN+1bhxD+1ml6uImXWreQkTf8V534LP/0=; b=PqnkNwo3JyIP50tCDRoEt6Q/hEsHMhzVA8AhEPnbKflCH1c2/KqywnD133sI9Isf3u 8PaYp7E4bGelnjGrSt8Ep+OTRaNRVvUl7s2e6/t1cdY1PN9lBH0ufxRrbi7hHXPje51v j4PUkHcRRywFEZdBEEygbYVKcaitrRphAm6HnI6N1a4Q6+A84LErdK/L4syyYpRioX/i Kn8CPyD1715UcL6JZRpmCTEECcSwAI97zx07PrzKOXlFH9JD4a4GJMopjSDrfIkOtWHc qARnONP2p6x0vLN3oDCDVGK4ddL81MJr2JXGLnJ+D+fHrC5nVbzWZplfVRa68ebJBadf s3rg== X-Gm-Message-State: ALoCoQlI+C6HW9ITNLz5FE6Y8VSmgasM7nS2uhQ7dJbtC4kMoTfhi0rbynIPJZJKydVhN/JQkMc0 X-Received: by 10.194.242.36 with SMTP id wn4mr254275wjc.4.1414408100500; Mon, 27 Oct 2014 04:08:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.18.226 with SMTP id z2ls39240lad.13.gmail; Mon, 27 Oct 2014 04:08:19 -0700 (PDT) X-Received: by 10.152.4.132 with SMTP id k4mr22852343lak.1.1414408099767; Mon, 27 Oct 2014 04:08:19 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id xs7si19437378lbb.34.2014.10.27.04.08.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 27 Oct 2014 04:08:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id q1so2438313lam.10 for ; Mon, 27 Oct 2014 04:08:18 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr22384735lbb.74.1414408098935; Mon, 27 Oct 2014 04:08:18 -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.84.229 with SMTP id c5csp268183lbz; Mon, 27 Oct 2014 04:08:17 -0700 (PDT) X-Received: by 10.68.232.233 with SMTP id tr9mr23145529pbc.52.1414408096855; Mon, 27 Oct 2014 04:08:16 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id dl9si2307978pdb.113.2014.10.27.04.08.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2014 04:08:16 -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 1Xii8F-0005p4-2J; Mon, 27 Oct 2014 11:06:39 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xii7z-0005Me-FB for linux-arm-kernel@lists.infradead.org; Mon, 27 Oct 2014 11:06:24 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NE300LWJOARJ110@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 27 Oct 2014 11:08:51 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-ef-544e27140858 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 13.B8.24279.4172E445; Mon, 27 Oct 2014 11:05:56 +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 <0NE300JBOO5RPJ10@eusync2.samsung.com>; Mon, 27 Oct 2014 11:05:56 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v6 2/7] ARM: l2c: Add interface to ask hypervisor to configure L2C Date: Mon, 27 Oct 2014 12:05:45 +0100 Message-id: <1414407950-3029-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1414407950-3029-1-git-send-email-m.szyprowski@samsung.com> References: <1414407950-3029-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrNLMWRmVeSWpSXmKPExsVy+t/xK7oi6n4hBrvaTS0ezX/MbNG74Cqb xdmmN+wW2ztnsFtM+bOcyWLT42usFpd3zWGzmL2kn8Vixvl9TBa3L/NanNu+hcVi7ZG77BZL r19ksnjdt4bZYtWuP4wW+694OQh4rJm3htGjpbmHzePb10ksHpf7epk8Fn3P8tg56y67x51r e9g8Ni+p9+jbsorR4/iN7UwenzfJBXBHcdmkpOZklqUW6dslcGV8+y5T8Ji/4tjS+UwNjH28 XYwcHBICJhLfnzB2MXICmWISF+6tZ+ti5OIQEljKKLHrwDRWCKePSWLiiQ6wKjYBQ4mut11s ILaIQLbEj2+TWUCKmAVWMUtMObCOFSQhLBAisenVWmYQm0VAVWLX1yPsINt4Bdwlbt7Rgdgm J/H/5QomEJtTwENicstMMFsIqGTVh72MExh5FzAyrGIUTS1NLihOSs810itOzC0uzUvXS87P 3cQICfCvOxiXHrM6xCjAwajEwzuh2DdEiDWxrLgy9xCjBAezkgiv40+gEG9KYmVValF+fFFp TmrxIUYmDk6pBsbb5auuzd52hXHtFf45XZP4MxP+pHe90dQ7cfVIek5F/umV7xfsf3Pi4N+f UUfn3c59Wrph30SNyxkXTx47zqWUxPvxZ4BF1BfOSDfTaTlXxeUNf3Qx/tJafygtyy7OIuVW uLrT6YhX1spf3K8EKjzizbIw7Ey+XN4RYWiqbMHkz6q/8IXjhUglluKMREMt5qLiRAAPzUyH TgIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141027_040623_745779_F73BF3BE X-CRM114-Status: GOOD ( 12.86 ) X-Spam-Score: -5.6 (-----) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-5.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [210.118.77.11 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [210.118.77.11 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Mark Rutland , 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.215.51 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 4286ee9bb3bd..ad981894de73 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);