From owner-freebsd-arm@FreeBSD.ORG Fri Jan 23 16:06:25 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B44C1065691 for ; Fri, 23 Jan 2009 16:06:25 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from mx.bulinfo.net (mx.bulinfo.net [193.194.156.1]) by mx1.freebsd.org (Postfix) with ESMTP id B28BE8FC25 for ; Fri, 23 Jan 2009 16:06:24 +0000 (UTC) (envelope-from krassi@bulinfo.net) Received: from localhost (localhost [127.0.0.1]) by mx.bulinfo.net (Postfix) with ESMTP id BBE05CC35; Fri, 23 Jan 2009 18:06:22 +0200 (EET) Received: from mx.bulinfo.net ([127.0.0.1]) by localhost (mx.bulinfo.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 14965-02; Fri, 23 Jan 2009 18:06:22 +0200 (EET) Received: from [192.168.2.188] (pythia.bulinfo.net [212.72.195.5]) by mx.bulinfo.net (Postfix) with ESMTP id F01AFCC1C; Fri, 23 Jan 2009 18:06:21 +0200 (EET) Message-ID: <4979EAFE.2030407@bulinfo.net> Date: Fri, 23 Jan 2009 18:06:22 +0200 From: Krassimir Slavchev User-Agent: Thunderbird 2.0.0.14 (X11/20080616) MIME-Version: 1.0 To: "M. Warner Losh" References: <49788702.9010808@FreeBSD.org> <20090122151340.GE50103@cicely7.cicely.de> <497896F3.9030908@bulinfo.net> <20090122.093007.1785588956.imp@bsdimp.com> In-Reply-To: <20090122.093007.1785588956.imp@bsdimp.com> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at mx.bulinfo.net Cc: freebsd-arm@freebsd.org Subject: Re: Mount root from SD card? X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jan 2009 16:06:26 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 M. Warner Losh wrote: > In message: <497896F3.9030908@bulinfo.net> > Krassimir Slavchev 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. > > : @@ -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! Best regards > > There's lots of races in programming this chip :( > > : } else { > : WR4(sc, MCI_CMDR, cmdr); > : WR4(sc, PDC_PTCR, PDC_PTCR_TXTEN); > > > Warner > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFJeer9xJBWvpalMpkRAoe5AJ44dnZY2pKZY/ZphexulLPFFXzN7wCfS+T/ pV+SezanCxT/pYtWE6dsKVM= =GPct -----END PGP SIGNATURE-----