X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fmdr.c;h=f3916ded98fe9f4a5e02397fcb167cd0a2960b28;hp=c402e64e2fc3a7a1fd7f94f324e0e20488fbc3bd;hb=f9d7554ee490e39a5cba3cd4eb2c28ec72ba407f;hpb=f2fbcb217b31e1b133ac18f51f7fc4ab3cf386b1 diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c index c402e64e2f..f3916ded98 100644 --- a/src/flash/nor/mdr.c +++ b/src/flash/nor/mdr.c @@ -22,9 +22,7 @@ * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * + * along with this program. If not, see . * ***************************************************************************/ #ifdef HAVE_CONFIG_H @@ -173,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; } @@ -471,6 +470,13 @@ free_buffer: if (new_buffer) free(new_buffer); + /* read some bytes bytes to flush buffer in flash accelerator. + * See errata for 1986VE1T and 1986VE3. Error 0007 */ + if ((retval == ERROR_OK) && (!mdr_info->mem_type)) { + uint32_t tmp; + target_checksum_memory(bank->target, bank->base, 64, &tmp); + } + return retval; } @@ -627,4 +633,5 @@ struct flash_driver mdr_flash = { .erase_check = default_flash_blank_check, .protect_check = mdr_protect_check, .info = get_mdr_info, + .free_driver_priv = default_flash_free_driver_priv, };