cmd_flash.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * (C) Copyright 2000
  3. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * FLASH support
  25. */
  26. #ifndef _CMD_FLASH_H
  27. #define _CMD_FLASH_H
  28. #if (CONFIG_COMMANDS & CFG_CMD_FLASH)
  29. #define CMD_TBL_FLINFO MK_CMD_TBL_ENTRY( \
  30. "flinfo", 3, 2, 1, do_flinfo, \
  31. "flinfo - print FLASH memory information\n", \
  32. "\n - print information for all FLASH memory banks\n" \
  33. "flinfo N\n - print information for FLASH memory bank # N\n" \
  34. ),
  35. #define CMD_TBL_FLERASE MK_CMD_TBL_ENTRY( \
  36. "erase", 3, 3, 1, do_flerase, \
  37. "erase - erase FLASH memory\n", \
  38. "start end\n" \
  39. " - erase FLASH from addr 'start' to addr 'end'\n" \
  40. "erase N:SF[-SL]\n - erase sectors SF-SL in FLASH bank # N\n" \
  41. "erase bank N\n - erase FLASH bank # N\n" \
  42. "erase all\n - erase all FLASH banks\n" \
  43. ),
  44. #define CMD_TBL_PROTECT MK_CMD_TBL_ENTRY( \
  45. "protect", 4, 4, 1, do_protect, \
  46. "protect - enable or disable FLASH write protection\n", \
  47. "on start end\n" \
  48. " - protect FLASH from addr 'start' to addr 'end'\n" \
  49. "protect on N:SF[-SL]\n" \
  50. " - protect sectors SF-SL in FLASH bank # N\n" \
  51. "protect on bank N\n - protect FLASH bank # N\n" \
  52. "protect on all\n - protect all FLASH banks\n" \
  53. "protect off start end\n" \
  54. " - make FLASH from addr 'start' to addr 'end' writable\n" \
  55. "protect off N:SF[-SL]\n" \
  56. " - make sectors SF-SL writable in FLASH bank # N\n" \
  57. "protect off bank N\n - make FLASH bank # N writable\n" \
  58. "protect off all\n - make all FLASH banks writable\n" \
  59. ),
  60. int do_flinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  61. int do_flerase(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  62. int do_protect(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  63. #else
  64. #define CMD_TBL_FLINFO
  65. #define CMD_TBL_FLERASE
  66. #define CMD_TBL_PROTECT
  67. #endif /* CFG_CMD_FLASH */
  68. #endif /* _CMD_FLASH_H */