All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 1/3] mx6sabresd: Add eMMC specific environment to allow U-Boot update
@ 2014-01-03 17:58 Otavio Salvador
  2014-01-03 17:58 ` [U-Boot] [PATCH v4 2/3] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
  2014-01-03 17:58 ` [U-Boot] [PATCH v4 3/3] wandboard: Set default environment to use zImage Otavio Salvador
  0 siblings, 2 replies; 7+ messages in thread
From: Otavio Salvador @ 2014-01-03 17:58 UTC (permalink / raw)
  To: u-boot

A new 'update_emmc_firmware' target is added to allow for easy U-Boot
update in the eMMC as it has secury boot partition and this needs
specific handling on how to program the specific partition.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
Changes in v4:
- Fix compilation error (Stefano)

Changes in v3: None
Changes in v2: None

 include/configs/mx6sabre_common.h | 23 +++++++++++++++++++++++
 include/configs/mx6sabresd.h      |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/include/configs/mx6sabre_common.h b/include/configs/mx6sabre_common.h
index 21c848f..5ee7fa5 100644
--- a/include/configs/mx6sabre_common.h
+++ b/include/configs/mx6sabre_common.h
@@ -95,6 +95,28 @@
 #define CONFIG_LOADADDR                        0x12000000
 #define CONFIG_SYS_TEXT_BASE           0x17800000
 
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+#define EMMC_ENV \
+	"emmcdev=2\0" \
+	"update_emmc_firmware=" \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \
+		"if ${get_cmd} ${update_sd_firmware_filename}; then " \
+			"if mmc dev ${emmcdev} && " \
+				"mmc open ${emmcdev} 1; then "	\
+				"setexpr fw_sz ${filesize} / 0x200; " \
+				"setexpr fw_sz ${fw_sz} + 1; "	\
+				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
+				"mmc close ${emmcdev} 1; " \
+			"fi; "	\
+		"fi\0"
+#else
+#define EMMC_ENV ""
+#endif
+
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"script=boot.scr\0" \
 	"uimage=uImage\0" \
@@ -121,6 +143,7 @@
 				"mmc write ${loadaddr} 0x2 ${fw_sz}; " \
 			"fi; "	\
 		"fi\0" \
+	EMMC_ENV	  \
 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
 		"root=${mmcroot}\0" \
 	"loadbootscript=" \
diff --git a/include/configs/mx6sabresd.h b/include/configs/mx6sabresd.h
index 3229bc7..4919f53 100644
--- a/include/configs/mx6sabresd.h
+++ b/include/configs/mx6sabresd.h
@@ -23,6 +23,8 @@
 #endif
 #define PHYS_SDRAM_SIZE		(1u * 1024 * 1024 * 1024)
 
+#define CONFIG_SUPPORT_EMMC_BOOT /* eMMC specific */
+
 #include "mx6sabre_common.h"
 
 #define CONFIG_SYS_FSL_USDHC_NUM	3
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-01-06 11:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-03 17:58 [U-Boot] [PATCH v4 1/3] mx6sabresd: Add eMMC specific environment to allow U-Boot update Otavio Salvador
2014-01-03 17:58 ` [U-Boot] [PATCH v4 2/3] wandboard: add Future Eletronics 7" WVGA LCD extension board Otavio Salvador
2014-01-03 17:58 ` [U-Boot] [PATCH v4 3/3] wandboard: Set default environment to use zImage Otavio Salvador
2014-01-03 22:43   ` Wolfgang Denk
2014-01-04 19:36     ` Dennis Gilmore
2014-01-05 12:52       ` Wolfgang Denk
2014-01-06 11:12     ` Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.