Skip to content

Commit 21d14d5

Browse files
committed
ARCv3: Add inner shareability attribute for DC operations
Cache operations must be specified with the same shareability attributes as for MMU. Since we setup inner shareable attribute for MMU TBC register, lets do it the same for D$ operations.
1 parent 9ddad4c commit 21d14d5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

arch/arc/include/asm/cache.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ extern unsigned long perip_base, perip_end;
101101
#define DC_CTRL_FLUSH_STATUS 0x100
102102
#define DC_CTRL_RGN_OP_INV 0x200
103103
#define DC_CTRL_RGN_OP_MSK 0x200
104+
#define DC_CTRL_SH_ATTR_INNER 0x3000
105+
#define DC_CTRL_SH_ATTR_MASK 0x3000
104106

105107
/*System-level cache (L2 cache) related Auxiliary registers */
106108
#define ARC_REG_SLC_CFG 0x901

arch/arc/mm/cache-arcv3.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ static inline void __dc_op_before(const int op)
136136
if (op & OP_INV)
137137
val |= DC_CTRL_RGN_OP_INV;
138138

139+
// Set shareability attribute for DC operation: Inner-shareable.
140+
// The same as for a page shareability attributes: __SHR_INNER.
141+
val &= ~DC_CTRL_SH_ATTR_MASK;
142+
val |= DC_CTRL_SH_ATTR_INNER;
143+
139144
write_aux_reg(ctl, val);
140145
}
141146

0 commit comments

Comments
 (0)