qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: mask NOR flash buffered write length
@ 2013-10-18  2:30 Roy Franz
  2013-10-18 11:38 ` Stefan Hajnoczi
  0 siblings, 1 reply; 8+ messages in thread
From: Roy Franz @ 2013-10-18  2:30 UTC (permalink / raw)
  To: qemu-devel, kwolf, stefanha; +Cc: Roy Franz, patches

For buffered writes, mask the length with the maximum supported
length.  This is required for block writes to work on the ARM vexpress
platform, where the flash interface is 32 bits wide.  For buffered writes
to the 2 16 bit flashes on the interface, the length is repeated in each
16 bit word, and without this mask the two lengths are interpreted 
as a single 32 bit value that is very large.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
---
 hw/block/pflash_cfi01.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 018a967..a364cca 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -378,6 +378,7 @@ static void pflash_write(pflash_t *pfl, hwaddr offset,
 
             break;
         case 0xe8:
+            value &= pfl->writeblock_size - 1;
             DPRINTF("%s: block write of %x bytes\n", __func__, value);
             pfl->counter = value;
             pfl->wcycle++;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-18 14:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18  2:30 [Qemu-devel] [PATCH] block: mask NOR flash buffered write length Roy Franz
2013-10-18 11:38 ` Stefan Hajnoczi
2013-10-18 13:36   ` Peter Maydell
2013-10-18 13:54     ` Roy Franz
2013-10-18 14:01       ` Peter Maydell
2013-10-18 14:05         ` Roy Franz
2013-10-18 14:11           ` Peter Maydell
2013-10-18 14:14             ` Roy Franz

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).