cmd_spibootldr.c 766 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * U-boot - spibootldr.c
  3. *
  4. * Copyright (c) 2005-2008 Analog Devices Inc.
  5. *
  6. * See file CREDITS for list of people who contributed to this
  7. * project.
  8. *
  9. * Licensed under the GPL-2 or later.
  10. */
  11. #include <common.h>
  12. #include <command.h>
  13. #include <asm/blackfin.h>
  14. #include <asm/mach-common/bits/bootrom.h>
  15. int do_spibootldr(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  16. {
  17. s32 addr;
  18. /* Get the address */
  19. if (argc < 2)
  20. addr = 0;
  21. else
  22. addr = simple_strtoul(argv[1], NULL, 16);
  23. printf("## Booting ldr image at SPI offset 0x%x ...\n", addr);
  24. return bfrom_SpiBoot(addr, BFLAG_PERIPHERAL | 4, 0, NULL);
  25. }
  26. U_BOOT_CMD(spibootldr, 2, 0, do_spibootldr,
  27. "boot ldr image from spi",
  28. "[offset]\n"
  29. " - boot ldr image stored at offset into spi\n");