From owner-freebsd-arm@FreeBSD.ORG Wed Jan 21 16:48:29 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 B2D1C106566B; Wed, 21 Jan 2009 16:48:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2E7918FC16; Wed, 21 Jan 2009 16:48:29 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0LGjdjQ025658; Wed, 21 Jan 2009 09:45:39 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 21 Jan 2009 09:46:16 -0700 (MST) Message-Id: <20090121.094616.639845519.imp@bsdimp.com> To: mav@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <497748D9.2040607@FreeBSD.org> References: <49772EF1.1060207@FreeBSD.org> <4977309F.2020402@bulinfo.net> <497748D9.2040607@FreeBSD.org> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: Wed, 21 Jan 2009 16:48:30 -0000 In message: <497748D9.2040607@FreeBSD.org> Alexander Motin writes: : Krassimir Slavchev wrote: : > ... : > CMD: 7 ARG 0 len 0 : > RES: 0 : : Before this point mmc_rescan_cards() have successfully selected all the : cards. Then at this point : mmcbr_set_bus_mode(dev, pushpull); : : mmcbr_update_ios(dev); : were called. And after that same request inside mmc_calculate_clock() : has failed. That's strange. : : > timing 1, rate 30000000, hsrate 50000000 : > CMD: 7 ARG 10000 len 0 : > RES: 2 : : Open drain bus mode control is not implemented by sdhci driver, so I : haven't looked at it close. Quick look around shows that push-pull mode : was set there even without that last call. May be I am wrong, but first : line looks useless. mmcbr_update_ios(dev) writes to the controller bus : control registers, may be it affects something, or bus require some time : to settle after it? Without open drain bus mode, I don't think that you can properly do MMC cards. At least I couldn't with the AT91 when I was developing it. The open drain mode is what allows us to select the one mmc card we're talking to. : > CMD: 6 ARG 80fffff0 len 64 : > RES: 0 : > CMD: 7 ARG 0 len 0 : > RES: 0 : > mmc0: setting transfer rate to 30.000MHz : > mmcsd0: 1983MB at mmc0 30MHz/1bit : : Bus frequency changed here. SD specification allows frequencies up to : 25MHz without high speed timings used, but cards like this one ofter : declare a bit higher frequencies in legacy mode. May be we should just : to try to limit it to some safe value? You may just try to set : max_dtr = 5000000; : in mmc_calculate_clock(), before "if (bootverbose) {". The AT91 stuff works well in high speed mode, but the internal clocks of the AT91 may limit it to a number less than 50MHz. The 30MHz limit actually should be at91_master_clock / 2, so that's a bit of a bug in the driver (which I've fixed in my tree). I've made 30MHz work on the prior version of the code, so there's not a hardware limitation. BTW, at91_master_clock is 60,000,000 by default, so we can't go higher than 30MHz on those boards. Warner : > CMD: 7 ARG 10000 len 0 : > RES: 2 : > mmc0: setting bus width to 1 bits : > CMD: 37 ARG 10000 len 0 : > RES: 0 : > CMD: 6 ARG 0 len 0 : > RES: 0 : > CMD: 11 ARG 0 len 512 : > RES: 0 : > CMD: 11 ARG 0 len 512 : > RES: 0 : > CMD: 11 ARG 200 len 512 : > RES: 0 : > Trying to mount root from ufs:/dev/mmcsd0s1 : > : > Alexander Motin wrote: : >> Krassimir Slavchev wrote: : >>> Alexander Motin wrote: : >>>> Krassimir Slavchev wrote: : >>>>> Oops, sorry this output was without SD card inserted! : >>>>> I've changed the file. : >>>> That's some different debugging. I have meant that one, which happens : >>>> when boot_verbose="YES" added to loader.conf, or respective Fx button : >>>> pressed during boot on PC. : >>> Yes this is with kernel VERBOSE_SYSINIT option because I cannot set : >>> boot_verbose from arm boot loader. : >>> Verbose messages from which modules you want to see? I will set : >>> bootverbose manually. : >> mmc. And while being there, apply this one please. : : -- : Alexander Motin : :