Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jan 2009 09:15:23 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        krassi@bulinfo.net
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Mount root from SD card?
Message-ID:  <20090123.091523.-192571782.imp@bsdimp.com>
In-Reply-To: <4979EAFE.2030407@bulinfo.net>
References:  <497896F3.9030908@bulinfo.net> <20090122.093007.1785588956.imp@bsdimp.com> <4979EAFE.2030407@bulinfo.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <4979EAFE.2030407@bulinfo.net>
            Krassimir Slavchev <krassi@bulinfo.net> writes:
: -----BEGIN PGP SIGNED MESSAGE-----
: Hash: SHA1
: 
: M. Warner Losh wrote:
: > In message: <497896F3.9030908@bulinfo.net>
: >             Krassimir Slavchev <krassi@bulinfo.net> writes:
: > : Index: at91_mci.c
: > : ===================================================================
: > : --- at91_mci.c	(revision 187590)
: > : +++ at91_mci.c	(working copy)
: > : @@ -199,7 +199,7 @@
: > :  		goto out;
: > :  	}
: > :  	sc->host.f_min = 375000;
: > : -	sc->host.f_max = at91_master_clock / 2;	/* Typically 30MHz */
: > : +	sc->host.f_max = AT91C_MASTER_CLOCK / 2;	/* Typically 30MHz */
: > :  	sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340;
: > :  	if (sc->wire4)
: > :  		sc->host.caps = MMC_CAP_4_BIT_DATA;
: > 
: > This change is wrong.
: 
: Ok. I did this because at91_master_clock was not defined here.

Yea, that's my bad, actually.  I've since fixed it.

: > : @@ -399,8 +399,8 @@
: > :  	WR4(sc, MCI_ARGR, cmd->arg);
: > :  	if (cmdr & MCI_CMDR_TRCMD_START) {
: > :  		if (cmdr & MCI_CMDR_TRDIR) {
: > : +			WR4(sc, MCI_CMDR, cmdr);
: > :  			WR4(sc, PDC_PTCR, PDC_PTCR_RXTEN);
: > : -			WR4(sc, MCI_CMDR, cmdr);
: > 
: > This change is also wrong.  It won't work.  Also, why test the
: > direction at all if we're just going to do the same thing in both legs
: > of the branch?  When I was developing the code, I originally had the
: > 'send a command and then enable PDC' logic.  It didn't work for the
: > read case, so now we enable the reader and then send the command.  We
: > do this based on the logic that it is OK to have the PDC enabled when
: > there's no data transfer going, but if we send the command, then take
: > an interrupt before we can enable the PDC, we'd lose data.  And that
: > seemed to happen a lot.
: 
: Ok but I was able to read correctly first blocks ...
: Looking at linux's driver they do the same, first sending CMD and then
: enable PDC for reading.
: 
: Thanks for latest fixes!

Sure.  The underlying problem was that we were doing 512 byte
transfers for 64 byte requests.   Ooops, that's bad.

Warner



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