hw/block/pflash_cfi02: Implement erase suspend/resume
commitddb6f2254871c7c686561c4b41d52e2f0413f9a1
authorStephen Checkoway <stephen.checkoway@oberlin.edu>
Fri, 26 Apr 2019 16:26:23 +0000 (26 12:26 -0400)
committerPhilippe Mathieu-Daudé <philmd@redhat.com>
Tue, 2 Jul 2019 00:34:55 +0000 (2 02:34 +0200)
tree29620160fef0897eff2cbeb656d88e199380d12c
parenta50547aca54c0e55122c32c077cab747147a6b30
hw/block/pflash_cfi02: Implement erase suspend/resume

During a sector erase (but not a chip erase), the embeded erase program
can be suspended. Once suspended, the sectors not selected for erasure
may be read and programmed. Autoselect mode is allowed during erase
suspend mode. Presumably, CFI queries are similarly allowed so this
commit allows them as well.

Since guest firmware can use status bits DQ7, DQ6, DQ3, and DQ2 to
determine the current state of sector erasure, these bits are properly
implemented.

Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu>
Message-Id: <20190426162624.55977-10-stephen.checkoway@oberlin.edu>
Acked-by: Thomas Huth <thuth@redhat.com>
Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[PMD: Rebased]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
hw/block/pflash_cfi02.c
tests/pflash-cfi02-test.c