From patchwork Fri Dec 4 22:42:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 552908 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 D8DEC1402A0 for ; Sat, 5 Dec 2015 09:42:46 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=nelint.com header.i=@nelint.com header.b=FK8jnzb1; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF2694B692; Fri, 4 Dec 2015 23:42:44 +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 wA-WM9JwFW6D; Fri, 4 Dec 2015 23:42:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BC144B67C; Fri, 4 Dec 2015 23:42:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C99394B67C for ; Fri, 4 Dec 2015 23:42:40 +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 Ez0QU02up4pm for ; Fri, 4 Dec 2015 23:42:40 +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-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by theia.denx.de (Postfix) with ESMTPS id 30A4F4B67B for ; Fri, 4 Dec 2015 23:42:36 +0100 (CET) Received: by pfu207 with SMTP id 207so32573101pfu.2 for ; Fri, 04 Dec 2015 14:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nelint.com; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=gqqLLnFM0JuVbQuybjSz42NimrhjG1RstdzGoKDilr4=; b=FK8jnzb1BcpZzF3bnlv4CHPJRyqi1E35W/xQnvQgfxeaKQNj4s/zC2t5gRHckY2uDY 8MOzwubLje9kLOGSQk2djxuVR6dv24pd3G4J8z/ej8id+aEJmabz5r8cJOm1tvyDiPeB kFG33G140Fwruz2ZRUWc2CY5q55q+ElY6g+S8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=gqqLLnFM0JuVbQuybjSz42NimrhjG1RstdzGoKDilr4=; b=msGh9iryZb1wKJooUVfXG1ODs4HXdj5OxzsmvDww8w/JlWreH9f7SPt6xLo95TnJkU XIqf1EyC8XiKTRXpw9Avj4Afxmeyet/EvkajhgJg/SW7TWKOP6VNKBWmTs7OyCioFdFV 7hpncD9k85froylJwHTJSuITRjw9k1uMVJBaJXj90xuHaHT34o8Z1RcQ6BcI9Z2gFtHM gVDG/YPYjMKLoxqAWokcYkOf5zqbxar8Ph2ZV9iyj8sN2Y099BfYHZ04aXoYoGFcgIu6 Je4lAVJ35X13F5qeq+gIq2gGWSxqC0khVdRfAM2N1++dZfNNO1lHBLPpmVNUF73fctzk a5hA== X-Gm-Message-State: ALoCoQnG+IM47SDgPBEMsi8CmcJ9LBQyhQpFw6COXUlA8lSJEZNTDOn1GbPB6dfQvbF+YW18KNQ/ X-Received: by 10.98.15.67 with SMTP id x64mr25420388pfi.67.1449268955276; Fri, 04 Dec 2015 14:42:35 -0800 (PST) Received: from [192.168.2.184] (ip98-165-107-234.ph.ph.cox.net. [98.165.107.234]) by smtp.gmail.com with ESMTPSA id q70sm19162369pfa.12.2015.12.04.14.42.33 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Dec 2015 14:42:34 -0800 (PST) To: Fabio Estevam References: <5620E3A7.7040909@defengcorp.com> <5624CEC5.8040901@digi.com> <52F917CEA1B9C64C94833D53889D478C269236@dor-sms-xch01.digi.com> <565DEF80.90204@nelint.com> <565F3CD3.1010100@nelint.com> <565F4674.8010306@nelint.com> <5661C0CB.2040900@nelint.com> From: Eric Nelson X-Enigmail-Draft-Status: N1110 Message-ID: <566216D9.4030202@nelint.com> Date: Fri, 4 Dec 2015 15:42:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5661C0CB.2040900@nelint.com> Cc: Cliff Brust , U-Boot-Denx , "Palacios, Hector" , "fabio.estevam@freescale.com" Subject: Re: [U-Boot] mmc erase fails from U-Boot command line 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" Hi all, On 12/04/2015 09:35 AM, Eric Nelson wrote: > Hi Fabio, > > On 12/02/2015 12:53 PM, Fabio Estevam wrote: >> On Wed, Dec 2, 2015 at 5:28 PM, Eric Nelson wrote: >> > ... >>> >>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c >>> index 53084a7..8f5d9e1 100644 >>> --- a/drivers/mmc/mmc.c >>> +++ b/drivers/mmc/mmc.c >>> @@ -105,6 +105,9 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd >>> *cmd, struct mmc_data *data) >>> #else >>> ret = mmc->cfg->ops->send_cmd(mmc, cmd, data); >>> #endif >>> + if (ret) >>> + printf("error %d from CMD_SEND:%d\n", ret, cmd->cmdidx); >>> + >>> return ret; >> >> Applying this change on top of head I get: >> >> => mmc erase 4000 1000 >> >> MMC erase: dev # 2, block # 16384, count 4096 ... Timeout waiting for DAT0 to go >> high! >> error -19 from CMD_SEND:38 >> mmc erase failed >> 0 blocks erased: ERROR > > How easy is this for you to reproduce? > > I'm only seeing the error sporadically, which makes it difficult to > test. > I've figured out a way to repeat this on my machine. If I write 0xff's to the eMMC blocks, then issue an erase for the same, I get the problem with each MMC_ERASE command. I've also found something that fixes the issue in my testing. Changing SECURE_ERASE to 0 from 0x80000000 in include/mmc.h allows things to function for me. Page 115 of the JEDEC eMMC 4.5 spec says that bit 31 is obsolete and should be zero: http://www.jedec.org/sites/default/files/docs/jesd84-B45.pdf Hector and Fabio, can you test that change? Please advise, Eric U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot Tested-by: Fabio Estevam diff --git a/include/mmc.h b/include/mmc.h index cda9a19..b1528d4 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -121,7 +121,7 @@ #define OCR_VOLTAGE_MASK 0x007FFF80 #define OCR_ACCESS_MODE 0x60000000 -#define SECURE_ERASE 0x80000000 +#define SECURE_ERASE 0x00000000 _______________________________________________ U-Boot mailing list