cmd_nand.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. * NAND support
  19. */
  20. #ifndef _CMD_NAND_H
  21. #define _CMD_NAND_H
  22. #include <common.h>
  23. #include <command.h>
  24. #if (CONFIG_COMMANDS & CFG_CMD_NAND)
  25. #define CMD_TBL_NAND MK_CMD_TBL_ENTRY( \
  26. "nand", 3, 5, 1, do_nand, \
  27. "nand - NAND sub-system\n", \
  28. "info - show available NAND devices\n" \
  29. "nand device [dev] - show or set current device\n" \
  30. "nand read[.jffs2] addr off size\n" \
  31. "nand write[.jffs2] addr off size - read/write `size' bytes starting\n" \
  32. " at offset `off' to/from memory address `addr'\n" \
  33. "nand erase [clean] [off size] - erase `size' bytes from\n" \
  34. " offset `off' (entire device if not specified)\n" \
  35. "nand bad - show bad blocks\n" \
  36. "nand read.oob addr off size - read out-of-band data\n" \
  37. "nand write.oob addr off size - read out-of-band data\n" \
  38. ),
  39. #define CMD_TBL_NANDBOOT MK_CMD_TBL_ENTRY( \
  40. "nboot", 4, 4, 1, do_nandboot, \
  41. "nboot - boot from NAND device\n", \
  42. "loadAddr dev\n" \
  43. ),
  44. int do_nand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  45. int do_nandboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  46. #else
  47. #define CMD_TBL_NAND
  48. #define CMD_TBL_NANDBOOT
  49. #endif
  50. #endif /* _CMD_NAND_H */