OSDN Git Service

Add OneNAND Unlock All command (Kyungmin Park).
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 23 Jul 2008 16:35:45 +0000 (16:35 +0000)
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 23 Jul 2008 16:35:45 +0000 (16:35 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4930 c046a42c-6fe2-441c-8c8c-71466251a162

hw/onenand.c

index d63ecea..5e51089 100644 (file)
@@ -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;