cmd_bsp.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. /*
  2. * (C) Copyright 2001, 2002
  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. #ifndef _CMD_BSP_H_
  24. #define _CMD_BSP_H_
  25. #include <common.h>
  26. #include <command.h>
  27. #if (CONFIG_COMMANDS & CFG_CMD_BSP)
  28. /* ----- LWMON ---------------------------------------------------------
  29. */
  30. #if defined(CONFIG_LWMON)
  31. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  32. "pic", 3, 4, 1, do_pic, \
  33. "pic - read and write PIC registers\n", \
  34. "read reg - read PIC register `reg'\n" \
  35. "pic write reg val - write value `val' to PIC register `reg'\n" \
  36. ), MK_CMD_TBL_ENTRY( \
  37. "kbd", 3, 1, 1, do_kbd, \
  38. "kbd - read keyboard status\n", \
  39. NULL \
  40. ), MK_CMD_TBL_ENTRY( \
  41. "lsb", 3, 2, 1, do_lsb, \
  42. "lsb - check and set LSB switch\n", \
  43. "on - switch LSB on\n" \
  44. "lsb off - switch LSB off\n" \
  45. "lsb - print current setting\n" \
  46. ),
  47. int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  48. int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  49. int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  50. #endif /* CONFIG_LWMON */
  51. /* -------------------------------------------------------------------- */
  52. /* ----- PCU E -------------------------------------------------------- */
  53. #if defined(CONFIG_PCU_E)
  54. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  55. "puma", 4, 4, 1, do_puma, \
  56. "puma - access PUMA FPGA\n", \
  57. "status - print PUMA status\n" \
  58. "puma load addr len - load PUMA configuration data\n" \
  59. ),
  60. int do_puma (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  61. #endif /* CONFIG_PCU_E */
  62. /* -------------------------------------------------------------------- */
  63. /* ----- CCM/SCM ------------------------------------------------------ */
  64. #if defined(CONFIG_CCM) || defined(CONFIG_SCM)
  65. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  66. "fpga", 4, 4, 1, do_fpga, \
  67. "fpga - access FPGA(s)\n", \
  68. "fpga status [name] - print FPGA status\n" \
  69. "fpga reset [name] - reset FPGA\n" \
  70. "fpga load [name] addr - load FPGA configuration data\n" \
  71. ),
  72. int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  73. #endif /* CONFIG_CCM, CONFIG_SCM */
  74. /* -------------------------------------------------------------------- */
  75. /* ----- PIP405 ------------------------------------------------------- */
  76. #if defined(CONFIG_PIP405)
  77. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  78. "pip405", 4, 6, 1, do_pip405, \
  79. "pip405 - PIP405 specific Cmds\n", \
  80. "flash mem [SrcAddr] - updates U-Boot with image in memory\n" \
  81. "pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n" \
  82. "pip405 flash mps - updates U-Boot with image from MPS\n" \
  83. ),
  84. int do_pip405 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  85. #endif /* CONFIG_PIP405 */
  86. /* -------------------------------------------------------------------- */
  87. /* ----- MIP405 ------------------------------------------------------- */
  88. #if defined(CONFIG_MIP405)
  89. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  90. "mip405", 4, 6, 1, do_mip405, \
  91. "mip405 - MIP405 specific Cmds\n", \
  92. "flash mem [SrcAddr] - updates U-Boot with image in memory\n" \
  93. "mip405 flash mps - updates U-Boot with image from MPS\n" \
  94. ),
  95. int do_mip405 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  96. #endif /* CONFIG_MIP405 */
  97. /* ----- VCMA9 -----------------------------------------------------------------
  98. */
  99. #if defined(CONFIG_VCMA9)
  100. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  101. "vcma9", 4, 6, 1, do_vcma9, \
  102. "vcma9 - VCMA9 specific Cmds\n", \
  103. "flash mem [SrcAddr] - updates U-Boot with image in memory\n" \
  104. ),
  105. int do_vcma9 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  106. #endif /* CONFIG_VCMA9 */
  107. /* ----------------------------------------------------------------------------*/
  108. /* ----- DASA_SIM ----------------------------------------------------- */
  109. #if defined(CONFIG_DASA_SIM)
  110. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  111. "pci9054", 7, 3, 1, do_pci9054, \
  112. "pci9054 - PLX PCI9054 EEPROM access\n", \
  113. "pci9054 info - print EEPROM values\n" \
  114. "pci9054 update - updates EEPROM with default values\n" \
  115. ),
  116. int do_pci9054 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  117. #endif /* CONFIG_DASA_SIM */
  118. /* -------------------------------------------------------------------- */
  119. /* ----- HYMOD -------------------------------------------------------- */
  120. #if defined(CONFIG_HYMOD)
  121. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  122. "fpga", 4, 6, 1, do_fpga, \
  123. "fpga - FPGA sub-system\n", \
  124. "load [type] addr size\n" \
  125. " - write the configuration data at memory address `addr',\n" \
  126. " size `size' bytes, into the FPGA of type `type' (either\n" \
  127. " `main' or `mezz', default `main'). e.g.\n" \
  128. " `fpga load 100000 7d8f'\n" \
  129. " loads the main FPGA with config data at address 100000\n" \
  130. " HEX, size 7d8f HEX (32143 DEC) bytes\n" \
  131. "fpga tftp file addr\n" \
  132. " - transfers `file' from the tftp server into memory at\n" \
  133. " address `addr', then writes the entire file contents\n" \
  134. " into the main FPGA\n" \
  135. "fpga store addr\n" \
  136. " - read configuration data from the main FPGA (the mezz\n" \
  137. " FPGA is write-only), into address `addr'. There must be\n" \
  138. " enough memory available at `addr' to hold all the config\n"\
  139. " data - the size of which is determined by VC:???\n" \
  140. "fpga info\n" \
  141. " - print information about the Hymod FPGA, namely the\n" \
  142. " memory addresses at which the four FPGA local bus\n" \
  143. " address spaces appear in the physical address space\n" \
  144. ), MK_CMD_TBL_ENTRY( \
  145. "eeclear", 4, 1, 0, do_eecl, \
  146. "eeclear - Clear the eeprom on a Hymod board\n", \
  147. "[type]\n" \
  148. " - write zeroes into the EEPROM on the board of type `type'\n"\
  149. " (`type' is either `main' or `mezz' - default `main')\n" \
  150. " Note: the EEPROM write enable jumper must be installed\n" \
  151. ), MK_CMD_TBL_ENTRY( \
  152. "htest", 5, 1, 0, do_htest, \
  153. "htest - run HYMOD tests\n", \
  154. NULL \
  155. ),
  156. int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  157. int do_eecl (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  158. int do_htest(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  159. #endif /* CONFIG_HYMOD */
  160. /* -------------------------------------------------------------------- */
  161. /* ----- CRAY405 (L1) ------------------------------------------------- */
  162. #if defined (CONFIG_CRAYL1)
  163. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  164. "L1cmd", 5, 4, 1, do_crayL1, \
  165. "L1cmd - L1 update, setup, commands \n", \
  166. "L1cmd update - update flash images from host\n" \
  167. "L1cmd boot - nfs or ramboot L1\n" \
  168. ),
  169. int do_crayL1 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  170. #endif /* CONFIG_CRAY405 */
  171. /* -------------------------------------------------------------------- */
  172. /* ----- EVB64260 ----------------------------------------------------- */
  173. #if defined (CONFIG_EVB64260)
  174. #ifdef CONFIG_ZUMA_V2
  175. #define CMD_TBL_BSP ZUMA_TBL_ENTRY
  176. #define ZUMA_TBL_ENTRY MK_CMD_TBL_ENTRY( \
  177. "zinit", 5, 1, 0, do_zuma_init_pbb, \
  178. "zinit - init zuma pbb\n", \
  179. "\n" \
  180. " - init zuma pbb\n" \
  181. ), MK_CMD_TBL_ENTRY( \
  182. "zdtest", 6, 3, 1, do_zuma_test_dma, \
  183. "zdtest - run dma test\n", \
  184. "[cmd [count]]\n" \
  185. " - run dma cmd (w=0,v=1,cp=2,cmp=3,wi=4,vi=5), count bytes\n" \
  186. ), MK_CMD_TBL_ENTRY( \
  187. "zminit", 5, 1, 0, do_zuma_init_mbox, \
  188. "zminit - init zuma mbox\n", \
  189. "\n" \
  190. " - init zuma mbox\n" \
  191. ),
  192. int do_zuma_init_pbb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  193. int do_zuma_test_dma (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  194. int do_zuma_init_mbox (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  195. void zuma_init_pbb(void);
  196. int zuma_mbox_init(void);
  197. int zuma_test_dma(int cmd, int size);
  198. #else
  199. #define CMD_TBL_BSP
  200. #endif /* ZUMA_NTL */
  201. #endif /* CONFIG_EVB64260 */
  202. /* -------------------------------------------------------------------- */
  203. /* -----W7O------------------------------------------------------------ */
  204. #if defined(CONFIG_W7O)
  205. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  206. "vpd", 3, 2, 1, do_vpd, \
  207. "vpd - Read Vital Product Data\n", \
  208. "[dev_addr]\n" \
  209. " - Read VPD Data from default address, or device address 'dev_addr'.\n" \
  210. ),
  211. extern int do_vpd (cmd_tbl_t *, int, int, char *[]);
  212. #endif /* CONFIG_W7O */
  213. /* -------------------------------------------------------------------- */
  214. /* ---- PCIPPC2 / PCIPPC6 --------------------------------------------- */
  215. #if defined(CONFIG_PCIPPC2) || defined(CONFIG_PCIPPC6)
  216. #if defined(CONFIG_WATCHDOG)
  217. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  218. "wd", 3, 2, 1, do_wd, \
  219. "wd - check and set watchdog\n", \
  220. "on - switch watchDog on\n" \
  221. "wd off - switch watchdog off\n" \
  222. "wd - print current status\n" \
  223. ),
  224. extern int do_wd (cmd_tbl_t *, int, int, char *[]);
  225. #else
  226. #define CMD_TBL_BSP
  227. #endif /* CONFIG_WATCHDOG */
  228. #endif /* CONFIG_PCIPPC2 , CONFIG_PCIPPC6 */
  229. /* -------------------------------------------------------------------- */
  230. /* ----- PN62 --------------------------------------------------------- */
  231. #if defined(CONFIG_PN62)
  232. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  233. "loadpci", 5, 2, 1, do_loadpci, \
  234. "loadpci - load binary file over PCI\n", \
  235. "[addr]\n" \
  236. " - load binary file over PCI to address 'addr'\n" \
  237. ), MK_CMD_TBL_ENTRY( \
  238. "led" , 3, 3, 1, do_led, \
  239. "led - set LED 0..11 on the PN62 board\n", \
  240. "i fun\n" \
  241. " - set 'i'th LED to function 'fun'\n" \
  242. ),
  243. extern int do_loadpci (cmd_tbl_t *, int, int, char *[]);
  244. extern int do_led (cmd_tbl_t *, int, int, char *[]);
  245. #endif /* CONFIG_PN62 */
  246. /* -------------------------------------------------------------------- */
  247. /* ----- TRAB --------------------------------------------------------- */
  248. #if defined(CONFIG_TRAB)
  249. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  250. "kbd", 3, 1, 1, do_kbd, \
  251. "kbd - read keyboard status\n", \
  252. NULL \
  253. ),
  254. int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  255. #endif /* CONFIG_TRAB */
  256. /* -------------------------------------------------------------------- */
  257. /* ----- R360MPI ------------------------------------------------------ */
  258. #if defined(CONFIG_R360MPI)
  259. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  260. "kbd", 3, 1, 1, do_kbd, \
  261. "kbd - read keyboard status\n", \
  262. NULL \
  263. ),
  264. int do_kbd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  265. #endif /* CONFIG_R360MPI */
  266. /* -------------------------------------------------------------------- */
  267. /* ------ AMIGAONEG3SE ------------------------------------------------ */
  268. #if defined(CONFIG_AMIGAONEG3SE)
  269. #define CMD_TBL_BSP /* dummy */
  270. #endif /* AmigaOneG3SE */
  271. /* ----- PCI405 ------------------------------------------------------- */
  272. #if defined(CONFIG_PCI405)
  273. #define CMD_TBL_BSP MK_CMD_TBL_ENTRY( \
  274. "loadpci", 7, 1, 1, do_loadpci, \
  275. "loadpci - wait for sync and boot image\n", \
  276. NULL \
  277. ),
  278. int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  279. #endif /* CONFIG_PCI405 */
  280. /* -------------------------------------------------------------------- */
  281. #else
  282. #define CMD_TBL_BSP
  283. #endif /* CFG_CMD_BSP */
  284. #endif /* _CMD_BSP_H_ */