diff --git a/firmware/target/arm/mmu-arm.S b/firmware/target/arm/mmu-arm.S index 00e4c2b..a43af24 100644 --- a/firmware/target/arm/mmu-arm.S +++ b/firmware/target/arm/mmu-arm.S @@ -274,6 +274,11 @@ clean_dcache_range: .global cpucache_flush @ Alias clean_dcache: cpucache_flush: +#if ARM_ARCH == 5 + mrc p15, 0, r15, c7, c10, 3 @ test and clean dcache + bne clean_dcache + mov r0, #0 +#else @ Index format: 31:26 = index, 7:5 = segment, remainder = SBZ mov r0, #0x00000000 @ 1: @ clean_start @ @@ -295,6 +300,7 @@ cpucache_flush: sub r0, r0, #0x000000e0 @ adds r0, r0, #0x04000000 @ will wrap to zero at loop end bne 1b @ clean_start @ +#endif /* ARM_ARCH == 5 */ mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer bx lr @ .size clean_dcache, .-clean_dcache @@ -309,6 +315,11 @@ cpucache_flush: .global invalidate_dcache .type invalidate_dcache, %function invalidate_dcache: +#if ARM_ARCH == 5 + mrc p15, 0, r15, c7, c14, 3 @ test, clean and invalidate dcache + bne invalidate_dcache + mov r0, #0 +#else @ Index format: 31:26 = index, 7:5 = segment, remainder = SBZ mov r0, #0x00000000 @ 1: @ inv_start @ @@ -330,6 +341,7 @@ invalidate_dcache: sub r0, r0, #0x000000e0 @ adds r0, r0, #0x04000000 @ will wrap to zero at loop end bne 1b @ inv_start @ +#endif /* ARM_ARCH == 5 */ mcr p15, 0, r0, c7, c10, 4 @ Drain write buffer bx lr @ .size invalidate_dcache, .-invalidate_dcache