* 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 <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
return ERROR_OK;
}
-static int mdr_protect_check(struct flash_bank *bank)
-{
- return ERROR_OK;
-}
-
static int mdr_mass_erase(struct flash_bank *bank)
{
struct target *target = bank->target;
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;
}
return retval;
}
-static int mdr_protect(struct flash_bank *bank, int set, int first, int last)
-{
- return ERROR_OK;
-}
-
static int mdr_write_block(struct flash_bank *bank, const uint8_t *buffer,
uint32_t offset, uint32_t count)
{
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;
}
"<type>: 0 for main memory, 1 for info memory",
.flash_bank_command = mdr_flash_bank_command,
.erase = mdr_erase,
- .protect = mdr_protect,
.write = mdr_write,
.read = mdr_read,
.probe = mdr_probe,
.auto_probe = mdr_auto_probe,
.erase_check = default_flash_blank_check,
- .protect_check = mdr_protect_check,
.info = get_mdr_info,
+ .free_driver_priv = default_flash_free_driver_priv,
};