Stephen Warren | 9cd3f3a | 2012-06-04 09:23:55 +0000 | [diff] [blame] | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 25 | * SPDX-License-Identifier: GPL-2.0+ |
Stephen Warren | 9cd3f3a | 2012-06-04 09:23:55 +0000 | [diff] [blame] | 26 | */ |
| 27 | |
| 28 | #include <common.h> |
Tom Warren | 150c249 | 2012-09-19 15:50:56 -0700 | [diff] [blame] | 29 | #include <asm/arch/tegra.h> |
| 30 | #include <asm/arch-tegra/pmc.h> |
Stephen Warren | 9cd3f3a | 2012-06-04 09:23:55 +0000 | [diff] [blame] | 31 | |
| 32 | static int do_enterrcm(cmd_tbl_t *cmdtp, int flag, int argc, |
| 33 | char * const argv[]) |
| 34 | { |
Tom Warren | 29f3e3f | 2012-09-04 17:00:24 -0700 | [diff] [blame] | 35 | struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE; |
Stephen Warren | 9cd3f3a | 2012-06-04 09:23:55 +0000 | [diff] [blame] | 36 | |
| 37 | puts("Entering RCM...\n"); |
| 38 | udelay(50000); |
| 39 | |
| 40 | pmc->pmc_scratch0 = 2; |
| 41 | disable_interrupts(); |
| 42 | reset_cpu(0); |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | U_BOOT_CMD( |
| 48 | enterrcm, 1, 0, do_enterrcm, |
| 49 | "reset Tegra and enter USB Recovery Mode", |
| 50 | "" |
| 51 | ); |