summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xboard/samsung/common/odroid_misc.c28
-rwxr-xr-xinclude/samsung/odroid_misc.h1
2 files changed, 23 insertions, 6 deletions
diff --git a/board/samsung/common/odroid_misc.c b/board/samsung/common/odroid_misc.c
index 78d65c861e..02078c0753 100755
--- a/board/samsung/common/odroid_misc.c
+++ b/board/samsung/common/odroid_misc.c
@@ -334,13 +334,20 @@ static uint upload_file(const char *fname, const char *pname,
uint mem_addr, struct upload_info *upinfo)
{
char cmd[64];
- unsigned long filesize = 0;
+ unsigned long filesize = 0, fileload_part = 0;
/* env variable init */
setenv("filesize", "0");
memset(cmd, 0x00, sizeof(cmd));
- sprintf(cmd, "ext4load mmc 0:3 %x media/0/update/%s", mem_addr, fname);
+
+ /* file load from userdata area */
+ fileload_part = getenv_ulong("fileload_part", 10, 0);
+
+ if (fileload_part)
+ sprintf(cmd, "ext4load mmc 0:3 %x media/0/update/%s", mem_addr, fname);
+ else
+ sprintf(cmd, "fatload mmc 0:1 %x update/%s", mem_addr, fname);
run_command(cmd, 0);
/* file size check */
@@ -436,6 +443,11 @@ static void odroid_fw_update(unsigned int option)
memset(upinfo, 0x00, sizeof(upinfo));
+ if (option & OPTION_FILELOAD_EXT4)
+ setenv_ulong("fileload_part", 3);
+ else
+ setenv_ulong("fileload_part", 0);
+
upload_addr = getenv_ulong("loadaddr", 16, 0);
if (!upload_addr)
upload_addr = CFG_FASTBOOT_TRANSFER_BUFFER;
@@ -446,6 +458,13 @@ static void odroid_fw_update(unsigned int option)
upload_addr = upload_file("cache.img",
"cache", upload_addr, &upinfo[PART_CACHE]);
+ if (option & OPTION_ERASE_USERDATA) {
+ if ((option & OPTION_RESIZE_PART) == 0) {
+ upload_addr = upload_file("userdata.img",
+ "userdata", upload_addr, &upinfo[PART_USERDATA]);
+ }
+ }
+
upload_addr = upload_file("zImage",
"kernel", upload_addr, &upinfo[PART_KERNEL]);
@@ -496,10 +515,7 @@ static void odroid_fw_update(unsigned int option)
if (option & OPTION_ERASE_FAT)
run_command("fatformat mmc 0:1", 0);
- if (option & OPTION_ERASE_FAT)
- run_command("fatformat mmc 0:3", 0);
-
- odroid_led_ctrl(GPIO_LED_B, 1);
+ odroid_led_ctrl(GPIO_LED_B, 0);
}
/*---------------------------------------------------------------------------*/
diff --git a/include/samsung/odroid_misc.h b/include/samsung/odroid_misc.h
index 629867ab7e..57417e4b38 100755
--- a/include/samsung/odroid_misc.h
+++ b/include/samsung/odroid_misc.h
@@ -20,6 +20,7 @@
#define OPTION_ERASE_ENV 0x04
#define OPTION_UPDATE_UBOOT 0x08
#define OPTION_RESIZE_PART 0x10
+#define OPTION_FILELOAD_EXT4 0x20
enum {
PART_FWBL1 = 0,