This is an automated email from Gerrit.

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

-- gerrit

commit 1c4f2477f3f9437f3108765941e6f6602057c6f6
Author: Paul Fertser <[email protected]>
Date:   Thu Nov 3 17:31:33 2016 +0300

    flash: nor: mdr: do not mass erase when clearing INFO memory
    
    The MDR parts have two kinds of memory: main (regular memory-mapped
    memory for code and data) and "info" (not memory-mapped). When OpenOCD
    is requested to erase the info memory block, it should do just that,
    instead of erasing everything including main memory.
    
    Change-Id: I498142ca50d4a7b669b7776180b0dbcea63a5328
    Reported-by: Eldar Khayrullin <[email protected]>
    Signed-off-by: Paul Fertser <[email protected]>

diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c
index 374cb6f..8ceb1bf 100644
--- a/src/flash/nor/mdr.c
+++ b/src/flash/nor/mdr.c
@@ -171,7 +171,8 @@ static int mdr_erase(struct flash_bank *bank, int first, 
int last)
        if (retval != ERROR_OK)
                goto reset_pg_and_lock;
 
-       if ((first == 0) && (last == (bank->num_sectors - 1))) {
+       if ((first == 0) && (last == (bank->num_sectors - 1)) &&
+               !mdr_info->mem_type) {
                retval = mdr_mass_erase(bank);
                goto reset_pg_and_lock;
        }

-- 

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to