[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/13] hw/block/pflash_cfi02: Use the chip erase tim
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 13/13] hw/block/pflash_cfi02: Use the chip erase time specified in the CFI table |
Date: |
Mon, 6 May 2019 00:15:44 +0200 |
From: Stephen Checkoway <address@hidden>
When erasing the chip, use the typical time specified in the CFI table
rather than arbitrarily selecting 5 seconds.
Since the currently unconfigurable value set in the table is 12, this
means a chip erase takes 4096 ms so this isn't a big change in behavior.
Signed-off-by: Stephen Checkoway <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: Prepend 'hw/' in patch subject]
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
hw/block/pflash_cfi02.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 4c17dbf99f4..49cd9ed0f91 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -429,9 +429,9 @@ static void pflash_write(void *opaque, hwaddr offset,
uint64_t value,
pflash_update(pfl, 0, pfl->chip_len);
}
set_dq7(pfl, 0x00);
- /* Let's wait 5 seconds before chip erase is done */
+ /* Wait the time specified at CFI address 0x22. */
timer_mod(&pfl->timer, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) +
- (NANOSECONDS_PER_SECOND * 5));
+ (1ULL << pfl->cfi_table[0x22]) * SCALE_MS);
break;
case 0x30:
/* Sector erase */
--
2.20.1
- [Qemu-devel] [PATCH 01/13] tests/pflash-cfi02: Add test for supported CFI commands, (continued)
- [Qemu-devel] [PATCH 01/13] tests/pflash-cfi02: Add test for supported CFI commands, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 04/13] hw/block/pflash_cfi02: Fix debug format string, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 07/13] hw/block/pflash_cfi02: Simplify a statement using fall through, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 10/13] hw/block/pflash_cfi02: Extract the pflash_data_read() function, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 03/13] tests/pflash-cfi02: Use IEC binary prefixes for size constants, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 06/13] hw/block/pflash_cfi02: Add helpers to manipulate the status bits, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 02/13] tests/pflash-cfi02: Use the GLib API, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 05/13] hw/block/pflash_cfi02: Add an enum to define the write cycles, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 08/13] hw/block/pflash_cfi02: Use the ldst API in pflash_write(), Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 09/13] hw/block/pflash_cfi02: Use the ldst API in pflash_read(), Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 13/13] hw/block/pflash_cfi02: Use the chip erase time specified in the CFI table,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 12/13] hw/block/pflash_cfi02: Fix command address comparison, Philippe Mathieu-Daudé, 2019/05/05
- [Qemu-devel] [PATCH 11/13] hw/block/pflash_cfi02: Unify the MemoryRegionOps, Philippe Mathieu-Daudé, 2019/05/05