aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@petalogix.com>2010-01-24 19:28:55 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-01-24 19:28:55 +0100
commite9cbbcacb65c6868b58ca5a586ea657cdd2a9e92 (patch)
treef61eaf068a38c269fba20d4b8f03d6ec3b7e17c8 /hw
parent4737fa266e54564f48bd8f1d72d50a637e093f8a (diff)
pflash: Dont open memarea for full IO if already done.
When wcycle is non zero the area is already opened for readable IO. Avoiding the re-registration of the memarea significantly speeds up the flash emulation. In particular for flashes connected through 8 or 16-bit buses. Signed-off-by: Edgar E. Iglesias <edgar.iglesias@petalogix.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pflash_cfi01.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
index b0c7b4ca32..d9e30d9942 100644
--- a/hw/pflash_cfi01.c
+++ b/hw/pflash_cfi01.c
@@ -247,8 +247,10 @@ static void pflash_write(pflash_t *pfl, target_phys_addr_t offset,
DPRINTF("%s: writing offset " TARGET_FMT_plx " value %08x width %d wcycle 0x%x\n",
__func__, offset, value, width, pfl->wcycle);
- /* Set the device in I/O access mode */
- cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem);
+ if (!pfl->wcycle) {
+ /* Set the device in I/O access mode */
+ cpu_register_physical_memory(pfl->base, pfl->total_len, pfl->fl_mem);
+ }
switch (pfl->wcycle) {
case 0: