From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Rutland Date: Wed, 15 Apr 2015 14:10:58 +0100 Subject: [U-Boot] [PATCH 1/2] armv8: caches: Disable dcache after flush In-Reply-To: References: Message-ID: <20150415131058.GG2866@leverpostej> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Apr 15, 2015 at 12:33:00PM +0100, Michal Simek wrote: > From: Siva Durga Prasad Paladugu > > Always disable dcache after the flush operation > The following sequence is advisable while disabling d-cache: > 1. disable_dcache() - flushes and disables d-cache > 2. invalidate_dcache_all() - invalid any entry that came to the cache > in the short period after the cache was flushed but before the > cache got disabled For reasons I have described previously (see [1,2,3]), this is unsafe. The first cache flush may achieve nothing. If you need data out at the PoC before disabling the cache, then you should first use maintenance by VA to push that data out. Thanks, Mark. [1] http://lists.denx.de/pipermail/u-boot/2015-February/204403.html [2] http://lists.denx.de/pipermail/u-boot/2015-February/204407.html [3] http://lists.denx.de/pipermail/u-boot/2015-February/204702.html > > Signed-off-by: Siva Durga Prasad Paladugu > Signed-off-by: Michal Simek > --- > > arch/arm/cpu/armv8/cache_v8.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/cpu/armv8/cache_v8.c b/arch/arm/cpu/armv8/cache_v8.c > index c5ec5297cd39..2a0492fbef52 100644 > --- a/arch/arm/cpu/armv8/cache_v8.c > +++ b/arch/arm/cpu/armv8/cache_v8.c > @@ -128,10 +128,10 @@ void dcache_disable(void) > if (!(sctlr & CR_C)) > return; > > - set_sctlr(sctlr & ~(CR_C|CR_M)); > - > flush_dcache_all(); > __asm_invalidate_tlb_all(); > + > + set_sctlr(sctlr & ~(CR_C|CR_M)); > } > > int dcache_status(void) > -- > 2.3.5 > > _______________________________________________ > U-Boot mailing list > U-Boot at lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot >