Increase write buffer size in pflash emulation The current flash emulation code advertises a write buffer size of 16 bytes (1 << 4, according to offset 0x2A of the CFI table). This is very small compared to normal write buffer sizes, and makes the process of writing to the flash very slow (at least from U-Boot). This patch increases this size to 2048 bytes. Except the modification of the CFI table, the only other required modification is to change the type of the cmd local variable in pflash_write() from uint8_t to uint16_t, because the length of the transfer doesn't fit on 8 bits anymore. Signed-off-by: Thomas Petazzoni --- hw/pflash_cfi01.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: qemu/hw/pflash_cfi01.c =================================================================== --- qemu.orig/hw/pflash_cfi01.c +++ qemu/hw/pflash_cfi01.c @@ -200,7 +200,7 @@ { target_ulong boff; uint8_t *p; - uint8_t cmd; + uint16_t cmd; cmd = value; offset -= pfl->base; @@ -583,7 +583,7 @@ pfl->cfi_table[0x28] = 0x02; pfl->cfi_table[0x29] = 0x00; /* Max number of bytes in multi-bytes write */ - pfl->cfi_table[0x2A] = 0x04; + pfl->cfi_table[0x2A] = 0x0B; pfl->cfi_table[0x2B] = 0x00; /* Number of erase block regions (uniform) */ pfl->cfi_table[0x2C] = 0x01;