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

Tom Rini trini at konsulko.com
Mon Jan 25 17:13:47 CET 2016


On Mon, Jan 25, 2016 at 01:08:15PM +0800, Andes wrote:

> 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;

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>


More information about the U-Boot mailing list