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