From owner-freebsd-arm@FreeBSD.ORG Wed Oct 29 17:58:27 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1405E64C for ; Wed, 29 Oct 2014 17:58:27 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1065DC2 for ; Wed, 29 Oct 2014 17:58:26 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XjXVo-000DhX-RX; Wed, 29 Oct 2014 17:58:25 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s9THwLYl081218; Wed, 29 Oct 2014 11:58:21 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19iAutvs8mWMWqPdyOG5anB X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: sd card probing (was: FreeBSD 10.0 on Raspberry PI B+ no network devices From: Ian Lepore To: ticso@cicely.de In-Reply-To: <20141029172937.GB59614@cicely7.cicely.de> References: <20140825163528.d2e696cc3d03ad9bebcd239c@schwarzes.net> <20140826074951.4cf5a8fc@X220.alogt.com> <53FD1646.2010103@ceetonetechnology.com> <20140827021349.1273f703c6756d07fad72a16@schwarzes.net> <20141014032743.GK38905@cicely7.cicely.de> <20141014041305.GM38905@cicely7.cicely.de> <20141022204454.GA12231@cicely7.cicely.de> <20141023022244.GB16490@cicely7.cicely.de> <20141029172937.GB59614@cicely7.cicely.de> Content-Type: text/plain; charset="us-ascii" Date: Wed, 29 Oct 2014 11:58:21 -0600 Message-ID: <1414605501.17308.97.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Andreas Schwarz , George Rosamond , "freebsd-arm@freebsd.org" , Tim Kientzle X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Oct 2014 17:58:27 -0000 On Wed, 2014-10-29 at 18:29 +0100, Bernd Walter wrote: > On Thu, Oct 23, 2014 at 04:22:44AM +0200, Bernd Walter wrote: > > On Wed, Oct 22, 2014 at 11:43:01PM -0200, Luiz Otavio O Souza wrote: > > > On 22 October 2014 18:44, Bernd Walter wrote: > > > > On Tue, Oct 14, 2014 at 12:51:50PM -0300, Luiz Otavio O Souza wrote: > > > >> On 14 October 2014 01:13, Bernd Walter wrote: > > > >> > > > > >> > Ok - that card problem seems random or contact related. > > > >> > Whatever, it is 6 am - time to sleep ;-) > > > >> > > > >> I've found a missing silicon bug workaround on our driver. > > > >> > > > >> It's pretty recent and i'm still building new images to test with more > > > >> cards, but it did fix all the instability i was seeing on the > > > >> identification of one of my cards. > > > >> > > > >> Together with the new firmware (yes, there is another SD fix there) my > > > >> RPi B rev 2 (with this same card) has gone from unusable to rock > > > >> stable (i've done 80 cold boots without any damage/corruption to the > > > >> card). > > > >> > > > >> Please, give it a try and let me know if it helps. > > > > > > > > Tested. > > > > All I can say so far is that it is random, but your patch didn't help. > > > > > > Without my patch you should see the speed and the bus width changing > > > over the boots and with my patch it should always be the same > > > (41.6MHz/4bit): > > > > mmcsd0: 8GB at mmc0 41.6MHz/4bit/65535-block > > > > > > > Furthermore this problem now happens on each boot try. > > > > It still may be possible that it can boot, but I've tried many more > > > > times than needed before. > > > > > > > > Timecounters tick every 10.000 msec > > > > usbus0: 480Mbps High Speed USB v2.0 > > > > ugen0.1: at usbus0 > > > > uhub0: on usbus0 > > > > mmcsd0: 8GB at mmc0 41.6MHz/4bit/65535-block > > > > mmcsd0: Error indicated: 1 Timeout > > > > mmcsd0: Error indicated: 1 Timeout > > > > fb0: 656x416(0x0@0,0) 16bpp > > > > fb0: pitch 1312, base 0x5e006000, screen_size 545792 > > > > fbd0 on fb0 > > > > VT: initialize with new VT driver "fb". > > > > > > Ok. Can you try add the following to /boot/loader.conf ? > > > > > > echo hw.bcm2835.sdhci.hs=0 >> /boot/loader.conf > > > > > > RPi _is_ picky about the SD card, the patch won't make that go away > > > but should help in a few cases. > > > > I know - that's the reason why I bought the B+ boards in bundle with > > cards directly from Farnell. > > Hoped they wouldn't make any problems under FreeBSD. > > The cards unfortunately are unlabeled, just the included SD adapter > > has a raspi logo. > > > > > There is a possibility that your card won't work in HS mode and now > > > that the card identification always works, it will always go with the > > > highest supported speed. The tunable should help if that is the case. > > > > This makes sense. > > I don't remember this card/board combination, but about a year ago, when > > I used other cards in other boards the speed and width wasn't always the > > same. > > > > And you are absolutely right, with that loader.conf entry it works. > > ... > > mmcsd0: 8GB at mmc0 25.0MHz/4bit/65535-block > > ... > > This is another card from the same order (and hopefully same batch) in a Beaglebone > Black: > mmcsd0: 8GB at mmc0 48.0MHz/4bit/65535-block > Interesting that the Raspberry is so picky about them, since the card clearly is > capable to do such frequency. > > But I miss something on the Raspberry board. > The B boards clearly have series resistors in the signal lines. > The B+ has not. > However the MMC/SD should have some pull up resistors, usually > around 100k Ohms. > Following the signals is hard to impossible, but there are no such > resistors in a reasonable location on neither B nor B+. > They might be interal in the broadcom SoC, but this is very unusual. > I consider modding the SD signals on the B+ impossible, but it can > be done on the B. > > -- Pullups on sd signal lines is a recent thing. It's in the sd 4.x physical spec, in the form of requiring the standard sd data lines be pulled high or low when using the new UHS-II signals. Other than that pullups are not required on any of the lines for sd cards. At work we don't put pullups on any of them, and use a 22 ohm series on just the clock line, and that only on designs where we have to fly across a ribbon cable to get to the card socket. The thing to keep in mind about the rpi sdcard woes is that it all works in u-boot and in linux. The same cards that fail on freebsd get as far as loading freebsd... i.e., they worked fine in u-boot and didn't fail until our driver came along and touched the hardware. If you boot that same card into linux it'll work fine. -- Ian