aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2019-05-05 22:42:08 +0200
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2019-07-02 02:31:13 +0200
commitaeaf6c20dbcfed5c459d9f6b39cb5fa2187f0b29 (patch)
tree9103d4641e7ec7d941a76738064ae16c6048c76e /hw/block
parent6536987fd6aa52adbb6c128db1952e7c62f5c82b (diff)
downloadqemu-aeaf6c20dbcfed5c459d9f6b39cb5fa2187f0b29.zip
qemu-aeaf6c20dbcfed5c459d9f6b39cb5fa2187f0b29.tar.gz
qemu-aeaf6c20dbcfed5c459d9f6b39cb5fa2187f0b29.tar.bz2
hw/block/pflash_cfi02: Add an enum to define the write cycles
No change in functionality is intended with this commit. Signed-off-by: Stephen Checkoway <stephen.checkoway@oberlin.edu> Message-Id: <20190426162624.55977-3-stephen.checkoway@oberlin.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> [PMD: Extracted from bigger patch] Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/block')
-rw-r--r--hw/block/pflash_cfi02.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 43796e5..303d225 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -57,6 +57,11 @@ do { \
#define PFLASH_LAZY_ROMD_THRESHOLD 42
+/* Special write cycles for CFI queries. */
+enum {
+ WCYCLE_CFI = 7,
+};
+
struct PFlashCFI02 {
/*< private >*/
SysBusDevice parent_obj;
@@ -286,7 +291,7 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset,
if (boff == 0x55 && cmd == 0x98) {
enter_CFI_mode:
/* Enter CFI query mode */
- pfl->wcycle = 7;
+ pfl->wcycle = WCYCLE_CFI;
pfl->cmd = 0x98;
return;
}
@@ -458,7 +463,8 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset,
goto reset_flash;
}
break;
- case 7: /* Special value for CFI queries */
+ /* Special values for CFI queries */
+ case WCYCLE_CFI:
DPRINTF("%s: invalid write in CFI query mode\n", __func__);
goto reset_flash;
default: