Re: [U-Boot] [PATCH v3 3/3] fastboot: ARM: OMAP5: Enable reboot-bootloader

2015-03-27 Thread Tom Rini
On Wed, Mar 25, 2015 at 04:04:52AM +0530, Dileep Katta wrote:

 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.
[snip]
 + printf(Setting reboot to fastboot flag ...\n);
 + setenv(dofastboot, 1);
 + saveenv();
 + udelay(60);
[snip]
  #define CONFIG_BOOTCOMMAND \
 + if test ${dofastboot} -eq 1; then  \
 + echo Boot fastboot requested, resetting dofastboot ...; \
 + setenv dofastboot 0; saveenv; sleep 1; \
 + echo Booting into fastboot ...; fastboot; \

No.  When saveenv returns environment is saved.  If it doesn't there's a
bug that must be addressed.

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 3/3] fastboot: ARM: OMAP5: Enable reboot-bootloader

2015-03-27 Thread Dileep Katta
On 27/03/2015, Tom Rini tr...@konsulko.com wrote:
 On Wed, Mar 25, 2015 at 04:04:52AM +0530, Dileep Katta wrote:

 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.
 [snip]
 +printf(Setting reboot to fastboot flag ...\n);
 +setenv(dofastboot, 1);
 +saveenv();
 +udelay(60);
 [snip]
  #define CONFIG_BOOTCOMMAND \
 +if test ${dofastboot} -eq 1; then  \
 +echo Boot fastboot requested, resetting dofastboot ...; \
 +setenv dofastboot 0; saveenv; sleep 1; \
 +echo Booting into fastboot ...; fastboot; \

 No.  When saveenv returns environment is saved.  If it doesn't there's a
 bug that must be addressed.
sleep/udelay not required. Will remove and send an updated patch.

 --
 Tom

Thanks for the comment.
Regards, Dileep
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 3/3] fastboot: ARM: OMAP5: Enable reboot-bootloader

2015-03-24 Thread Dileep Katta
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 angelaba...@ti.com
Signed-off-by: Dileep Katta dileep.ka...@linaro.org
---
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

 arch/arm/cpu/armv7/omap-common/boot-common.c | 11 +++
 include/configs/ti_omap5_common.h|  7 +++
 2 files changed, 18 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..1aff7c8 100644
--- a/arch/arm/cpu/armv7/omap-common/boot-common.c
+++ b/arch/arm/cpu/armv7/omap-common/boot-common.c
@@ -162,3 +162,14 @@ 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();
+   udelay(60);
+   return 0;
+}
+#endif
diff --git a/include/configs/ti_omap5_common.h 
b/include/configs/ti_omap5_common.h
index cd92454..c5d97ea 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; sleep 1; \
+   echo Booting into fastboot ...; fastboot; \
+   fi; \
run findfdt;  \
run mmcboot; \
setenv mmcdev 1;  \
setenv bootpart 1:2;  \
setenv mmcroot /dev/mmcblk0p2 rw;  \
run mmcboot; \
+   
 
 
 /*
-- 
1.8.3.2

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot