From a5236105dbf7b971715f1ac55f52f716081a0632 Mon Sep 17 00:00:00 2001 From: balrog Date: Sun, 29 Jul 2007 17:34:59 +0000 Subject: [PATCH] Word-reads from spitz NAND controller, patch by Juergen Lock. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3090 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/spitz.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/spitz.c b/hw/spitz.c index c6fb598f49..eaea2e9763 100644 --- a/hw/spitz.c +++ b/hw/spitz.c @@ -78,6 +78,18 @@ static uint32_t sl_readb(void *opaque, target_phys_addr_t addr) return 0; } +static uint32_t sl_readl(void *opaque, target_phys_addr_t addr) +{ + struct sl_nand_s *s = (struct sl_nand_s *) opaque; + addr -= s->target_base; + + if (addr == FLASH_FLASHIO) + return ecc_digest(&s->ecc, nand_getio(s->nand)) | + (ecc_digest(&s->ecc, nand_getio(s->nand)) << 16); + + return sl_readb(opaque, addr); +} + static void sl_writeb(void *opaque, target_phys_addr_t addr, uint32_t value) { @@ -139,7 +151,7 @@ static void sl_flash_register(struct pxa2xx_state_s *cpu, int size) CPUReadMemoryFunc *sl_readfn[] = { sl_readb, sl_readb, - sl_readb, + sl_readl, }; CPUWriteMemoryFunc *sl_writefn[] = { sl_writeb,