target/renesas: add enter_flash_mode function

This commit is contained in:
Rafael Silva 2022-08-23 12:57:53 +01:00 committed by Rachel Mant
parent 31856f028f
commit 3a28b58aa9
1 changed files with 1 additions and 6 deletions

View File

@ -479,9 +479,6 @@ static int renesas_rv40_flash_erase(target_flash_s *f, target_addr_t addr, size_
{ {
target *t = f->t; target *t = f->t;
/* permit flash operations */
target_mem_write8(t, SYSC_FWEPROR, SYSC_FWEPROR_PERMIT);
/* code flash or data flash operation */ /* code flash or data flash operation */
const bool code_flash = addr < RENESAS_CF_END; const bool code_flash = addr < RENESAS_CF_END;
@ -577,9 +574,6 @@ static int renesas_rv40_flash_write(target_flash_s *f, target_addr_t dest, const
{ {
target *t = f->t; target *t = f->t;
/* permit flash operations */
target_mem_write8(t, SYSC_FWEPROR, SYSC_FWEPROR_PERMIT);
/* code flash or data flash operation */ /* code flash or data flash operation */
const bool code_flash = dest < RENESAS_CF_END; const bool code_flash = dest < RENESAS_CF_END;
@ -736,6 +730,7 @@ static void renesas_add_flash(target *t, target_addr_t addr, size_t length)
case PNR_SERIES_RA6M5: case PNR_SERIES_RA6M5:
case PNR_SERIES_RA6T1: case PNR_SERIES_RA6T1:
case PNR_SERIES_RA6T2: case PNR_SERIES_RA6T2:
t->enter_flash_mode = renesas_enter_flash_mode;
return renesas_add_rv40_flash(t, addr, length); return renesas_add_rv40_flash(t, addr, length);
default: default: