static void onenand_reset(OneNANDState *s, int cold)

{

    memset(&s->addr, 0, sizeof(s->addr));

    s->command = 0;

    s->count = 1;

    s->bufaddr = 0;

    s->config[0] = 0x40c0;

    s->config[1] = 0x0000;

    onenand_intr_update(s);

    qemu_irq_raise(s->rdy);

    s->status = 0x0000;

    s->intstatus = cold ? 0x8080 : 0x8010;

    s->unladdr[0] = 0;

    s->unladdr[1] = 0;

    s->wpstatus = 0x0002;

    s->cycle = 0;

    s->otpmode = 0;

    s->blk_cur = s->blk;

    s->current = s->image;

    s->secs_cur = s->secs;



    if (cold) {

        /* Lock the whole flash */

        memset(s->blockwp, ONEN_LOCK_LOCKED, s->blocks);



        if (s->blk_cur && blk_read(s->blk_cur, 0, s->boot[0], 8) < 0) {

            hw_error("%s: Loading the BootRAM failed.\n", __func__);

        }

    }

}

static void onenand_reset(OneNANDState *s, int cold)

{

    memset(&s->addr, 0, sizeof(s->addr));

    s->command = 0;

    s->count = 1;

    s->bufaddr = 0;

    s->config[0] = 0x40c0;

    s->config[1] = 0x0000;

    onenand_intr_update(s);

    qemu_irq_raise(s->rdy);

    s->status = 0x0000;

    s->intstatus = cold ? 0x8080 : 0x8010;

    s->unladdr[0] = 0;

    s->unladdr[1] = 0;

    s->wpstatus = 0x0002;

    s->cycle = 0;

    s->otpmode = 0;

    s->blk_cur = s->blk;

    s->current = s->image;

    s->secs_cur = s->secs;



    if (cold) {

        

        memset(s->blockwp, ONEN_LOCK_LOCKED, s->blocks);



        if (s->blk_cur && blk_read(s->blk_cur, 0, s->boot[0], 8) < 0) {

            hw_error("%s: Loading the BootRAM failed.\n", __func__);

        }

    }

}

        if (s->blk_cur && blk_read(s->blk_cur, 0, s->boot[0], 8) < 0) {
static void FUNC_0(OneNANDState *VAR_0, int VAR_1)

{

    memset(&VAR_0->addr, 0, sizeof(VAR_0->addr));

    VAR_0->command = 0;

    VAR_0->count = 1;

    VAR_0->bufaddr = 0;

    VAR_0->config[0] = 0x40c0;

    VAR_0->config[1] = 0x0000;

    onenand_intr_update(VAR_0);

    qemu_irq_raise(VAR_0->rdy);

    VAR_0->status = 0x0000;

    VAR_0->intstatus = VAR_1 ? 0x8080 : 0x8010;

    VAR_0->unladdr[0] = 0;

    VAR_0->unladdr[1] = 0;

    VAR_0->wpstatus = 0x0002;

    VAR_0->cycle = 0;

    VAR_0->otpmode = 0;

    VAR_0->blk_cur = VAR_0->blk;

    VAR_0->current = VAR_0->image;

    VAR_0->secs_cur = VAR_0->secs;



    if (VAR_1) {

        

        memset(VAR_0->blockwp, ONEN_LOCK_LOCKED, VAR_0->blocks);



        if (VAR_0->blk_cur && blk_read(VAR_0->blk_cur, 0, VAR_0->boot[0], 8) < 0) {

            hw_error("%VAR_0: Loading the BootRAM failed.\n", __func__);

        }

    }

}

static void FUNC_0(OneNANDState *VAR_0, int VAR_1)
{ memset(&VAR_0->addr, 0, sizeof(VAR_0->addr)); VAR_0->command = 0; VAR_0->count = 1; VAR_0->bufaddr = 0; VAR_0->config[0] = 0x40c0; VAR_0->config[1] = 0x0000; onenand_intr_update(VAR_0); qemu_irq_raise(VAR_0->rdy); VAR_0->status = 0x0000; VAR_0->intstatus = VAR_1 ? 0x8080 : 0x8010; VAR_0->unladdr[0] = 0; VAR_0->unladdr[1] = 0; VAR_0->wpstatus = 0x0002; VAR_0->cycle = 0; VAR_0->otpmode = 0; VAR_0->blk_cur = VAR_0->blk; VAR_0->current = VAR_0->image; VAR_0->secs_cur = VAR_0->secs; if (VAR_1) { memset(VAR_0->blockwp, ONEN_LOCK_LOCKED, VAR_0->blocks); if (VAR_0->blk_cur && blk_read(VAR_0->blk_cur, 0, VAR_0->boot[0], 8) < 0) { hw_error("%VAR_0: Loading the BootRAM failed.\n", __func__); } } }