Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Jan 2009 09:05:40 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        mav@FreeBSD.org
Cc:        freebsd-arm@FreeBSD.org, ticso@cicely.de
Subject:   Re: Mount root from SD card?
Message-ID:  <20090122.090540.-839781195.imp@bsdimp.com>
In-Reply-To: <49787314.3070004@FreeBSD.org>
References:  <20090121.122842.-1582190967.imp@bsdimp.com> <20090122105650.GB50103@cicely7.cicely.de> <49787314.3070004@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <49787314.3070004@FreeBSD.org>
            Alexander Motin <mav@freebsd.org> writes:
: Bernd Walter wrote:
: > On Wed, Jan 21, 2009 at 12:28:42PM -0700, M. Warner Losh wrote:
: >> In message: <49776734.8030805@FreeBSD.org>
: >>             Alexander Motin <mav@FreeBSD.org> writes:
: >> : 
: >> : This part looks quire strange for plain FIFO explanation. Several 
: >> : consequential commands give different results:
: >> : 
: >> : CMD: 37 ARG 10000 len 0
: >> : RES: 0
: >> : CMD: d ARG 0 len 64
: >> : 
: >> : ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 28
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
: >> : RES: 2
: >> : CMD: 37 ARG 10000 len 0
: >> : RES: 0
: >> : CMD: d ARG 0 len 64
: >> : 
: >> : ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
: >> : 00 00 00 28 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
: >> : RES: 2
: >> : CMD: 37 ARG 10000 len 0
: >> : RES: 0
: >> : CMD: d ARG 0 len 64
: >> : 
: >> : ff ff ff ff 00 00 00 00 00 00 00 28 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
: >> : RES: 2
: >> : CMD: 37 ARG 10000 len 0
: >> : RES: 0
: >> : CMD: d ARG 0 len 64
: >> : 
: >> : ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00 28
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
: >> : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
: >> : RES: 2
: >> : 
: >> : While working on sdhci driver for on ENE chip I have found that for 
: >> : short transfers (less then 1K) DMA engine returns set of zeroes instead 
: >> : of data. I haven't found better solution and just handling short 
: >> : transfers by PIO. Same problem exists for PIO also, but there it was 
: >> : masked by adding short delay before reading from port.
: >>
: >> I'll have to take a look at the code in more detail to make sure that
: >> we're doing the right thing.  I noticed all the ff's, but didn't
: >> notice until now what they were shifted the same way that the data
: >> blocks were later.  In this case, you'll see there's three of them.
: >>
: >> I believe that this is the first use of a CMD that generates data that
: >> isn't a full block of data...
: > 
: > Havn't read everything, so maybe I writing nonsense in respect to
: > this problem.
: > The multiblock read trouble is a problem in the MMC design.
: > The first read always works fine, but you need to stop the transfer
: > and an exact time, otherwise it starts reading the next block.
: > The first bytes of the next block then stucks in the DMA fifo and
: > the next read then starts with the stuck uint32.
: > If you see broken reads like this then I would assume the previous
: > command was problematic.
: > The official workaround to get multiblock reading is to reset the MMC
: > and clean the fifo after each multiblock command, but I would assume
: > it is enough to just read the data register a few time before setting
: > up the DMA for the new request.
: 
: Haven't look deep at that arm controller operation, but standard SD host 
: has special counter register which terminates DMA transfer after 
: specified amount of blocks. sdhci driver even uses it's Auth-CMD12 
: feature, where controller even sends STOP command to the card by itself.

The standard host adapter spec has this.  The Atmel part doesn't.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090122.090540.-839781195.imp>