aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Rutland <mark.rutland@arm.com>2014-03-20 15:40:46 +0000
committerMark Rutland <mark.rutland@arm.com>2014-03-20 15:52:49 +0000
commit59478438a52f3dcc7a592f77a96ec68b3769cb36 (patch)
treec938b9d7c8dda796e4dbe4ad749277d3460cd3ea
parentebc511d7b1215b02c7ff1804f14307ec9619dedb (diff)
downloadboot-wrapper-aarch64-59478438a52f3dcc7a592f77a96ec68b3769cb36.tar.gz
cache.S: fix misleading comments
A couple of comments in cache.S are misleading. While they do not affect the correctness of the code they do make it somewhat difficult to reason about it: CSSIDR_EL1[12:3] contains the associativity field, which is enconded as one less than the total number of ways, (matching the maximum way index) so the comment on line 40 is wrong. Counting the leading zeros on a 32-bit register with the extracted associativity field results in 32 - ceil(log2(max way index)), rather than log2(ways) rounded down. Thus the comment on line 41 is also wrong. This patch adjusts both comments to better reflect the code. Signed-off-by: Mark Rutland <mark.rutland@arm.com>
-rw-r--r--cache.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/cache.S b/cache.S
index 32e5652..081b8a7 100644
--- a/cache.S
+++ b/cache.S
@@ -37,8 +37,8 @@ flush_caches:
mrs x3, ccsidr_el1
and x4, x3, #0x7
add x4, x4, #4 /* log2 line size, corrected for offset */
- ubfx x6, x3, #3, #10 /* ways */
- clz w5, w6 /* log2 ways, rounded down */
+ ubfx x6, x3, #3, #10 /* max way index */
+ clz w5, w6 /* 32 - log2 ways */
ubfx x7, x3, #13, #15 /* sets */
/* loop over ways */