summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharles.park <charles.park@hardkernel.com>2017-08-10 09:51:19 +0300
committercodewalker <codewalker@hardkernel.com>2017-08-10 10:49:55 +0300
commit56e056e15dcd9f9b0e64abd7591140cdb78e7cb9 (patch)
tree7124087c50041df76b4cf11124b144da5df6e409
parentd6a572def2e9d3d4a4e6518c1148241af22d95df (diff)
downloadu-boot-56e056e15dcd9f9b0e64abd7591140cdb78e7cb9.tar.xz
ODROID-XU4 : eMMC bootloader update error fix.
Change-Id: I96a5c78bdab6c54e508d6cde0fe2ff6ad106f7b4
-rwxr-xr-xboard/samsung/common/odroid_misc.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/board/samsung/common/odroid_misc.c b/board/samsung/common/odroid_misc.c
index 02078c0753..e490836d3f 100755
--- a/board/samsung/common/odroid_misc.c
+++ b/board/samsung/common/odroid_misc.c
@@ -370,14 +370,12 @@ static uint upload_file(const char *fname, const char *pname,
/*---------------------------------------------------------------------------*/
static void update_raw_image(struct upload_info *upinfo)
{
- struct exynos5_power *pmu =
- (struct exynos5_power *)samsung_get_base_power;
char cmd[64], is_emmc = 0, ptn;
memset(cmd, 0x00, sizeof(cmd));
- if ((pmu->inform3 == BOOT_EMMC_4_4) ||
- (pmu->inform3 == BOOT_EMMC) ) is_emmc = 1;
+ if (!strncmp(getenv("boot_device"), "eMMC", sizeof("eMMC")))
+ is_emmc = 1;
if (!strncmp(upinfo->part_name, "kernel", sizeof("kernel"))) {
sprintf(cmd, "movi w k 0 0x%08x", upinfo->mem_addr);
@@ -505,6 +503,8 @@ static void odroid_fw_update(unsigned int option)
pmu->sysip_dat3 = 0;
run_command(cmd, 0);
}
+ else if (option & OPTION_OLDTYPE_PART)
+ run_command("fdisk -c 0", 0);
for (i = 0; i < PART_MAX; i++)
upload_data_write(&upinfo[i], i > PART_KERNEL ? 0 : 1);
@@ -558,6 +558,18 @@ static void odroid_magic_cmd_check(void)
}
/*---------------------------------------------------------------------------*/
+void odroid_self_update(uint option)
+{
+ struct exynos5_power *pmu =
+ (struct exynos5_power *)samsung_get_base_power();
+
+ pmu->sysip_dat1 = 0; pmu->sysip_dat2 = 0; pmu->sysip_dat3 = 0;
+
+ if (!odroid_partition_setup("0"))
+ odroid_fw_update(option);
+}
+
+/*---------------------------------------------------------------------------*/
/*
ODROID XU3/XU3-Lite/XU4 Hardware Init.
call from board/samsung/common/board.c