Skip to contentSkip to conversation

Add OneNAND Unlock All command

PATCH New Kyungmin Park 1 participant 1 message Jul 22, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add OneNAND Unlock All command

Add OneNAND Unlock All command

---
 hw/onenand.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
hw/onenand.c +16 -0
index d63ecea..719e55f 100644
@@ -355,6 +355,22 @@ 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 block(s) */
+        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;
 
Signature · 1 line
1.5.3.3