All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] ARM: uniphier: fix range invalidate for outer cache
Date: Sun, 17 Jan 2016 10:13:18 +0900	[thread overview]
Message-ID: <1452993199-16824-4-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1452993199-16824-1-git-send-email-yamada.masahiro@socionext.com>

If invalidate operation is invoked against a cache-unaliged region,
the both ends of the region should be flushed, not invalidated.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/cache_uniphier.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/mach-uniphier/cache_uniphier.c b/arch/arm/mach-uniphier/cache_uniphier.c
index 6c77316..8435a33 100644
--- a/arch/arm/mach-uniphier/cache_uniphier.c
+++ b/arch/arm/mach-uniphier/cache_uniphier.c
@@ -105,6 +105,29 @@ void v7_outer_cache_flush_range(u32 start, u32 end)
 
 void v7_outer_cache_inval_range(u32 start, u32 end)
 {
+	if (start & (SSC_LINE_SIZE - 1)) {
+		start &= ~(SSC_LINE_SIZE - 1);
+		__uniphier_cache_maint_range(start, SSC_LINE_SIZE,
+					     SSCOQM_CM_WB_INV);
+		start += SSC_LINE_SIZE;
+	}
+
+	if (start >= end) {
+		uniphier_cache_sync();
+		return;
+	}
+
+	if (end & (SSC_LINE_SIZE - 1)) {
+		end &= ~(SSC_LINE_SIZE - 1);
+		__uniphier_cache_maint_range(end, SSC_LINE_SIZE,
+					     SSCOQM_CM_WB_INV);
+	}
+
+	if (start >= end) {
+		uniphier_cache_sync();
+		return;
+	}
+
 	uniphier_cache_maint_range(start, end, SSCOQM_CM_INV);
 }
 
-- 
1.9.1

  parent reply	other threads:[~2016-01-17  1:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-17  1:13 [U-Boot] [PATCH 0/4] ARM: uniphier: refactor and fix UniPhier outer cache Masahiro Yamada
2016-01-17  1:13 ` [U-Boot] [PATCH 1/4] ARM: uniphier: refactor outer cache operation slightly Masahiro Yamada
2016-01-17  1:13 ` [U-Boot] [PATCH 2/4] ARM: uniphier: factor out outer cache sync as a helper function Masahiro Yamada
2016-01-17  1:13 ` Masahiro Yamada [this message]
2016-01-17  1:13 ` [U-Boot] [PATCH 4/4] ARM: uniphier: set active ways to really enable outer cache Masahiro Yamada
2016-01-19 23:47 ` [U-Boot] [PATCH 0/4] ARM: uniphier: refactor and fix UniPhier " Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452993199-16824-4-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.