aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Scott <michael.scott@linaro.org>2014-09-28 16:40:46 -0700
committerRob Herring <robh@kernel.org>2014-11-14 15:35:58 -0600
commit54c4edd53b9829b6708924627ce8e0ba8bf84900 (patch)
treee819dfe368ef51dcce3f6702d4e71ec64c8f242d
parente39aab2be7431903035af9b3025b03c5403bfe88 (diff)
fastboot: tegra124: add support for "fastboot oem recovery" command
This sets bit 31 of pmc_scratch0 for a reboot into recovery (Tegra specific) Signed-off-by: Michael Scott <michael.scott@linaro.org>
-rw-r--r--drivers/usb/gadget/f_fastboot.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index e212fae02b..b8396c17fd 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -522,6 +522,15 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req)
static void cb_oem(struct usb_ep *ep, struct usb_request *req)
{
char *cmd = req->buf;
+#if defined(CONFIG_TEGRA124)
+ struct pmc_ctlr *pmc = (struct pmc_ctlr *)NV_PA_PMC_BASE;
+ if (strncmp("recovery", cmd + 4, 8) == 0) {
+ printf("Setting reboot-recovery!\n");
+ writel(readl(&pmc->pmc_scratch0) | (1 << 31), &pmc->pmc_scratch0);
+ fastboot_func->in_req->complete = compl_do_reset;
+ fastboot_tx_write_str("OKAY");
+ } else
+#endif
if (strncmp("unlock", cmd + 4, 8) == 0) {
fastboot_tx_write_str("FAILnot implemented");
}