From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulation
Date: Mon, 6 Oct 2008 11:47:41 +0200 [thread overview]
Message-ID: <20081006114741.0e816d77@surf> (raw)
In-Reply-To: <fb249edb0810031605kb2468dg8b77ccec2a0b73fc@mail.gmail.com>
Le Sat, 4 Oct 2008 01:05:55 +0200,
"andrzej zaborowski" <balrogg@gmail.com> 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 <thomas.petazzoni@free-electrons.com>
---
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
next prev parent reply other threads:[~2008-10-06 9:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 13:02 [Qemu-devel] [patch 0/4] [RFC] Add flash emulation to the Versatile PB platform Thomas Petazzoni
2008-10-02 13:02 ` [Qemu-devel] [patch 1/4] Increase write buffer size in pflash emulation Thomas Petazzoni
2008-10-03 23:05 ` andrzej zaborowski
2008-10-06 9:47 ` Thomas Petazzoni [this message]
2008-10-02 13:02 ` [Qemu-devel] [patch 2/4] Reset wcycle after erase confirm Thomas Petazzoni
2008-10-02 13:02 ` [Qemu-devel] [patch 3/4] Improve pflash cfi01 debug messages Thomas Petazzoni
2008-10-02 13:02 ` [Qemu-devel] [patch 4/4] Add Flash support to the Versatile PB platform Thomas Petazzoni
2008-10-02 16:33 ` Paul Brook
2008-10-02 17:00 ` Thomas Petazzoni
2008-10-03 13:44 ` Thomas Petazzoni
2008-10-03 14:37 ` Thomas Petazzoni
2008-10-06 9:48 ` Thomas Petazzoni
2008-10-02 18:25 ` andrzej zaborowski
2008-10-03 7:55 ` Thomas Petazzoni
2008-10-06 17:23 ` [Qemu-devel] [Patch 0/4] [RFC] Zero Cluster Dedup, Offline dedup, qemu-img extentions Shahar Frank
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081006114741.0e816d77@surf \
--to=thomas.petazzoni@free-electrons.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).