hw/block/pflash_cfi01: Start state machine as READY to accept commands
commit611c749c3b86fe377c94ea301feab3d9ce3bf617
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 16 Jul 2019 15:49:55 +0000 (16 17:49 +0200)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 16 Jul 2019 15:54:06 +0000 (16 17:54 +0200)
treefd06973e1de7b920cdacc972e76262628a09f9ca
parent2658594ff64828bf4230d9224b394034dae14028
hw/block/pflash_cfi01: Start state machine as READY to accept commands

When the state machine is ready to accept command, the bit 7 of
the status register (SR) is set to 1.
The guest polls the status register and check this bit before
writting command to the internal 'Write State Machine' (WSM).

Set SR.7 bit to 1 when the device is created.

There is no migration impact by this change.

Reference: Read Array Flowchart
  "Common Flash Interface (CFI) and Command Sets"
   (Intel Application Note 646)
   Appendix B "Basic Command Set"

Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190715121338.20600-5-philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/block/pflash_cfi01.c