* [U-Boot] [PATCH] nds32: fix mmc rescan hang problem.
@ 2016-01-25 5:08 Andes
2016-01-25 16:13 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Andes @ 2016-01-25 5:08 UTC (permalink / raw)
To: u-boot
From: rick <rick@andestech.com>
When execute mmc rescan command, system will hang.
Signed-off-by: rick <rick@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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] [PATCH] nds32: fix mmc rescan hang problem.
2016-01-25 5:08 [U-Boot] [PATCH] nds32: fix mmc rescan hang problem Andes
@ 2016-01-25 16:13 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2016-01-25 16:13 UTC (permalink / raw)
To: u-boot
On Mon, Jan 25, 2016 at 01:08:15PM +0800, Andes wrote:
> From: rick <rick@andestech.com>
>
> When execute mmc rescan command, system will hang.
>
> Signed-off-by: rick <rick@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;
Don't need to test __NDS32__ here.
> 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) {
This should just check CONFIG_ENV_IS_IN_MMC
> 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
Don't need to test __NDS32__ here.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160125/1d8cacd7/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-25 16:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-25 5:08 [U-Boot] [PATCH] nds32: fix mmc rescan hang problem Andes
2016-01-25 16:13 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.