Commit 89588a4b16d3b4fc80542d254b5bd96ed1ff1b3a
1 parent
c904ef0e
Add OneNAND Unlock All command (Kyungmin Park).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4930 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
15 additions
and
0 deletions
hw/onenand.c
@@ -355,6 +355,21 @@ static void onenand_command(struct onenand_s *s, int cmd) | @@ -355,6 +355,21 @@ static void onenand_command(struct onenand_s *s, int cmd) | ||
355 | s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED; | 355 | s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED; |
356 | } | 356 | } |
357 | break; | 357 | break; |
358 | + case 0x27: /* Unlock All NAND array blocks */ | ||
359 | + s->intstatus |= ONEN_INT; | ||
360 | + | ||
361 | + for (b = 0; b < s->blocks; b ++) { | ||
362 | + if (b >= s->blocks) { | ||
363 | + s->status |= ONEN_ERR_CMD; | ||
364 | + break; | ||
365 | + } | ||
366 | + if (s->blockwp[b] == ONEN_LOCK_LOCKTIGHTEN) | ||
367 | + break; | ||
368 | + | ||
369 | + s->wpstatus = s->blockwp[b] = ONEN_LOCK_UNLOCKED; | ||
370 | + } | ||
371 | + break; | ||
372 | + | ||
358 | case 0x2a: /* Lock NAND array block(s) */ | 373 | case 0x2a: /* Lock NAND array block(s) */ |
359 | s->intstatus |= ONEN_INT; | 374 | s->intstatus |= ONEN_INT; |
360 | 375 |