From owner-freebsd-arm@FreeBSD.ORG Wed Jan 21 08:54:28 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 82F4A1065670 for ; Wed, 21 Jan 2009 08:54:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from cmail.optima.ua (cmail.optima.ua [195.248.191.121]) by mx1.freebsd.org (Postfix) with ESMTP id 045788FC12 for ; Wed, 21 Jan 2009 08:54:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) X-Spam-Flag: SKIP X-Spam-Yversion: Spamooborona-2.1.0 Received: from orphanage.alkar.net (account mav@alkar.net [212.86.226.11] verified) by cmail.optima.ua (CommuniGate Pro SMTP 5.2.9) with ESMTPA id 232144662; Wed, 21 Jan 2009 10:54:27 +0200 Message-ID: <4976E2C2.4090002@FreeBSD.org> Date: Wed, 21 Jan 2009 10:54:26 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.14 (X11/20080612) MIME-Version: 1.0 To: "M. Warner Losh" References: <20090120.114051.-854291995.imp@bsdimp.com> <4976215B.40302@FreeBSD.org> <20090120.122312.1543793985.imp@bsdimp.com> <20090120.123230.-272218744.imp@bsdimp.com> <49762CEF.1000405@FreeBSD.org> <49762EC9.1010006@FreeBSD.org> In-Reply-To: <49762EC9.1010006@FreeBSD.org> X-Enigmail-Version: 0.95.0 Content-Type: multipart/mixed; boundary="------------030507030601000405000609" 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 08:54:28 -0000 This is a multi-part message in MIME format. --------------030507030601000405000609 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Alexander Motin wrote: > Alexander Motin wrote: >> M. Warner Losh wrote: >>> In message: <20090120.122312.1543793985.imp@bsdimp.com> >>> "M. Warner Losh" writes: >>> : : IMHO it is incorrect to disable 4bit mode on that stage, it is >>> too late : : there. It should be done at controller capabilities >>> announcement stage. : : If you are not objecting, I would remove that >>> wire4 variable. >>> : : I am objecting. The code is there so that the rest of the driver >>> does >>> : the right thing when doing 4-bit. It needs to be a capability too. >>> : : However, before we go monkeying with this, we need to find the >>> : underlying bug. >>> >>> I've got the following patch, untested, that I think does what I think >>> needs to be done. Not sure about the return value from update_ios... I would prefer attached variant. It will also disable 4-bit support by default, but will make it properly. How do you plan to control that wire4 variable? With device.hints? -- Alexander Motin --------------030507030601000405000609 Content-Type: text/plain; name="at91_mci.c.wire4.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="at91_mci.c.wire4.patch" --- at91_mci.c.prev 2009-01-20 19:36:58.000000000 +0200 +++ at91_mci.c 2009-01-21 10:46:00.000000000 +0200 @@ -201,7 +201,10 @@ at91_mci_attach(device_t dev) sc->host.f_min = 375000; sc->host.f_max = 30000000; sc->host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->host.caps = MMC_CAP_4_BIT_DATA; + if (sc->wire4) + sc->host.caps = MMC_CAP_4_BIT_DATA; + else + sc->host.caps = 0; child = device_add_child(dev, "mmc", 0); device_set_ivars(dev, &sc->host); err = bus_generic_attach(dev); @@ -294,7 +297,7 @@ at91_mci_update_ios(device_t brdev, devi else clkdiv = (at91_master_clock / ios->clock) / 2; } - if (ios->bus_width == bus_width_4 && sc->wire4) + if (ios->bus_width == bus_width_4) WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) | MCI_SDCR_SDCBUS); else WR4(sc, MCI_SDCR, RD4(sc, MCI_SDCR) & ~MCI_SDCR_SDCBUS); --------------030507030601000405000609--