ARM NAND I/O interface update
authorDean Glazeski <dnglaze@gmail.com>
Mon, 16 Nov 2009 19:34:24 +0000 (13:34 -0600)
committerDavid Brownell <dbrownell@users.sourceforge.net>
Fri, 4 Dec 2009 01:29:41 +0000 (17:29 -0800)
Modify the arm_nand_data struct to better support both read and
write operations while using the same struct.  An additional
field was added, and initialized, to record the last operation
so that the correct code can be loaded to the working area.

[dbrownell@users.sourceforge.net: merge init patch, tweak GPL note]

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
src/flash/arm_nandio.h
src/flash/nand/davinci.c
src/flash/nand/orion.c

index 27b3ad35139427f31756e28ff5fdaf017386d9dc..d3504f434d7a5a62d4b962ca1030ba9684d86fc9 100644 (file)
@@ -1,25 +1,55 @@
+/*
+ * Copyright (C) 2009 by David Brownell
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
 #ifndef __ARM_NANDIO_H
 #define __ARM_NANDIO_H
 
 #include <flash/nand.h>
 #include <helper/binarybuffer.h>
 
+/**
+ * Available operational states the arm_nand_data struct can be in.
+ */
+enum arm_nand_op {
+       ARM_NAND_NONE, /**< No operation performed. */
+       ARM_NAND_READ, /**< Read operation performed. */
+       ARM_NAND_WRITE, /**< Write operation performed. */
+};
+
 /**
  * The arm_nand_data struct is used for defining NAND I/O operations on an ARM
  * core.
  */
 struct arm_nand_data {
-       /** target is proxy for some ARM core */
-       struct target           *target;
+       /** Target is proxy for some ARM core. */
+       struct target *target;
 
-       /** copy_area holds write-to-NAND loop and data to write */
+       /** The copy area holds code loop and data for I/O operations. */
        struct working_area     *copy_area;
 
-       /** chunk_size == page or ECC unit */
-       unsigned                chunk_size;
+       /** The chunk size is the page size or ECC chunk. */
+       unsigned chunk_size;
+
+       /** Where data is read from or written to. */
+       uint32_t data;
 
-       /** data == where to write the data */
-       uint32_t                data;
+       /** Last operation executed using this struct. */
+       enum arm_nand_op op;
 
        /* currently implicit:  data width == 8 bits (not 16) */
 };
index 40be36d46e5ce8f05dc8472a8d66c28d881544da..66770737c81051e21af7486e55bc7ac1ce89b6fe 100644 (file)
@@ -710,6 +710,7 @@ NAND_DEVICE_COMMAND_HANDLER(davinci_nand_device_command)
 
        info->io.target = target;
        info->io.data = info->data;
+       info->io.op = ARM_NAND_NONE;
 
        /* NOTE:  for now we don't do any error correction on read.
         * Nothing else in OpenOCD currently corrects read errors,
index 436151fbaa973943ece267e058cfdbefdee64a1e..b124deee6f086848a787a06a0dd5ae96750c0b77 100644 (file)
@@ -155,6 +155,7 @@ NAND_DEVICE_COMMAND_HANDLER(orion_nand_device_command)
 
        hw->io.target = hw->target;
        hw->io.data = hw->data;
+       hw->io.op = ARM_NAND_NONE;
 
        return ERROR_OK;
 }

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)