cmd_fitupd.c 789 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * (C) Copyright 2011
  3. * Andreas Pretzsch, carpe noctem engineering, apr@cn-eng.de
  4. *
  5. * This file is released under the terms of GPL v2 and any later version.
  6. * See the file COPYING in the root directory of the source tree for details.
  7. */
  8. #include <common.h>
  9. #include <command.h>
  10. #if !defined(CONFIG_UPDATE_TFTP)
  11. #error "CONFIG_UPDATE_TFTP required"
  12. #endif
  13. extern int update_tftp(ulong addr);
  14. static int do_fitupd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  15. {
  16. ulong addr = 0UL;
  17. if (argc > 2)
  18. return CMD_RET_USAGE;
  19. if (argc == 2)
  20. addr = simple_strtoul(argv[1], NULL, 16);
  21. return update_tftp(addr);
  22. }
  23. U_BOOT_CMD(fitupd, 2, 0, do_fitupd,
  24. "update from FIT image",
  25. "[addr]\n"
  26. "\t- run update from FIT image at addr\n"
  27. "\t or from tftp 'updatefile'"
  28. );