From patchwork Thu Apr 10 12:03:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 3964441 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 30D299F336 for ; Thu, 10 Apr 2014 19:32:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61D5620826 for ; Thu, 10 Apr 2014 19:32:01 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (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 EE9A320813 for ; Thu, 10 Apr 2014 19:31:59 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYKhO-0007tj-1q; Thu, 10 Apr 2014 19:31:46 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYKhI-0004rf-Co; Thu, 10 Apr 2014 19:31:40 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYKhG-0004qZ-OB for linux-arm-kernel@merlin.infradead.org; Thu, 10 Apr 2014 19:31:39 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WYDkr-00010a-Eg for linux-arm-kernel@lists.infradead.org; Thu, 10 Apr 2014 12:06:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=SmLuVZWiyaz9Bt5SkwxyGEnHYlZ3I8pkWq3FMkagvCI=; b=C515SUYk1T9PFxhRWWb/5knpSq1sj+f2p5w2FHwTi4Swbb7HEzBw7w7GmqNQ6DMs3H9uy6vI/rmxt1/xRrJhoTQWhXWAkyCwVcBWaVbDihaDnUyprafmXja+CgVhz1PXQ2LyC3x15Xd5kC4xhZ6ITGQNpkCW79qXMYyQpmQ5ZQg=; Received: from n2100.arm.linux.org.uk ([2002:4e20:1eda:1:214:fdff:fe10:4f86]:46156) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1WYDiN-0001Mp-Ap; Thu, 10 Apr 2014 13:04:19 +0100 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1WYDht-0008F2-Aa; Thu, 10 Apr 2014 13:03:49 +0100 Date: Thu, 10 Apr 2014 13:03:48 +0100 From: Russell King - ARM Linux To: Sekhar Nori Subject: Re: [PATCH v2 3/3] ARM: OMAP2+: AM43x: L2 cache support Message-ID: <20140410120348.GK27282@n2100.arm.linux.org.uk> References: <20140404101808.GG27282@n2100.arm.linux.org.uk> <53440D73.6060504@ti.com> <20140409162327.GH27282@n2100.arm.linux.org.uk> <534686DF.7070207@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <534686DF.7070207@ti.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140410_130653_713654_3B4446AF X-CRM114-Status: GOOD ( 27.75 ) X-Spam-Score: -2.3 (--) Cc: Tony Lindgren , Linux OMAP Mailing List , Linux ARM Mailing List X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,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 On Thu, Apr 10, 2014 at 05:26:15PM +0530, Sekhar Nori wrote: > On Wednesday 09 April 2014 09:53 PM, Russell King - ARM Linux wrote: > > That is required because as part of the enable sequence, we write to the > > lockdown registers to clear out anything that may be there before we > > enable the L2 cache. If we didn't set the NS lockdown bit, then we > > would need the secure monitor to do it for us. > > And I realized yesterday that the only reason L2C is working on AM437x > is because AM437x ROM is setting these bits up for us. > > > Both of these bits should be managed within the L2C code rather than by > > platforms. > > The current L2C code is not managing the NS_LOCKDOWN bit. I can take a > shot at adding this support unless you are already looking at it. True, and I'm aware that it's missing. So... how about this on top of my series so far. We can deal with L310_AUX_CTRL_NS_INT_CTRL when the need to access those registers arises (if/when the edac driver is submitted.) diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c index c0f9a81a2d32..4a494cde8367 100644 --- a/arch/arm/mach-omap2/omap4-common.c +++ b/arch/arm/mach-omap2/omap4-common.c @@ -213,8 +213,6 @@ static int __init omap_l2_cache_init(void) /* 16-way associativity, parity disabled, way size - 64KB (es2.0 +) */ aux_ctrl = L310_AUX_CTRL_CACHE_REPLACE_RR | - L310_AUX_CTRL_NS_LOCKDOWN | - L310_AUX_CTRL_NS_INT_CTRL | L2C_AUX_CTRL_SHARED_OVERRIDE | L310_AUX_CTRL_DATA_PREFETCH | L310_AUX_CTRL_INSTR_PREFETCH; diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c index 98796b789eb9..837f384c1d51 100644 --- a/arch/arm/mm/cache-l2x0.c +++ b/arch/arm/mm/cache-l2x0.c @@ -776,6 +776,13 @@ static void __init l2c310_enable(void __iomem *base, u32 aux, unsigned num_lock) power_ctrl & L310_STNDBY_MODE_EN ? "en" : "dis"); } + /* + * Always enable non-secure access to the lockdown registers - + * we write to them as part of the L2C enable sequence so they + * need to be accessible. + */ + aux |= L310_AUX_CTRL_NS_LOCKDOWN; + l2c_enable(base, aux, num_lock); if (aux & L310_AUX_CTRL_FULL_LINE_ZERO) {