Message ID | 20190702001301.4768-9-philmd@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | hw/block/pflash_cfi01: Add DeviceReset() handler | expand |
On Mon, Jul 1, 2019 at 5:16 PM Philippe Mathieu-Daudé <philmd@redhat.com> wrote: > > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Alistair > --- > hw/block/pflash_cfi01.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c > index f50d0a9d37..e891112b67 100644 > --- a/hw/block/pflash_cfi01.c > +++ b/hw/block/pflash_cfi01.c > @@ -286,7 +286,9 @@ static uint32_t pflash_read(PFlashCFI01 *pfl, hwaddr offset, > switch (pfl->cmd) { > default: > /* This should never happen : reset state & treat it as a read */ > - DPRINTF("%s: unknown command state: %x\n", __func__, pfl->cmd); > + qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid state, " > + "wcycle %d cmd 0x02%x\n", > + __func__, pfl->wcycle, pfl->cmd); > pfl->wcycle = 0; > pfl->cmd = 0xff; > /* fall through to read code */ > @@ -631,7 +633,9 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset, > break; > default: > /* Should never happen */ > - DPRINTF("%s: invalid write state\n", __func__); > + qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid state, " > + "wcycle %d cmd (0x02%x -> value 0x02%x)\n", > + __func__, pfl->wcycle, pfl->cmd, value); > goto mode_read_array; > } > return; > -- > 2.20.1 >
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c index f50d0a9d37..e891112b67 100644 --- a/hw/block/pflash_cfi01.c +++ b/hw/block/pflash_cfi01.c @@ -286,7 +286,9 @@ static uint32_t pflash_read(PFlashCFI01 *pfl, hwaddr offset, switch (pfl->cmd) { default: /* This should never happen : reset state & treat it as a read */ - DPRINTF("%s: unknown command state: %x\n", __func__, pfl->cmd); + qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid state, " + "wcycle %d cmd 0x02%x\n", + __func__, pfl->wcycle, pfl->cmd); pfl->wcycle = 0; pfl->cmd = 0xff; /* fall through to read code */ @@ -631,7 +633,9 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset, break; default: /* Should never happen */ - DPRINTF("%s: invalid write state\n", __func__); + qemu_log_mask(LOG_GUEST_ERROR, "%s: Invalid state, " + "wcycle %d cmd (0x02%x -> value 0x02%x)\n", + __func__, pfl->wcycle, pfl->cmd, value); goto mode_read_array; } return;
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- hw/block/pflash_cfi01.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)