From patchwork Mon Jun 20 01:43:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 637772 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rXttX4Pkvz9s9x for ; Mon, 20 Jun 2016 11:43:48 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b=Grz3VhNv; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA104A76A6; Mon, 20 Jun 2016 03:43:45 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fst_Qv84PHpG; Mon, 20 Jun 2016 03:43:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA0F2A7621; Mon, 20 Jun 2016 03:43:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71490A7659 for ; Mon, 20 Jun 2016 03:43:35 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vugYdRordIw5 for ; Mon, 20 Jun 2016 03:43:35 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) by theia.denx.de (Postfix) with ESMTPS id 367A0A7697 for ; Mon, 20 Jun 2016 03:43:25 +0200 (CEST) Received: by mail-it0-f43.google.com with SMTP id z189so35469052itg.0 for ; Sun, 19 Jun 2016 18:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=iWp3aXNdUT5XNSdT2o0B+K31PQFSslkvOuXP4GtBGlU=; b=Grz3VhNvoP/uCeStYVzH8UoJAInAVMSCWCcnyvbpryjzYWsLtlM5VBy4oI4QASnQ5k N8tH3aJxqJUKB8D6oYSE+z5RdUg5/9uJy/hfsZ60HfyFmWRrt+bgc8dtx9dQFuS0rBp/ SCQ7igkbx6LyJ8EjtQ0pMIEbkhAdcoBXAQVEph9RCK/h82jFMnAbYKZ8z5tZZi/rWHIq T1y7SAJU+SAQVVY3HrqM/InJkpzGPhYL8X6bI57vlTLgzSvczthHN5ErXIKBf2lQOe/i lsh1MMLTcnewlwhjgCgQTT1zzaywPiULXSvUImSMLsQ8gD3SLQ8OUpIBUWfGw0sjwSW+ Xurg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=iWp3aXNdUT5XNSdT2o0B+K31PQFSslkvOuXP4GtBGlU=; b=YvITBxrmygA5SOeSos9XnLJqPvU9Z1xfCc23R7K2JG3tF4+oZR2pHt28087osjACn0 FwXUr0KTBsXTCpAYSLMyKXzt0lLe4OgeKHEMLydX7UTHzqXpzhmhROqXhT3Lemb0zU5K 3RQsKs0VEvWEXgBi5yzt2T14524foZZECiJfVqySw6ZwkF7O8LCh1aZ9EzYc7abOBfWj Y4gtHCmL5YE4o6ucLyEwOGMxM0nZBBaDEkdFeJdsodbQF7P9OOVIjbhhz90wRwS+DmPb 3G2FLBxVmnshqAyBXjiZhzfqxuxcmAqKNGvYvbGdTnwSK6rUWAshNpW/P/FAV6kCSQzz 8Dsw== X-Gm-Message-State: ALyK8tKLfG507NHmfW8ZikHFo0PUeSO/KJe9F2wDJA6IDeyaStEe/hf4XksYDP9UTQ5BQVye X-Received: by 10.36.20.196 with SMTP id 187mr13139836itg.83.1466387003840; Sun, 19 Jun 2016 18:43:23 -0700 (PDT) Received: from kaki.bld.corp.google.com ([2620:0:1005:12:69d5:ffca:f2fd:7f68]) by smtp.gmail.com with ESMTPSA id i13sm17884906iod.33.2016.06.19.18.43.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 18:43:23 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id B6BFF2207FC; Sun, 19 Jun 2016 19:43:22 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 19 Jun 2016 19:43:02 -0600 Message-Id: <1466386991-10469-3-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: <1466386991-10469-1-git-send-email-sjg@chromium.org> References: <1466386991-10469-1-git-send-email-sjg@chromium.org> Cc: Marek Vasut , Wu@google.com, Josh , York Sun Subject: [U-Boot] [PATCH 2/5] arm: Don't invalidate unaligned cache regions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" At present armv7 will unhappily invalidate a cache region and print an error message. Make it skip the operation instead, as it does with other cache operations. Signed-off-by: Simon Glass Reviewed-by: Marek Vasut --- arch/arm/cpu/armv7/cache_v7.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c index 823a156..e59597e 100644 --- a/arch/arm/cpu/armv7/cache_v7.c +++ b/arch/arm/cpu/armv7/cache_v7.c @@ -44,27 +44,8 @@ static void v7_dcache_inval_range(u32 start, u32 stop, u32 line_len) { u32 mva; - /* - * If start address is not aligned to cache-line do not - * invalidate the first cache-line - */ - if (start & (line_len - 1)) { - printf("ERROR: %s - start address is not aligned - 0x%08x\n", - __func__, start); - /* move to next cache line */ - start = (start + line_len - 1) & ~(line_len - 1); - } - - /* - * If stop address is not aligned to cache-line do not - * invalidate the last cache-line - */ - if (stop & (line_len - 1)) { - printf("ERROR: %s - stop address is not aligned - 0x%08x\n", - __func__, stop); - /* align to the beginning of this cache line */ - stop &= ~(line_len - 1); - } + if (!check_cache_range(start, stop)) + return; for (mva = start; mva < stop; mva = mva + line_len) { /* DCIMVAC - Invalidate data cache by MVA to PoC */