From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Koado-0007iu-Jg for qemu-devel@nongnu.org; Sat, 11 Oct 2008 05:20:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Koadn-0007hw-Iv for qemu-devel@nongnu.org; Sat, 11 Oct 2008 05:20:03 -0400 Received: from [199.232.76.173] (port=34988 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Koadn-0007hk-DT for qemu-devel@nongnu.org; Sat, 11 Oct 2008 05:20:03 -0400 Received: from savannah.gnu.org ([199.232.41.3]:40501 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Koadm-0001sj-VO for qemu-devel@nongnu.org; Sat, 11 Oct 2008 05:20:03 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Koadj-0007rC-7N for qemu-devel@nongnu.org; Sat, 11 Oct 2008 09:19:59 +0000 Received: from balrog by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Koadi-0007r8-T7 for qemu-devel@nongnu.org; Sat, 11 Oct 2008 09:19:59 +0000 MIME-Version: 1.0 Errors-To: balrog Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Andrzej Zaborowski Message-Id: Date: Sat, 11 Oct 2008 09:19:58 +0000 Subject: [Qemu-devel] [5454] Increase write buffer size in pflash emulation (Thomas Petazzoni). Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5454 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5454 Author: balrog Date: 2008-10-11 09:19:57 +0000 (Sat, 11 Oct 2008) Log Message: ----------- Increase write buffer size in pflash emulation (Thomas Petazzoni). 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 Modified Paths: -------------- trunk/hw/pflash_cfi01.c Modified: trunk/hw/pflash_cfi01.c =================================================================== --- trunk/hw/pflash_cfi01.c 2008-10-09 18:52:04 UTC (rev 5453) +++ trunk/hw/pflash_cfi01.c 2008-10-11 09:19:57 UTC (rev 5454) @@ -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;