diff options
author | Lucas Stach <dev@lynxeye.de> | 2014-06-03 22:34:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-06-05 08:01:14 +0200 |
commit | a41187b2e99bf29f4273857f9803777d51a2f6b9 (patch) | |
tree | d2bede3fbf342f6085af0be381665da6866d1f26 /arch | |
parent | 0831642edc4cd48b03b72df44b17180c22f338bd (diff) | |
download | barebox-a41187b2e99bf29f4273857f9803777d51a2f6b9.tar.gz barebox-a41187b2e99bf29f4273857f9803777d51a2f6b9.tar.xz |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/tegra20-pmc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/tegra20-pmc.c b/arch/arm/mach-tegra/tegra20-pmc.c index 1069df9405..37496ac732 100644 --- a/arch/arm/mach-tegra/tegra20-pmc.c +++ b/arch/arm/mach-tegra/tegra20-pmc.c @@ -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 |