mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: barebox@lists.infradead.org
Subject: [PATCH] ARM: remove unused code from __v7_mmu_cache_flush_invalidate
Date: Wed, 21 Jan 2015 13:24:14 +0900	[thread overview]
Message-ID: <1421814254-13282-1-git-send-email-yamada.m@jp.panasonic.com> (raw)

This code is unnecessary (wrong) for the following reasons.

[1] As ARM ARM clearly says, the entire Level 1 cache maintenance
    operations are not supported for ARMv7, i.e. the bit19-16 of
    the ID_MMFR1 is always 0b0000.  The code always jumps to the
    "hierarchical" label.

[2] The value of "r0" is supposed to determine which cache operation
    should be done, invalidate or clean+invalidate.  The line
    "mcr     p15, 0, r12, c7, c14, 0" tries to clean+invalidate
    regardless of the value of "r0", this is weird.
    Anyway, as mentioned above, this line cannot be reached.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 arch/arm/cpu/cache-armv7.S | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/arch/arm/cpu/cache-armv7.S b/arch/arm/cpu/cache-armv7.S
index c19618b..f3f6bbb 100644
--- a/arch/arm/cpu/cache-armv7.S
+++ b/arch/arm/cpu/cache-armv7.S
@@ -68,15 +68,9 @@ ENTRY(v7_mmu_cache_flush)
 ENDPROC(v7_mmu_cache_flush)
 
 ENTRY(__v7_mmu_cache_flush_invalidate)
-		mrc	p15, 0, r12, c0, c1, 5	@ read ID_MMFR1
-		tst	r12, #0xf << 16		@ hierarchical cache (ARMv7)
-		mov	r12, #0
-		beq	hierarchical
-		mcr	p15, 0, r12, c7, c14, 0	@ clean+invalidate D
-		b	iflush
-hierarchical:
 		stmfd	sp!, {r4-r11}
 		mov	r8, r0
+		mov	r12, #0
 		mcr	p15, 0, r12, c7, c10, 5	@ DMB
 		mrc	p15, 1, r0, c0, c0, 1	@ read clidr
 		ands	r3, r0, #0x7000000	@ extract loc from clidr
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2015-01-21  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  4:24 Masahiro Yamada [this message]
2015-01-21 13:56 ` Sascha Hauer
2015-01-21 16:46   ` 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=1421814254-13282-1-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox