qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH] block: mask NOR flash buffered write length


From: Roy Franz
Subject: [Qemu-devel] [PATCH] block: mask NOR flash buffered write length
Date: Thu, 17 Oct 2013 19:30:02 -0700

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




reply via email to

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