qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulation


From: Thomas Petazzoni
Subject: [Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulation
Date: Thu, 02 Oct 2008 15:02:15 +0200
User-agent: quilt/0.46-1

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 <address@hidden>
---
 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;

-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]