This is an automated email from Gerrit.

Matthias Welwarsky ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/3026

-- gerrit

commit e3f6bbd2c2e447e3b3a80e257296694a7c70e62a
Author: Matthias Welwarsky <[email protected]>
Date:   Fri Oct 16 09:57:19 2015 +0200

    armv7a: add d-cache virtual address range flush function
    
    This patch adds a function for cleaning & invalidating a virtual
    address range from the architecture caches down to the point of
    coherence.
    
    Change-Id: I4061ab023a3797fabc967f3a34498034841d52c6
    Signed-off-by: Matthias Welwarsky <[email protected]>

diff --git a/src/target/armv7a_cache.c b/src/target/armv7a_cache.c
index 2cd5deb..ddd1fea 100644
--- a/src/target/armv7a_cache.c
+++ b/src/target/armv7a_cache.c
@@ -223,6 +223,41 @@ done:
        return retval;
 }
 
+int armv7a_l1_d_cache_flush_virt(struct target *target, uint32_t virt,
+                                       unsigned int size)
+{
+       struct armv7a_common *armv7a = target_to_armv7a(target);
+       struct arm_dpm *dpm = armv7a->arm.dpm;
+       struct armv7a_cache_common *armv7a_cache = 
&armv7a->armv7a_mmu.armv7a_cache;
+       uint32_t i, linelen = armv7a_cache->dminline;
+       int retval;
+
+       retval = armv7a_l1_d_cache_sanity_check(target);
+       if (retval != ERROR_OK)
+               return retval;
+
+       retval = dpm->prepare(dpm);
+       if (retval != ERROR_OK)
+               goto done;
+
+       for (i = 0; i < size; i += linelen) {
+               uint32_t offs = virt + i;
+
+               /* DCCIMVAC */
+               retval = dpm->instr_write_data_r0(dpm,
+                               ARMV4_5_MCR(15, 0, 0, 7, 14, 1), offs);
+               if (retval != ERROR_OK)
+                       goto done;
+       }
+       return retval;
+
+done:
+       LOG_ERROR("d-cache invalidate failed");
+       dpm->finish(dpm);
+
+       return retval;
+}
+
 int armv7a_l1_i_cache_inval_all(struct target *target)
 {
        struct armv7a_common *armv7a = target_to_armv7a(target);

-- 

------------------------------------------------------------------------------
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to