cmd_df.c 618 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Command for accessing DataFlash.
  3. *
  4. * Copyright (C) 2008 Atmel Corporation
  5. */
  6. #include <common.h>
  7. #include <df.h>
  8. static int do_df(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
  9. {
  10. const char *cmd;
  11. /* need at least two arguments */
  12. if (argc < 2)
  13. goto usage;
  14. cmd = argv[1];
  15. if (strcmp(cmd, "init") == 0) {
  16. df_init(0, 0, 1000000);
  17. return 0;
  18. }
  19. if (strcmp(cmd, "info") == 0) {
  20. df_show_info();
  21. return 0;
  22. }
  23. usage:
  24. cmd_usage(cmdtp);
  25. return 1;
  26. }
  27. U_BOOT_CMD(
  28. sf, 2, 1, do_serial_flash,
  29. "sf - Serial flash sub-system\n",
  30. "probe [bus:]cs - init flash device on given SPI bus and CS\n")