All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add OneNAND Unlock All command
@ 2008-07-22  2:05 Kyungmin Park
  0 siblings, 0 replies; only message in thread
From: Kyungmin Park @ 2008-07-22  2:05 UTC (permalink / raw)
  To: qemu-devel

Add OneNAND Unlock All command

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 hw/onenand.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/hw/onenand.c b/hw/onenand.c
index d63ecea..719e55f 100644
--- a/hw/onenand.c
+++ b/hw/onenand.c
@@ -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;
 
-- 
1.5.3.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-22  2:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22  2:05 [Qemu-devel] [PATCH] Add OneNAND Unlock All command Kyungmin Park

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.