[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2 6/9] hw/block/pflash_cfi01: Simplify CFI_QUERY
From: |
Alistair Francis |
Subject: |
Re: [Qemu-arm] [PATCH v2 6/9] hw/block/pflash_cfi01: Simplify CFI_QUERY processing |
Date: |
Tue, 2 Jul 2019 09:03:51 -0700 |
On Mon, Jul 1, 2019 at 5:15 PM Philippe Mathieu-Daudé <address@hidden> wrote:
>
> The current code does:
>
> if (write_cycle == 0)
> if (command == CFI_QUERY)
> break
> write_cycle += 1
> last_command = command
>
> if (write_cycle == 1)
> if (last_command == CFI_QUERY)
> if (command == READ_ARRAY
> write_cycle = 0
> last_command = READ_ARRAY
>
> Simplify by not increasing the write_cycle on CFI_QUERY,
> the next command are processed as normal wcycle=0.
>
> This matches the hardware datasheet (we do not enter the WRITE
> state machine, thus no write cycle involved).
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Alistair
> ---
> hw/block/pflash_cfi01.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
> index 8d632ea941..c1b02219b2 100644
> --- a/hw/block/pflash_cfi01.c
> +++ b/hw/block/pflash_cfi01.c
> @@ -492,7 +492,8 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
> return;
> case 0x98: /* CFI query */
> DPRINTF("%s: CFI query\n", __func__);
> - break;
> + pfl->cmd = cmd;
> + return;
> case 0xe8: /* Write to buffer */
> DPRINTF("%s: Write to buffer\n", __func__);
> /* FIXME should save @offset, @width for case 1+ */
> @@ -566,13 +567,6 @@ static void pflash_write(PFlashCFI01 *pfl, hwaddr offset,
> goto mode_read_array;
> }
> break;
> - case 0x98:
> - if (cmd == 0xff) {
> - goto mode_read_array;
> - } else {
> - DPRINTF("%s: leaving query mode\n", __func__);
> - }
> - break;
> default:
> goto error_flash;
> }
> --
> 2.20.1
>
- Re: [Qemu-arm] [PATCH v2 4/9] hw/block/pflash_cfi01: Start state machine as READY to accept commands, (continued)
[Qemu-arm] [PATCH v2 6/9] hw/block/pflash_cfi01: Simplify CFI_QUERY processing, Philippe Mathieu-Daudé, 2019/07/01
- Re: [Qemu-arm] [PATCH v2 6/9] hw/block/pflash_cfi01: Simplify CFI_QUERY processing,
Alistair Francis <=
[Qemu-arm] [PATCH v2 7/9] hw/block/pflash_cfi01: Improve command comments, Philippe Mathieu-Daudé, 2019/07/01
[Qemu-arm] [PATCH v2 8/9] hw/block/pflash_cfi01: Replace DPRINTF by qemu_log_mask(GUEST_ERROR), Philippe Mathieu-Daudé, 2019/07/01
[Qemu-arm] [PATCH v2 9/9] hw/block/pflash_cfi01: Hold the PRI table offset in a variable, Philippe Mathieu-Daudé, 2019/07/01
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 0/9] hw/block/pflash_cfi01: Add DeviceReset() handler, no-reply, 2019/07/02
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 0/9] hw/block/pflash_cfi01: Add DeviceReset() handler, Laszlo Ersek, 2019/07/02