cmd_pip405.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. *
  7. * hacked for PIP405
  8. */
  9. #include <common.h>
  10. #include <command.h>
  11. #include "pip405.h"
  12. #include "../common/common_util.h"
  13. extern void print_pip405_info(void);
  14. extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
  15. /* ------------------------------------------------------------------------- */
  16. int do_pip405(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  17. {
  18. ulong led_on,led_nr;
  19. if (strcmp(argv[1], "info") == 0)
  20. {
  21. print_pip405_info();
  22. return 0;
  23. }
  24. if (strcmp(argv[1], "led") == 0)
  25. {
  26. led_nr = (ulong)simple_strtoul(argv[2], NULL, 10);
  27. led_on = (ulong)simple_strtoul(argv[3], NULL, 10);
  28. if(!led_nr)
  29. user_led0(led_on);
  30. else
  31. user_led1(led_on);
  32. return 0;
  33. }
  34. return (do_mplcommon(cmdtp, flag, argc, argv));
  35. }
  36. U_BOOT_CMD(
  37. pip405, 6, 1, do_pip405,
  38. "PIP405 specific Cmds",
  39. "flash mem [SrcAddr] - updates U-Boot with image in memory\n"
  40. "pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n"
  41. "pip405 flash mps - updates U-Boot with image from MPS"
  42. );
  43. /* ------------------------------------------------------------------------- */