From patchwork Fri Mar 27 17:36:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dileep Katta X-Patchwork-Id: 46436 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CDD7021597 for ; Fri, 27 Mar 2015 17:38:02 +0000 (UTC) Received: by wgfh4 with SMTP id h4sf12425937wgf.1 for ; Fri, 27 Mar 2015 10:38:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:errors-to:sender :x-original-sender:x-original-authentication-results:mailing-list; bh=9utYKCTt6Yom7/b9E7DF/XUD8Dh6VCVCWFwngg7aFhg=; b=hDxv+4BzcFZV8PPLoxgqrTbtZMm86Kel4d/sPZJOKGC5kB/BaGFz4WQ+dho6ycrVYv FfkUZ4kNolO1MzcL4Qk3NYrM3vNb+el9QMmciJ3/viaaLdTQTLH2Yfmzn71Rj6Cb0/Ss mM0pLbzKpBCXfegC4bEGOc3E+0/meUGB74bz4iaEXtKlWV5CNFelJjjP0ZF9QhtAFss3 BDm9KAoIgezokD6uFlqLiP+Y0B9g8bOR8+1A4I6jogyj55auA3pyl+UaQw/Rin5J1fih n728bRZDtVPdbvEGUlBhxH10/Yjt6ESvbL9+3Gw7BCq2K6T7o5sWZxxwFK4OYLUDl3do Py7w== X-Gm-Message-State: ALoCoQldXv07tlprOdX8j429lGogL86YQRj4iw5jOlNM1FNwCzCySKVQNle9iRaV/gG6aVZVXfwE X-Received: by 10.112.180.74 with SMTP id dm10mr4997286lbc.11.1427477882076; Fri, 27 Mar 2015 10:38:02 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.199 with SMTP id le7ls134258lab.89.gmail; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) X-Received: by 10.152.88.1 with SMTP id bc1mr18832230lab.20.1427477881929; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id wr3si1808787lac.110.2015.03.27.10.38.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 10:38:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by labto5 with SMTP id to5so76215196lab.0 for ; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) X-Received: by 10.112.185.66 with SMTP id fa2mr18312145lbc.117.1427477881777; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.57.201 with SMTP id k9csp20742lbq; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) X-Received: by 10.180.77.166 with SMTP id t6mr59995659wiw.52.1427477881196; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id hi8si4289492wib.107.2015.03.27.10.38.00; Fri, 27 Mar 2015 10:38:01 -0700 (PDT) Received-SPF: none (google.com: u-boot-bounces@lists.denx.de does not designate permitted sender hosts) client-ip=85.214.87.163; Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 939C5A7469; Fri, 27 Mar 2015 18:37:59 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hSSEM5O1pow0; Fri, 27 Mar 2015 18:37:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A40D9A742C; Fri, 27 Mar 2015 18:37:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 107B7A742C for ; Fri, 27 Mar 2015 18:37:56 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5ZbiRGYDhCJ8 for ; Fri, 27 Mar 2015 18:37:55 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by theia.denx.de (Postfix) with ESMTPS id 8742CA7428 for ; Fri, 27 Mar 2015 18:37:51 +0100 (CET) Received: by pdnc3 with SMTP id c3so102949309pdn.0 for ; Fri, 27 Mar 2015 10:37:49 -0700 (PDT) X-Received: by 10.70.47.193 with SMTP id f1mr37602230pdn.158.1427477869823; Fri, 27 Mar 2015 10:37:49 -0700 (PDT) Received: from localhost.localdomain ([106.216.172.134]) by mx.google.com with ESMTPSA id i6sm2761882pdp.53.2015.03.27.10.37.25 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Mar 2015 10:37:49 -0700 (PDT) From: Dileep Katta To: trini@konsulko.com, nm@ti.com, rob.herring@linaro.org, srae@broadcom.com, l.majewski@samsung.com, angelabaker@ti.com, robherring2@gmail.com, u-boot@lists.denx.de Date: Fri, 27 Mar 2015 23:06:57 +0530 Message-Id: <1427477817-4986-1-git-send-email-dileep.katta@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: Cc: Dileep Katta Subject: [U-Boot] [PATCH v4 3/3] fastboot: ARM: OMAP5: Enable reboot-bootloader X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: dileep.katta@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Implemented fb_set_reboot_flag() for OMAP5 to set an environment variable 'dofastboot' when reboot-bootloader called. This environment variable will be checked in boot command and fastboot will be called if the variable is set. If the bootcmd env variable of OMAP5 common is overwritten with board-specific command, then these changes will not apply. This was originally intended for DRA7 platform, but now applies to all OMAP5. Ref: http://git.omapzoom.org/?p=repo/u-boot.git;a=commit;h=19da2e436e9806259cf1f4988b9e046ab256bf2c Signed-off-by: Angela Stegmaier Signed-off-by: Dileep Katta --- Changes in v2: - None Changes in v3: - Changed the implementation to be more abstract - Used environment variable instead of board-specific registers - Moved the code to OMAP5 Changes in v4: - Removed udelay and sleep after saveenv arch/arm/cpu/armv7/omap-common/boot-common.c | 10 ++++++++++ include/configs/ti_omap5_common.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/arch/arm/cpu/armv7/omap-common/boot-common.c b/arch/arm/cpu/armv7/omap-common/boot-common.c index 17500f2..55ca94d 100644 --- a/arch/arm/cpu/armv7/omap-common/boot-common.c +++ b/arch/arm/cpu/armv7/omap-common/boot-common.c @@ -162,3 +162,13 @@ void arch_preboot_os(void) ahci_reset(DWC_AHSATA_BASE); } #endif + +#ifdef CONFIG_CMD_FASTBOOT +int fb_set_reboot_flag(void) +{ + printf("Setting reboot to fastboot flag ...\n"); + setenv("dofastboot", "1"); + saveenv(); + return 0; +} +#endif diff --git a/include/configs/ti_omap5_common.h b/include/configs/ti_omap5_common.h index cd92454..24f8021 100644 --- a/include/configs/ti_omap5_common.h +++ b/include/configs/ti_omap5_common.h @@ -141,13 +141,20 @@ "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile};\0" \ DFUARGS \ + #define CONFIG_BOOTCOMMAND \ + "if test ${dofastboot} -eq 1; then " \ + "echo Boot fastboot requested, resetting dofastboot ...;" \ + "setenv dofastboot 0; saveenv;" \ + "echo Booting into fastboot ...; fastboot;" \ + "fi;" \ "run findfdt; " \ "run mmcboot;" \ "setenv mmcdev 1; " \ "setenv bootpart 1:2; " \ "setenv mmcroot /dev/mmcblk0p2 rw; " \ "run mmcboot;" \ + "" /*