summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGenevieve Chan <genevieve.chan@starfivetech.com>2023-05-18 11:37:14 +0300
committerGenevieve Chan <genevieve.chan@starfivetech.com>2023-05-18 11:37:14 +0300
commitff985349fde2d641ec82a181f9874dce55f71f19 (patch)
tree7abf4cdb10e9ce889583c5c0fb1b3956a72d67ef
parent6aeb74b1711c9b1e57520b6d609ad1e86dff521d (diff)
downloadopensbi-ff985349fde2d641ec82a181f9874dce55f71f19.tar.xz
platform: generic: starfive: Issue fence instruction out of the loop
This patch shifts the fence instruction outside of the loop in sbi_dubhe_L2_inv_range and sbi_dubhe_L2_flush_range. Fence should only be called once at the beginning and once at the end of the flush or invalidate operation Signed-off-by: Genevieve Chan <genevieve.chan@starfivetech.com>
-rwxr-xr-xplatform/generic/starfive/dubhe_cache.S9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/generic/starfive/dubhe_cache.S b/platform/generic/starfive/dubhe_cache.S
index 9ab8895..de28418 100755
--- a/platform/generic/starfive/dubhe_cache.S
+++ b/platform/generic/starfive/dubhe_cache.S
@@ -27,14 +27,15 @@ __sbi_dubhe_L2_inv_range:
add a1, a1, a0 /* Compute end address */
not t2, t1
and a0, a0, t2
+ fence rw, rw
1:
/* CDISCARD.L2 rs1 = a0 */
- fence rw, rw
.insn i 0x73, 0, x0, a0, -0x3A
- fence rw, rw
+
add a0, a0, t0
blt a0, a1, 1b
2:
+ fence rw, rw
ret
/*
@@ -55,12 +56,12 @@ __sbi_dubhe_L2_flush_range:
add a1, a1, a0 /* Compute end address */
not t2, t1
and a0, a0, t2
+ fence rw, rw
1:
/* CFLUSH.L2 rs1 = a0 */
- fence rw, rw
.insn i 0x73, 0, x0, a0, -0x3C
- fence rw, rw
add a0, a0, t0
blt a0, a1, 1b
2:
+ fence rw, rw
ret