[U-Boot] [PATCH] nds32: fix mmc rescan hang problem.

Andes uboot at andestech.com
Mon Jan 25 06:08:15 CET 2016


From: rick <rick at andestech.com>

When execute mmc rescan command, system will hang.

Signed-off-by: rick <rick at andestech.com>
---
 common/cmd_mmc.c      |    9 +++++++++
 common/env_common.c   |    3 +++
 include/environment.h |    3 +++
 3 files changed, 15 insertions(+)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index dfc1ec8..3090466 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -814,6 +814,15 @@ static cmd_tbl_t cmd_mmc[] = {
 	U_BOOT_CMD_MKENT(setdsr, 2, 0, do_mmc_setdsr, "", ""),
 };
 
+#if defined(__NDS32__)
+#ifdef CONFIG_NEEDS_MANUAL_RELOC
+void mmc_reloc(void)
+{
+	fixup_cmdtable(cmd_mmc, ARRAY_SIZE(cmd_mmc));
+}
+#endif
+#endif
+
 static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	cmd_tbl_t *cp;
diff --git a/common/env_common.c b/common/env_common.c
index af59c72..8e7b0a5 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -253,6 +253,9 @@ void env_relocate(void)
 {
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 	env_reloc();
+#if defined(CONFIG_NDS32)
+	mmc_reloc();
+#endif
 	env_htab.change_ok += gd->reloc_off;
 #endif
 	if (gd->env_valid == 0) {
diff --git a/include/environment.h b/include/environment.h
index 1fdbdad..4bc5326 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -178,6 +178,9 @@ extern unsigned char env_get_char_spec(int);
 
 #if defined(CONFIG_NEEDS_MANUAL_RELOC)
 extern void env_reloc(void);
+#if defined(CONFIG_NDS32)
+extern void mmc_reloc(void);
+#endif
 #endif
 
 #ifdef CONFIG_ENV_IS_IN_MMC
-- 
1.7.9.5



More information about the U-Boot mailing list