9
0
Fork 0

tegra: pmc: add command to get into RCM

In RCM aka recovery mode the BootROM waits for a
usbloader to take over control. On most boards this
is triggered by holding a physical switch which may
be inconvinient at times. Add a command to switch
into RCM from software.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2014-06-03 22:34:51 +02:00 committed by Sascha Hauer
parent 0831642edc
commit a41187b2e9
1 changed files with 20 additions and 0 deletions

View File

@ -20,6 +20,7 @@
*/
#include <common.h>
#include <command.h>
#include <init.h>
#include <io.h>
@ -47,6 +48,14 @@ static int tegra20_pmc_probe(struct device_d *dev)
return 0;
}
static int do_tegrarcm(int argc, char *argv[])
{
writel(2, pmc_base + PMC_SCRATCH(0));
reset_cpu(0);
return 0;
}
static __maybe_unused struct of_device_id tegra20_pmc_dt_ids[] = {
{
.compatible = "nvidia,tegra20-pmc",
@ -68,3 +77,14 @@ static int tegra20_pmc_init(void)
return platform_driver_register(&tegra20_pmc_driver);
}
coredevice_initcall(tegra20_pmc_init);
BAREBOX_CMD_HELP_START(tegrarcm)
BAREBOX_CMD_HELP_TEXT("Get into recovery mode without using a physical switch\n")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(tegrarcm)
.cmd = do_tegrarcm,
BAREBOX_CMD_DESC("Usage: tegrarcm")
BAREBOX_CMD_GROUP(CMD_GRP_HWMANIP)
BAREBOX_CMD_HELP(cmd_tegrarcm_help)
BAREBOX_CMD_END