summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharles.park <charles.park@hardkernel.com>2017-08-10 09:52:05 +0300
committercodewalker <codewalker@hardkernel.com>2017-08-10 10:50:02 +0300
commit210d6f7e61c120460d07803fa5b3adc0225936fb (patch)
treeffc89f4d22fc093c8d71c0b971197cff4dd1aead
parent56e056e15dcd9f9b0e64abd7591140cdb78e7cb9 (diff)
downloadu-boot-210d6f7e61c120460d07803fa5b3adc0225936fb.tar.xz
ODROID-XU4 : self_update command add.
Change-Id: Ie8537d1c3c0bec4ce1efc5f79d4b1bb6724953ad
-rwxr-xr-xcmd/odroid_fastboot.c39
-rwxr-xr-xinclude/samsung/odroid_misc.h2
2 files changed, 41 insertions, 0 deletions
diff --git a/cmd/odroid_fastboot.c b/cmd/odroid_fastboot.c
index 3019fd6a5c..9db3d71cff 100755
--- a/cmd/odroid_fastboot.c
+++ b/cmd/odroid_fastboot.c
@@ -589,4 +589,43 @@ U_BOOT_CMD(
);
/*---------------------------------------------------------------------------*/
+static int do_self_update(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+{
+ uint option = 0;
+
+ switch(argc) {
+ case 2:
+ if ((argv[1][0] == 'h') || (argv[1][0] == '-'))
+ return CMD_RET_USAGE;
+
+ option = (uint)simple_strtoul(argv[1], NULL, 16);
+ printf("%s : option = 0x%x\n", __func__, option);
+ odroid_self_update(option);
+ return CMD_RET_SUCCESS;
+
+ default :
+ return CMD_RET_USAGE;
+ }
+}
+
+U_BOOT_CMD(
+ self_update, 2, 0, do_self_update,
+ "self update for android",
+ "[ option val ]\n\n"
+ "==== OPTION Value ====\n"
+ "-h or h : usage display\n"
+ "ERASE_USERDATA = 0x01, ERASE_FAT = 0x02, ERASE_ENV = 0x04\n"
+ "UPDATE_UBOOT = 0x08, RESIZE_PART = 0x10, FILELOAD_EXT4 = 0x20\n"
+ "OPTION_OLDTYPE_PART = 0x40\n\n"
+ "RESIZE_PART flag : expand partition for userdata\n"
+ " --> fdisk -c 0 1024 0 256 100\n"
+ " --> System 1G / Userdata expand / Cache 256M / Vfat 100M\n\n"
+ "FILELOAD_EXT4 flag : update file load from userdata partition(ext4)\n"
+ " --> ext4load mmc 0:3 media/0/update\n\n"
+ "OLDTYPE_PART flag : old style partition setup\n"
+ " --> fdisk -c 0\n"
+ " --> System 1G / Userdata 2G / Cache 256M / Vfat expand\n\n"
+);
+
+/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
diff --git a/include/samsung/odroid_misc.h b/include/samsung/odroid_misc.h
index 57417e4b38..32b5ee58c9 100755
--- a/include/samsung/odroid_misc.h
+++ b/include/samsung/odroid_misc.h
@@ -21,6 +21,7 @@
#define OPTION_UPDATE_UBOOT 0x08
#define OPTION_RESIZE_PART 0x10
#define OPTION_FILELOAD_EXT4 0x20
+#define OPTION_OLDTYPE_PART 0x40
enum {
PART_FWBL1 = 0,
@@ -53,6 +54,7 @@ extern int odroid_get_partition_info (const char *ptn, struct partition_info *pi
extern int odroid_partition_setup (char *dev_no);
extern void odroid_led_ctrl (int gpio, int status);
+extern void odroid_self_update (uint option);
extern void odroid_misc_init (void);
extern void odroid_power_off (void);