From owner-freebsd-arm@FreeBSD.ORG Sun Feb 10 17:02:55 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C1F5461 for ; Sun, 10 Feb 2013 17:02:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x232.google.com (mail-we0-x232.google.com [IPv6:2a00:1450:400c:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id DA93784A for ; Sun, 10 Feb 2013 17:02:54 +0000 (UTC) Received: by mail-we0-f178.google.com with SMTP id x48so4268276wey.37 for ; Sun, 10 Feb 2013 09:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=h0APzbQmduMtuHXxZoEE9qkMms84rnqJXIXPnHBok9M=; b=Qlh44c/r4Et/3GEk0r2L9J3BvUhITIBsKAl59XBi8wJcuE1n8Tcj7FVYpGnS9YUQ1x zz2Ev/gaVSmWuOeWZIbSpfpInOj65U2nCA26El5l2A8luyjceIEXc2NiW/3f6NvIWjqk 1RK+wx+TBPvfrFcaKWg52JB9bPRFYVbMXSjRKh4Pc4J8u3LL5i3pHPffoadAzaVE+EVl xf6WjPE0yPFkb9diVvM9z/+3YesnERKLAt1ZYTP78ZLfLML4/1gemNlT2WY3+Izurl7G M/uV3gAb6YH5T/kgtCcEVHxYeZES9EaIvzth2g17hvITrkLTQKC9BmJ5IQLxG8SO6gdr NB2g== MIME-Version: 1.0 X-Received: by 10.180.99.227 with SMTP id et3mr11793407wib.6.1360515773916; Sun, 10 Feb 2013 09:02:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.236.88 with HTTP; Sun, 10 Feb 2013 09:02:53 -0800 (PST) In-Reply-To: <5116F226.7010204@bluezbox.com> References: <09931DEF-C90A-4E72-B5EE-02BB0C6A8588@kobudo.homeunix.net> <5109A3F2.7010508@bluezbox.com> <5116F226.7010204@bluezbox.com> Date: Sun, 10 Feb 2013 09:02:53 -0800 X-Google-Sender-Auth: 7nBeT0m8jORq82wqWUTq48pDOyQ Message-ID: Subject: Re: Raspberry Pi No Login From: Adrian Chadd To: Oleksandr Tymoshenko Content-Type: text/plain; charset=ISO-8859-1 Cc: Tim Kientzle , freebsd-arm@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2013 17:02:55 -0000 Hey, nice catch! Adrian (hardware is fun!) On 9 February 2013 17:04, Oleksandr Tymoshenko wrote: > On 1/30/2013 2:51 PM, Oleksandr Tymoshenko wrote: >> >> On 1/30/2013 2:25 PM, hiren panchasara wrote: >>> >>> On Wed, Jan 30, 2013 at 9:15 AM, Tim Kientzle wrote: >>>> >>>> On Jan 30, 2013, at 7:42 AM, Neal Nelson wrote: >>>> >>>>> HI. >>>>> >>>>> I'm able to build a bootable FreeBSD image using the beaglebone >>>>> scripts, which I understand is the accepted way at the moment. >>>>> >>>>> The problem I have is that everything seems to be going nicely, but I >>>>> never get a login prompt. The last thing I see, after the ssh key generation >>>>> stuff, is a line showing the date, then nothing. This is true using Current >>>>> as of today (2012-01-30). >>>>> >>>>> I've had this problem for some time now as every image I build using >>>>> this process has the same problem. If anyone has an idea as to what I'm >>>>> doing wrong, I'd be very grateful. >>>> >>>> Look at the kernel boot messages for the SD card >>>> check. >>>> >>>> Is it probing at 25MHz or 50MHz? >>>> >>>> I haven't tried RPi in a little while, but last time I did >>>> there was an erratic bug which caused the SD card >>>> to sometimes get probed at 50MHz and be non-functional. >>>> >>>> I believe some people worked around this by trying >>>> different cards or maybe it's been fixed in the >>>> SD driver by now? >>> >>> Not sure if its fixed in the driver now but I got around the frequency >>> problem by the patch available at: >>> http://www.peach.ne.jp/archives/rpi/patch/ >>> >>> Basically its setting freq to 25MHz instead of default 50MHz in >>> bcm2835_sdhci.c >> >> >> The patch works around the issue although it does address several issues >> with FreeBSD's >> generic mmc driver. Namely: driver does not check for return value for >> functions that read >> card's CSD, SCR or the result of switch command. CSD and SCR register >> contain card-specific >> information drivers uses to tune its operations. So when register read >> command silently >> fails driver uses partially valid data and hence its behavior might or >> might not manifest >> problems. >> >> Now the interesting part is why these commands fail. SDHCI controller >> returns Data CRC >> errors when executing them. It happens fairly early in initialization >> sequence so at that point >> card operates at 400KHz and should not have problem like this. > > > Today I went all scientific on this issue and plugged logic analyzer > to SD card using SparkFun's SD Sniffer[1]. What I found was that on > power up SDHCI controller starts operating at frequency of 190KHz but > shortly after it, before any data is read via DATA line, it switches to > 8MHz. So I capped minimum frequency for SDHCI driver at 8MHz and got > RPi into endless reboot cycle. Lo and behold: it's been almost two > hours and so far no Data CRC Error interrupts. > > Patch: http://people.freebsd.org/~gonzo/arm/patches/rpi-sdhci.diff > > Description: > - Do not silently ignore failure of "Read CSD" and "Read SCR" > commands since data returned by them is essential for further > initialization > - Properly calculate minimum frequency for SDHCI 3.00 and higher > - Add new method to SDHCI interface for setting driver-specific > minimum frequency. Provide default implementation. > - Cap minimum frequency at 8MHz for Raspberry Pi's SDHC > > I'd appreciate reviews and testing. There is one debug printf that > will be removed from final version. > > [1] https://www.sparkfun.com/products/11468 > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"