From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lei Wen Date: Mon, 5 Sep 2011 10:50:22 +0800 Subject: [U-Boot] [PATCH] mmc: retry the cmd8 to meet 74 clocks requirement in the spec In-Reply-To: References: <1315020857-25322-1-git-send-email-leiwen@marvell.com> <201109050018.27667.marek.vasut@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andy, On Mon, Sep 5, 2011 at 6:45 AM, Andy Fleming wrote: > On Sun, Sep 4, 2011 at 5:18 PM, Marek Vasut wrote: >> On Saturday, September 03, 2011 05:34:17 AM Lei Wen wrote: >>> For some controller it has dynamic clock gating, and only toggle out clk >>> when the first cmd0 send out, while some card strictly obey the 74 >>> clocks rule, the interval may not be sufficient between the cmd0 and >>> this cmd8, retry to fulfil the clock requirement. > > > This seems like the wrong way to handle this. What if another > controller shows up, but it takes *4* retries. Or *5*? > > Or *100*? This sort of knowledge should somehow be embedded in either > the driver for that controller, or the board > code. Not the generic MMC code. > > Maybe put it in the init code for the controller? > The card after the cmd0 need sometimes to be stabilize. Linux also add some kind of mmc_delay function inside the mmc_go_idle() fucntion in the generic framework. The retry time cannot be 100 that much. :) Since the 74 clocks is such short time, that even the second try would serve good. Make it a part of generic could remove the ugly handling in the controller driver itself, and others also could benefit from it... Best regards, Lei