aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2021-03-10 17:51:02 +0100
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2021-03-18 11:16:31 +0100
commitd9106341657198096fed7e7c116cd9af606b59c5 (patch)
tree3fa9274061eab3c308252a4856f6c4c6430f1a49 /hw
parent7d1df53f14a26fa95ebee9767d3a4fac281fd70f (diff)
hw/block/pflash_cfi02: Add DeviceReset method
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: David Edmondson <david.edmondson@oracle.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20210310170528.1184868-9-philmd@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/block/pflash_cfi02.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index aea47a99c6..c40febd2a4 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -942,6 +942,13 @@ static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
pflash_cfi02_fill_cfi_table(pfl, nb_regions);
}
+static void pflash_cfi02_reset(DeviceState *dev)
+{
+ PFlashCFI02 *pfl = PFLASH_CFI02(dev);
+
+ pflash_reset_state_machine(pfl);
+}
+
static Property pflash_cfi02_properties[] = {
DEFINE_PROP_DRIVE("drive", PFlashCFI02, blk),
DEFINE_PROP_UINT32("num-blocks", PFlashCFI02, uniform_nb_blocs, 0),
@@ -979,6 +986,7 @@ static void pflash_cfi02_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = pflash_cfi02_realize;
+ dc->reset = pflash_cfi02_reset;
dc->unrealize = pflash_cfi02_unrealize;
device_class_set_props(dc, pflash_cfi02_properties);
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);