From owner-svn-src-all@FreeBSD.ORG Mon Dec 31 22:18:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68ECDCE8; Mon, 31 Dec 2012 22:18:26 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id F0F9C8FC08; Mon, 31 Dec 2012 22:18:25 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Tpngc-000Icr-Rv; Mon, 31 Dec 2012 14:18:24 -0800 Message-ID: <50E20F2B.7080704@freebsd.org> Date: Mon, 31 Dec 2012 14:18:19 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Andrew Turner Subject: Re: svn commit: r244914 - in head/sys/arm: arm include ti/omap4 References: <201212312119.qBVLJi3V009555@svn.freebsd.org> <20130101105353.14492943@fubar.geek.nz> In-Reply-To: <20130101105353.14492943@fubar.geek.nz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 12/31/2012 1:53 PM, Andrew Turner wrote: > On Mon, 31 Dec 2012 21:19:44 +0000 (UTC) > Oleksandr Tymoshenko wrote: >> Modified: head/sys/arm/arm/pl310.c >> ============================================================================== >> --- head/sys/arm/arm/pl310.c Mon Dec 31 21:09:39 2012 >> (r244913) +++ head/sys/arm/arm/pl310.c Mon Dec 31 21:19:44 > ... >> @@ -157,29 +131,46 @@ pl310_wait_background_op(uint32_t off, u >> static __inline void >> pl310_cache_sync(void) >> { >> - pl310_write4(PL310_CACHE_SYNC, 0); >> + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) >> + return; >> + >> +#ifdef PL310_ERRATA_753970 >> + /* Write uncached PL310 register */ >> + pl310_write4(pl310_softc, 0x740, 0xffffffff); >> +#else >> + pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); >> +#endif >> } > How hard would it be to detect if we need this errata at boot? From the > errata document it appears to only be present in the r3p0 revision of > the controller. We can then do something like: > > #ifdef PL310_ERRATA_753970 > if (errata_753970) > pl310_write4(pl310_softc, 0x740, 0xffffffff); > else > #endif > pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Dec 2012 22:18:26 -0000 On 12/31/2012 1:53 PM, Andrew Turner wrote: > On Mon, 31 Dec 2012 21:19:44 +0000 (UTC) > Oleksandr Tymoshenko wrote: >> Modified: head/sys/arm/arm/pl310.c >> ============================================================================== >> --- head/sys/arm/arm/pl310.c Mon Dec 31 21:09:39 2012 >> (r244913) +++ head/sys/arm/arm/pl310.c Mon Dec 31 21:19:44 > ... >> @@ -157,29 +131,46 @@ pl310_wait_background_op(uint32_t off, u >> static __inline void >> pl310_cache_sync(void) >> { >> - pl310_write4(PL310_CACHE_SYNC, 0); >> + if ((pl310_softc == NULL) || !pl310_softc->sc_enabled) >> + return; >> + >> +#ifdef PL310_ERRATA_753970 >> + /* Write uncached PL310 register */ >> + pl310_write4(pl310_softc, 0x740, 0xffffffff); >> +#else >> + pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); >> +#endif >> } > How hard would it be to detect if we need this errata at boot? From the > errata document it appears to only be present in the r3p0 revision of > the controller. We can then do something like: > > #ifdef PL310_ERRATA_753970 > if (errata_753970) > pl310_write4(pl310_softc, 0x740, 0xffffffff); > else > #endif > pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); > > I think we can use RTL release field of Cache ID register to determine actual hardware release and act accordingly.