qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulat


From: Thomas Petazzoni
Subject: Re: [Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulation
Date: Mon, 6 Oct 2008 11:47:41 +0200

Le Sat, 4 Oct 2008 01:05:55 +0200,
"andrzej zaborowski" <address@hidden> a écrit :

> How about chaging pfl->counter = cmd; to pfl->counter = value;?

Makes sense, thanks for the idea! Here is an updated patch.

---

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 use
"value" instead of "cmd" to set pfl->counter, because cmd is truncated
to the 8 lower bits of value, while the number of bytes for a write
can now be greater than 255 bytes.

Signed-off-by: Thomas Petazzoni <address@hidden>
---
 hw/pflash_cfi01.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: qemu/hw/pflash_cfi01.c
===================================================================
--- qemu.orig/hw/pflash_cfi01.c
+++ qemu/hw/pflash_cfi01.c
@@ -276,8 +276,8 @@
 
             break;
         case 0xe8:
-            DPRINTF("%s: block write of %x bytes\n", __func__, cmd);
-            pfl->counter = cmd;
+            DPRINTF("%s: block write of %x bytes\n", __func__, value);
+            pfl->counter = value;
             pfl->wcycle++;
             break;
         case 0x60:
@@ -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]