wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or |
| 3 | * modify it under the terms of the GNU General Public License as |
| 4 | * published by the Free Software Foundation; either version 2 of |
| 5 | * the License, or (at your option) any later version. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | * You should have received a copy of the GNU General Public License |
| 13 | * along with this program; if not, write to the Free Software |
| 14 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 15 | * MA 02111-1307 USA |
| 16 | */ |
| 17 | |
| 18 | /* |
| 19 | * NAND support |
| 20 | */ |
| 21 | #ifndef _CMD_NAND_H |
| 22 | #define _CMD_NAND_H |
| 23 | |
| 24 | #include <common.h> |
| 25 | #include <command.h> |
| 26 | |
| 27 | |
| 28 | #if (CONFIG_COMMANDS & CFG_CMD_NAND) |
| 29 | #define CMD_TBL_NAND MK_CMD_TBL_ENTRY( \ |
wdenk | 7a8e9bed | 2003-05-31 18:35:21 +0000 | [diff] [blame] | 30 | "nand", 3, 5, 1, do_nand, \ |
| 31 | "nand - NAND sub-system\n", \ |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 32 | "info - show available NAND devices\n" \ |
| 33 | "nand device [dev] - show or set current device\n" \ |
wdenk | 7a8e9bed | 2003-05-31 18:35:21 +0000 | [diff] [blame] | 34 | "nand read[.jffs2] addr off size\n" \ |
| 35 | "nand write[.jffs2] addr off size - read/write `size' bytes starting\n" \ |
| 36 | " at offset `off' to/from memory address `addr'\n" \ |
| 37 | "nand erase [clean] [off size] - erase `size' bytes from\n" \ |
| 38 | " offset `off' (entire device if not specified)\n" \ |
| 39 | "nand bad - show bad blocks\n" \ |
| 40 | "nand read.oob addr off size - read out-of-band data\n" \ |
| 41 | "nand write.oob addr off size - read out-of-band data\n" \ |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 42 | ), |
| 43 | |
wdenk | 7a8e9bed | 2003-05-31 18:35:21 +0000 | [diff] [blame] | 44 | #define CMD_TBL_NANDBOOT MK_CMD_TBL_ENTRY( \ |
wdenk | dc7c9a1 | 2003-03-26 06:55:25 +0000 | [diff] [blame] | 45 | "nboot", 4, 4, 1, do_nandboot, \ |
| 46 | "nboot - boot from NAND device\n", \ |
| 47 | "loadAddr dev\n" \ |
| 48 | ), |
| 49 | |
| 50 | int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 51 | int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 52 | |
| 53 | #else |
| 54 | #define CMD_TBL_NAND |
| 55 | #define CMD_TBL_NANDBOOT |
| 56 | #endif |
| 57 | |
| 58 | #endif /* _CMD_NAND_H */ |