提交 aeaf6c20 编写于 作者: P Philippe Mathieu-Daudé

hw/block/pflash_cfi02: Add an enum to define the write cycles

No change in functionality is intended with this commit.
Signed-off-by: NStephen Checkoway <stephen.checkoway@oberlin.edu>
Message-Id: <20190426162624.55977-3-stephen.checkoway@oberlin.edu>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
[PMD: Extracted from bigger patch]
Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
上级 6536987f
...@@ -57,6 +57,11 @@ do { \ ...@@ -57,6 +57,11 @@ do { \
#define PFLASH_LAZY_ROMD_THRESHOLD 42 #define PFLASH_LAZY_ROMD_THRESHOLD 42
/* Special write cycles for CFI queries. */
enum {
WCYCLE_CFI = 7,
};
struct PFlashCFI02 { struct PFlashCFI02 {
/*< private >*/ /*< private >*/
SysBusDevice parent_obj; SysBusDevice parent_obj;
...@@ -286,7 +291,7 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset, ...@@ -286,7 +291,7 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset,
if (boff == 0x55 && cmd == 0x98) { if (boff == 0x55 && cmd == 0x98) {
enter_CFI_mode: enter_CFI_mode:
/* Enter CFI query mode */ /* Enter CFI query mode */
pfl->wcycle = 7; pfl->wcycle = WCYCLE_CFI;
pfl->cmd = 0x98; pfl->cmd = 0x98;
return; return;
} }
...@@ -458,7 +463,8 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset, ...@@ -458,7 +463,8 @@ static void pflash_write(PFlashCFI02 *pfl, hwaddr offset,
goto reset_flash; goto reset_flash;
} }
break; 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__); DPRINTF("%s: invalid write in CFI query mode\n", __func__);
goto reset_flash; goto reset_flash;
default: default:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册