From: Przemyslaw Marczak 
Date: Wed, 30 Apr 2014 11:28:07 +0000 (+0200)
Subject: samsung: misc: add gpt restore option to lcd menu
X-Git-Tag: v2014.07-rc2~9^2~6^2~7
X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c7b8a379fbd9b069c95332204c359f61a7f1594;p=u-boot
samsung: misc: add gpt restore option to lcd menu
This menu option allows restore gpt.
This is usefull and no needs access to the u-boot console.
For proper operation:
- each partition uuid should be set in environment or
- CONFIG_RANDOM_UUID should be defined for automatically uuid setting
After operation success device is going to be reset.
Signed-off-by: Przemyslaw Marczak 
Cc: Minkyu Kang 
Signed-off-by: Minkyu Kang 
---
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c
index 95d1758f7a..2fd104d0fe 100644
--- a/board/samsung/common/misc.c
+++ b/board/samsung/common/misc.c
@@ -121,6 +121,7 @@ mode_name[BOOT_MODE_EXIT + 1][2] = {
 	{"THOR", "thor"},
 	{"UMS", "ums"},
 	{"DFU", "dfu"},
+	{"GPT", "gpt"},
 	{"EXIT", ""},
 };
 
@@ -130,6 +131,7 @@ mode_info[BOOT_MODE_EXIT + 1] = {
 	"downloader",
 	"mass storage",
 	"firmware update",
+	"restore",
 	"and run normal boot"
 };
 
@@ -139,6 +141,7 @@ mode_cmd[BOOT_MODE_EXIT + 1] = {
 	"thor 0 mmc 0",
 	"ums 0 mmc 0",
 	"dfu 0 mmc 0",
+	"gpt write mmc 0 $partitions",
 	"",
 };
 
diff --git a/include/samsung/misc.h b/include/samsung/misc.h
index ede6c1583a..c3d844bc10 100644
--- a/include/samsung/misc.h
+++ b/include/samsung/misc.h
@@ -15,6 +15,7 @@ enum {
 	BOOT_MODE_THOR,
 	BOOT_MODE_UMS,
 	BOOT_MODE_DFU,
+	BOOT_MODE_GPT,
 	BOOT_MODE_EXIT,
 };