cmd_boot.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. * Boot support
  25. */
  26. #ifndef _CMD_BOOT_H
  27. #define _CMD_BOOT_H
  28. #if (CONFIG_COMMANDS & CFG_CMD_BDI)
  29. #define CMD_TBL_BDINFO MK_CMD_TBL_ENTRY( \
  30. "bdinfo", 2, 1, 1, do_bdinfo, \
  31. "bdinfo - print Board Info structure\n", \
  32. NULL \
  33. ),
  34. int do_bdinfo (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  35. #else
  36. #define CMD_TBL_BDINFO
  37. #endif
  38. #define CMD_TBL_GO MK_CMD_TBL_ENTRY( \
  39. "go", 2, CFG_MAXARGS, 1, do_go, \
  40. "go - start application at address 'addr'\n", \
  41. "addr [arg ...]\n - start application at address 'addr'\n" \
  42. " passing 'arg' as arguments\n" \
  43. ),
  44. int do_go (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  45. #if (CONFIG_COMMANDS & CFG_CMD_LOADS)
  46. #ifdef CFG_LOADS_BAUD_CHANGE
  47. #define CMD_TBL_LOADS MK_CMD_TBL_ENTRY( \
  48. "loads", 5, 3, 0, do_load_serial, \
  49. "loads - load S-Record file over serial line\n", \
  50. "[ off ] [ baud ]\n" \
  51. " - load S-Record file over serial line" \
  52. " with offset 'off' and baudrate 'baud'\n" \
  53. ),
  54. #else /* ! CFG_LOADS_BAUD_CHANGE */
  55. #define CMD_TBL_LOADS MK_CMD_TBL_ENTRY( \
  56. "loads", 5, 2, 0, do_load_serial, \
  57. "loads - load S-Record file over serial line\n", \
  58. "[ off ]\n" \
  59. " - load S-Record file over serial line with offset 'off'\n" \
  60. ),
  61. #endif /* CFG_LOADS_BAUD_CHANGE */
  62. int do_load_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  63. /*
  64. * SAVES always requires LOADS support, but not vice versa
  65. */
  66. #if (CONFIG_COMMANDS & CFG_CMD_SAVES)
  67. #ifdef CFG_LOADS_BAUD_CHANGE
  68. #define CMD_TBL_SAVES MK_CMD_TBL_ENTRY( \
  69. "saves", 5, 4, 0, do_save_serial, \
  70. "saves - save S-Record file over serial line\n", \
  71. "[ off ] [size] [ baud ]\n" \
  72. " - save S-Record file over serial line" \
  73. " with offset 'off', size 'size' and baudrate 'baud'\n" \
  74. ),
  75. #else /* ! CFG_LOADS_BAUD_CHANGE */
  76. #define CMD_TBL_SAVES MK_CMD_TBL_ENTRY( \
  77. "saves", 5, 3, 0, do_save_serial, \
  78. "saves - save S-Record file over serial line\n", \
  79. "[ off ] [size]\n" \
  80. " - save S-Record file over serial line with offset 'off' and size 'size'\n" \
  81. ),
  82. #endif /* CFG_LOADS_BAUD_CHANGE */
  83. int do_save_serial (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  84. #else /* ! CFG_CMD_SAVES */
  85. #define CMD_TBL_SAVES
  86. #endif /* CFG_CMD_SAVES */
  87. #else /* ! CFG_CMD_LOADS */
  88. #define CMD_TBL_LOADS
  89. #define CMD_TBL_SAVES
  90. #endif /* CFG_CMD_LOADS */
  91. #if (CONFIG_COMMANDS & CFG_CMD_LOADB)
  92. #define CMD_TBL_LOADB MK_CMD_TBL_ENTRY( \
  93. "loadb", 5, 3, 0, do_load_serial_bin, \
  94. "loadb - load binary file over serial line (kermit mode)\n", \
  95. "[ off ] [ baud ]\n" \
  96. " - load binary file over serial line" \
  97. " with offset 'off' and baudrate 'baud'\n" \
  98. ),
  99. int do_load_serial_bin (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  100. #else
  101. #define CMD_TBL_LOADB
  102. #endif /* CFG_CMD_LOADB */
  103. #define CMD_TBL_RESET MK_CMD_TBL_ENTRY( \
  104. "reset", 5, 1, 0, do_reset, \
  105. "reset - Perform RESET of the CPU\n", \
  106. NULL \
  107. ),
  108. /* Implemented in $(CPU)/cpu.c */
  109. int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  110. #if (CONFIG_COMMANDS & CFG_CMD_HWFLOW)
  111. #define CMD_TBL_HWFLOW MK_CMD_TBL_ENTRY( \
  112. "hwflow [on|off]", 2, 2, 0, do_hwflow, \
  113. "hwflow - turn the harwdare flow control on/off\n", \
  114. "\n - change RTS/CTS hardware flow control over serial line\n" \
  115. ),
  116. int do_hwflow (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  117. #else
  118. #define CMD_TBL_HWFLOW
  119. #endif
  120. #endif /* _CMD_BOOT_H */