Skip to contentSkip to conversation

target/arm: add data cache invalidation cp15 instruction to cortex-r5

PATCH Applied Luc MICHEL 2 participants 4 messages Apr 28, 2017 – May 23, 2017

lore
Share & tools
lore

Luc MICHEL

author
#0 lore raw

cover target/arm: add data cache invalidation cp15 instruction to cortex-r5

This patch adds the cp15, CRn=15, opc1=0, CRm=5, opc2=0 coprocessor instruction to the cortex-r5. As stated in the TRM, this instruction invalidates all the data cache. This trivial patch implements it as NOP as cache operations are not implemented in QEMU.

The documentation is here:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0460d/Bgbdbdjc.html

Tested using this minimal program:
.global _start

.section .text
_start:
mcr p15, 0, r1, c15, c5, 0

idle:
wfi
b idle

Before implementation:
IN:
0x00008000: ee0f1f15 mcr 15, 0, r1, cr15, cr5, {0}

Taking exception 1 [Undefined Instruction]
...from EL1 to EL1
...with ESR 0x0/0x2000000

After implementation:
IN:

 0x00008000:  ee0f1f15      mcr 15, 0, r1, cr15, cr5, {0}
 0x00008004:  e320f003      wfi

Luc MICHEL (1):
target/arm: add data cache invalidation cp15 instruction to cortex-r5

 target/arm/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
2.12.2
author
#1 lore raw

PATCH 1/1 target/arm: add data cache invalidation cp15 instruction to cortex-r5

The cp15, CRn=15, opc1=0, CRm=5, opc2=0 instruction invalidates all the data cache on the cortex-r5. Implementing it as a NOP.

---
 target/arm/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
target/arm/cpu.c +2 -0
index b357aee778..47687a40c4 100644
@@ -1062,6 +1062,8 @@ static const ARMCPRegInfo cortexr5_cp_reginfo[] = {
       .access = PL1_RW, .type = ARM_CP_CONST },
     { .name = "BTCM", .cp = 15, .opc1 = 0, .crn = 9, .crm = 1, .opc2 = 1,
       .access = PL1_RW, .type = ARM_CP_CONST },
+    { .name = "DCACHE_INVAL", .cp = 15, .opc1 = 0, .crn = 15, .crm = 5,
+      .opc2 = 0, .access = PL1_W, .type = ARM_CP_NOP },
     REGINFO_SENTINEL
 };
 
Signature · 1 line
2.12.2
author
#2 lore raw
In reply to Luc MICHEL

ping

The patchwork link: https://patchwork.ozlabs.org/patch/756408/

Thanks,

Signature · 1 line
Luc
Quoted 41 lines · Luc MICHEL

This patch adds the cp15, CRn=15, opc1=0, CRm=5, opc2=0 coprocessor instruction
to the cortex-r5. As stated in the TRM, this instruction invalidates all the
data cache. This trivial patch implements it as NOP as cache operations are not
implemented in QEMU.

The documentation is here:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0460d/Bgbdbdjc.html

Tested using this minimal program:
.global _start

.section .text
_start:

   mcr p15, 0, r1, c15, c5, 0

idle:
wfi
b idle

Before implementation:
IN:
0x00008000: ee0f1f15 mcr 15, 0, r1, cr15, cr5, {0}

Taking exception 1 [Undefined Instruction]
...from EL1 to EL1
...with ESR 0x0/0x2000000

After implementation:
IN:

 0x00008000:  ee0f1f15      mcr 15, 0, r1, cr15, cr5, {0}
 0x00008004:  e320f003      wfi

Luc MICHEL (1):
target/arm: add data cache invalidation cp15 instruction to cortex-r5

 target/arm/cpu.c | 2 ++
 1 file changed, 2 insertions(+)
#3 lore raw
In reply to Luc MICHEL
Quoted 7 lines · Luc MICHEL

This patch adds the cp15, CRn=15, opc1=0, CRm=5, opc2=0 coprocessor instruction to the cortex-r5. As stated in the TRM, this instruction invalidates all the data cache. This trivial patch implements it as NOP as cache operations are not implemented in QEMU.

The documentation is here:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0460d/Bgbdbdjc.html

Applied to -trivial, since no one else picked it up so far :)

Thanks,

/mjt