aboutsummaryrefslogtreecommitdiff
path: root/hw/onenand.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/onenand.c')
-rw-r--r--hw/onenand.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/onenand.c b/hw/onenand.c
index d63eceaf23..5e51089bac 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -355,6 +355,21 @@ static void onenand_command(struct onenand_s *s, int cmd)
s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED;
}
break;
+ case 0x27: /* Unlock All NAND array blocks */
+ s->intstatus |= ONEN_INT;
+
+ for (b = 0; b < s->blocks; b ++) {
+ if (b >= s->blocks) {
+ s->status |= ONEN_ERR_CMD;
+ break;
+ }
+ if (s->blockwp[b] == ONEN_LOCK_LOCKTIGHTEN)
+ break;
+
+ s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED;
+ }
+ break;
+
case 0x2a: /* Lock NAND array block(s) */
s->intstatus |= ONEN_INT;