From: Ira W. Snyder Date: Fri, 16 Dec 2011 10:06:48 -0800 Subject: [U-Boot] fsl_esdhc.c bug In-Reply-To: <4EEB5B60.6070500@zhone.com> References: <4EEB4C25.2070005@zhone.com> <4EEB5B60.6070500@zhone.com> Message-ID: <20111216180648.GB13048@ovro.caltech.edu> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, Dec 16, 2011 at 09:53:20AM -0500, Jim Lentz wrote: > On 12/16/2011 09:51 AM, Fabio Estevam wrote: > > Hi Jim, > > > > On Fri, Dec 16, 2011 at 11:48 AM, Jim Lentz wrote: > >> All, > >> > >> There is a bug rendering SDCard support useless on Freescale esdhc > >> controller. > > Which Freescale processor do you use? > > > > Please describe in details the problem you see, how to reproduce it, > > the U-boot version > > that you use, etc. > > > > Regards, > > > > Fabio Estevam > Freescale P2020. Latest U-boot version. > > Easiest way to see it is typing mmcinfo at the U-boot cli. It will hang. > > By default, PIO mode is selected when CONFIG_P2020 is defined. Legacy > P2020 silicon revisions require PIO mode. > > The esdhc_pio_read_write function has a bad reg pointer. > Hi Jim, I tested this on my P2020, and PIO mode fails as you describe. Your fix works. I've attached a patch which is suitable for inclusion into U-Boot. Feel free to submit your own patch to supercede this one. It is a bug you found, you should get credit for it! :) It looks like the patch which introduced this code (77c1458d1 "ppc/85xx: PIO Support for FSL eSDHC Controller Driver") was carried out of tree for a while. While it was out of tree, another commit happened (c67bee146 "fsl_esdhc: add support for mx51 processor") which changed how the mmc->priv variable is used.