aboutsummaryrefslogtreecommitdiff
path: root/hw/onenand.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-23 16:35:45 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-07-23 16:35:45 +0000
commit89588a4b16d3b4fc80542d254b5bd96ed1ff1b3a (patch)
tree70cc47a28c3748987742e21f5b137c596b4a8e41 /hw/onenand.c
parentc904ef0e7ca708462d2b0b10127dae5eb4a555f5 (diff)
Add OneNAND Unlock All command (Kyungmin Park).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4930 c046a42c-6fe2-441c-8c8c-71466251a162
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;