Skip to content

Commit c8fc2a1

Browse files
author
wangyanwen
committed
Revert part of "fix after write_bank/write_image command read date error bug"
This reverts commit 05aa7b8 Change-Id: Ic867c02707b58786262d91208d8f2bb2aef8a566
1 parent 90e46c9 commit c8fc2a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/flash/nor/nuspi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,16 @@ static int nuspi_read_flash_id(struct flash_bank *bank, uint32_t *id)
10121012
return ERROR_OK;
10131013
}
10141014

1015+
static int gdb_flash_write_end_callback(struct target *target,
1016+
enum target_event event, void *priv)
1017+
{
1018+
if (TARGET_EVENT_GDB_FLASH_WRITE_END == event)
1019+
{
1020+
if (nuspi_set_xip_read_cmd(priv) != ERROR_OK)
1021+
return ERROR_FAIL;
1022+
}
1023+
}
1024+
10151025
static int nuspi_probe(struct flash_bank *bank)
10161026
{
10171027
struct target *target = bank->target;
@@ -1066,6 +1076,8 @@ static int nuspi_probe(struct flash_bank *bank)
10661076
if (flash_reset(bank) != ERROR_OK)
10671077
return ERROR_FAIL;
10681078

1079+
target_register_event_callback(gdb_flash_write_end_callback, bank);
1080+
10691081
for (int i = 0; i < 4; i++) {
10701082
if (nuspi_write_reg(bank, NUSPI_REG_SCKDIV, i) != ERROR_OK)
10711083
continue;

0 commit comments

Comments
 (0)