cmd_enterrcm.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (c) 2012-2019, NVIDIA CORPORATION. All rights reserved.
  4. *
  5. * Derived from code (arch/arm/lib/reset.c) that is:
  6. *
  7. * (C) Copyright 2002
  8. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  9. * Marius Groeger <mgroeger@sysgo.de>
  10. *
  11. * (C) Copyright 2002
  12. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  13. * Alex Zuepke <azu@sysgo.de>
  14. *
  15. * (C) Copyright 2002
  16. * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  17. *
  18. * (C) Copyright 2004
  19. * DAVE Srl
  20. * http://www.dave-tech.it
  21. * http://www.wawnet.biz
  22. * mailto:info@wawnet.biz
  23. *
  24. * (C) Copyright 2004 Texas Insturments
  25. */
  26. #include <common.h>
  27. #include <command.h>
  28. #include <cpu_func.h>
  29. #include <irq_func.h>
  30. #include <asm/arch/tegra.h>
  31. #include <asm/arch-tegra/pmc.h>
  32. static int do_enterrcm(struct cmd_tbl *cmdtp, int flag, int argc,
  33. char *const argv[])
  34. {
  35. puts("Entering RCM...\n");
  36. udelay(50000);
  37. tegra_pmc_writel(2, PMC_SCRATCH0);
  38. disable_interrupts();
  39. reset_cpu(0);
  40. return 0;
  41. }
  42. U_BOOT_CMD(
  43. enterrcm, 1, 0, do_enterrcm,
  44. "reset Tegra and enter USB Recovery Mode",
  45. ""
  46. );