From patchwork Mon Jan 25 05:08:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andes X-Patchwork-Id: 572602 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 5A0F91402BF for ; Mon, 25 Jan 2016 16:32:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 730F84BE8A; Mon, 25 Jan 2016 06:31:57 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lSNQ4YFIgv-Y; Mon, 25 Jan 2016 06:31:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2BB44BA17; Mon, 25 Jan 2016 06:31:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BEDB54BA17 for ; Mon, 25 Jan 2016 06:31:50 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Eu38jSml0xDw for ; Mon, 25 Jan 2016 06:31:50 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail.andestech.com (118-163-51-199.HINET-IP.hinet.net [118.163.51.199]) by theia.denx.de (Postfix) with ESMTPS id 4AA974BA16 for ; Mon, 25 Jan 2016 06:31:45 +0100 (CET) Received: from app09.andestech.com (10.0.4.82) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Mon, 25 Jan 2016 13:31:33 +0800 From: Andes To: , , , Date: Mon, 25 Jan 2016 13:08:15 +0800 Message-ID: <1453698495-8006-1-git-send-email-uboot@andestech.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-Originating-IP: [10.0.4.82] Subject: [U-Boot] [PATCH] nds32: fix mmc rescan hang problem. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: rick When execute mmc rescan command, system will hang. Signed-off-by: rick --- 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