static void at91_nand_mem_write(void *opaque, target_phys_addr_t offset, uint32_t value) { NandState *s = opaque; nand_setpins(s->nand_state, offset & (1 << 22), offset & (1 << 21), 0, 1, 0); DPRINTF("(IP %X) write to %X %X\n", g_env->regs[15], offset, value); nand_setio(s->nand_state, value & 0xFF); }
static void nand_writel (void *opaque, target_phys_addr_t addr, uint32_t value) { struct nand_state_t *s = opaque; int rdy; DNAND(printf("%s addr=%x v=%x\n", __func__, addr, value)); nand_setpins(s->nand, s->cle, s->ale, s->ce, 1, 0); nand_setio(s->nand, value); nand_getpins(s->nand, &rdy); s->rdy = rdy; }
static void nand_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { struct nand_state_t *s = opaque; int rdy; DNAND(printf("%s addr=%x v=%x\n", __func__, addr, (unsigned)value)); nand_setpins(s->nand, s->cle, s->ale, s->ce, 1, 0); nand_setio(s->nand, value); nand_getpins(s->nand, &rdy); s->rdy = rdy; }
static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) { // fprintf(stderr, "tc6393xb_nand: write at %08x: %02x\n", // (uint32_t) addr, value & 0xff); switch (addr) { case NAND_DATA + 0: case NAND_DATA + 1: case NAND_DATA + 2: case NAND_DATA + 3: nand_setio(s->flash, value); s->nand.isr |= 1; tc6393xb_nand_irq(s); return; case NAND_MODE: s->nand.mode = value; nand_setpins(s->flash, value & NAND_MODE_CLE, value & NAND_MODE_ALE, !(value & NAND_MODE_CE), value & NAND_MODE_WP, 0); // FIXME: gnd switch (value & NAND_MODE_ECC_MASK) { case NAND_MODE_ECC_RST: ecc_reset(&s->ecc); break; case NAND_MODE_ECC_READ: // FIXME break; case NAND_MODE_ECC_EN: ecc_reset(&s->ecc); } return; case NAND_ISR: s->nand.isr = value; tc6393xb_nand_irq(s); return; case NAND_IMR: s->nand.imr = value; tc6393xb_nand_irq(s); return; } fprintf(stderr, "tc6393xb_nand: unhandled write at %08x: %02x\n", (uint32_t) addr, value & 0xff); }