cmd_enterrcm.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
  3. *
  4. * Derived from code (arch/arm/lib/reset.c) that is:
  5. *
  6. * (C) Copyright 2002
  7. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  8. * Marius Groeger <mgroeger@sysgo.de>
  9. *
  10. * (C) Copyright 2002
  11. * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
  12. * Alex Zuepke <azu@sysgo.de>
  13. *
  14. * (C) Copyright 2002
  15. * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
  16. *
  17. * (C) Copyright 2004
  18. * DAVE Srl
  19. * http://www.dave-tech.it
  20. * http://www.wawnet.biz
  21. * mailto:info@wawnet.biz
  22. *
  23. * (C) Copyright 2004 Texas Insturments
  24. *
  25. * See file CREDITS for list of people who contributed to this
  26. * project.
  27. *
  28. * This program is free software; you can redistribute it and/or
  29. * modify it under the terms of the GNU General Public License as
  30. * published by the Free Software Foundation; either version 2 of
  31. * the License, or (at your option) any later version.
  32. *
  33. * This program is distributed in the hope that it will be useful,
  34. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  36. * GNU General Public License for more details.
  37. *
  38. * You should have received a copy of the GNU General Public License
  39. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  40. */
  41. #include <common.h>
  42. #include <asm/arch/tegra.h>
  43. #include <asm/arch-tegra/pmc.h>
  44. static int do_enterrcm(cmd_tbl_t *cmdtp, int flag, int argc,
  45. char * const argv[])
  46. {
  47. struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
  48. puts("Entering RCM...\n");
  49. udelay(50000);
  50. pmc->pmc_scratch0 = 2;
  51. disable_interrupts();
  52. reset_cpu(0);
  53. return 0;
  54. }
  55. U_BOOT_CMD(
  56. enterrcm, 1, 0, do_enterrcm,
  57. "reset Tegra and enter USB Recovery Mode",
  58. ""
  59. );