Date: Wed, 12 Feb 2014 23:43:49 +0100 From: Bernd Walter <bernd@cicely.de> To: Ian Lepore <ian@FreeBSD.org> Cc: freebsd-arm <freebsd-arm@FreeBSD.org>, "ticso@cicely.de" <ticso@cicely.de> Subject: Re: wandboard / imx6 / exynos4 / cortex-a9 "wrong-endian bug" fixed Message-ID: <33F22422-5CFF-4023-A357-CDE265263477@cicely.de> In-Reply-To: <1392244640.1145.60.camel@revolution.hippie.lan> References: <1391371204.13026.43.camel@revolution.hippie.lan> <20140202230450.GA42331@cicely7.cicely.de> <20140210041313.GB89777@cicely7.cicely.de> <1392042832.1145.8.camel@revolution.hippie.lan> <20140211010733.GC94205@cicely7.cicely.de> <20140211134438.GD94205@cicely7.cicely.de> <1392177248.1145.43.camel@revolution.hippie.lan> <1392179609.1145.45.camel@revolution.hippie.lan> <20140212222222.GG5074@cicely7.cicely.de> <1392244640.1145.60.camel@revolution.hippie.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
Am 12.02.2014 um 23:37 schrieb Ian Lepore <ian@FreeBSD.org>: > On Wed, 2014-02-12 at 23:22 +0100, Bernd Walter wrote: >> On Tue, Feb 11, 2014 at 09:33:29PM -0700, Ian Lepore wrote: >>> On Tue, 2014-02-11 at 20:54 -0700, Ian Lepore wrote: >>>> On Tue, 2014-02-11 at 14:44 +0100, Bernd Walter wrote: >>>>> On Tue, Feb 11, 2014 at 02:07:33AM +0100, Bernd Walter wrote: >>>>>> I can't seen to get the second microSD-slot running. >>>>>> The controllers get attached, but mmc only to the onboard slot. >>>>>> The WiFi is SDIO, which I didn't compile into the kernel and I notice= d >>>>>> there is a GPIO used to enable the chip. >>>>>=20 >>>>> Strange enough the 4th controller gets an mmc1 device attached: >>>>> sdhci_imx3: <Freescale uSDHC controller> mem 0x219c000-0x219ffff irq 5= 7 on simplebus2 >>>>> sdhci_imx3-slot0: 200MHz HS 4bits 3.3V 3.0V PIO >>>>> sdhci_imx3-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D REGISTER D= UMP =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>> sdhci_imx3-slot0: Sys addr: 0x00000000 | Version: 0x00000002 >>>>> sdhci_imx3-slot0: Blk size: 0x00000000 | Blk cnt: 0x00000001 >>>>> sdhci_imx3-slot0: Argument: 0x00000000 | Trn mode: 0x00000000 >>>>> sdhci_imx3-slot0: Present: 0xf78d8088 | Host ctl: 0x00000000 >>>>> sdhci_imx3-slot0: Power: 0x0000000d | Blk gap: 0x00000080 >>>>> sdhci_imx3-slot0: Wake-up: 0x00000008 | Clock: 0x00000002 >>>>> sdhci_imx3-slot0: Timeout: 0x00000080 | Int stat: 0x00000000 >>>>> sdhci_imx3-slot0: Int enab: 0x017f00fb | Sig enab: 0x017f00fb >>>>> sdhci_imx3-slot0: AC12 err: 0x00000000 | Slot int: 0x00000000 >>>>> sdhci_imx3-slot0: Caps: 0x0377c800 | Max curr: 0x80000000 >>>>> sdhci_imx3-slot0: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>>> mmc1: <MMC/SD bus> on sdhci_imx3 >>>>>=20 >>>>> It hangs on probing, but it is my understanding that this controller >>>>> isn't wired at all on wandboard. >>>>> But why isn't there an attachment with the other two controllers. >>>>>=20 >>>>=20 >>>> I can't get the uSD slot on the carrier board to work either, but my >>>> symptoms are different. >>>>=20 >>>> Aha! I just noticed that Freescale moved some bits around in the >>>> Present State register and defined some that are undefined in the spec >>>> and so on. I completely overlooked that when I was writing the >>>> driver. =20 >>>>=20 >>>> I need to write some proper translation routines, which ain't happening= >>>> tonight. :) But, as proof of concept, the attached little crude hack >>>> makes it successfully probe both of my sd slots now. >>>>=20 >>>> -- Ian >>>>=20 >>>> differences between files attachment (imx_sdhci_detect_hack.diff) >>>> Index: sys/arm/freescale/imx/imx_sdhci.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> --- sys/arm/freescale/imx/imx_sdhci.c (revision 261700) >>>> +++ sys/arm/freescale/imx/imx_sdhci.c (working copy) >>>> @@ -298,6 +298,9 @@ imx_sdhci_read_4(device_t dev, struct sdhci_slot * >>>> val32 |=3D sc->r1bfix_intmask; >>>> } >>>>=20 >>>> + if (off =3D=3D SDHCI_PRESENT_STATE && device_get_unit(dev) !=3D 1)= >>>> + val32 |=3D SDHCI_CARD_PRESENT; >>>> + >>>> return val32; >>>> } >>>>=20 >>>=20 >>> Just realized... that check for unit !=3D 1 is only needed if you have t= he >>> wifi device enabled in the dts. If only the sd slots are enabled, leave= >>> that out. >>=20 >> With that both cards are probed now. >>=20 >=20 > The bad news is that I've just finished coding up the translation > between the freescale and standard definitions of the Present State > register, and the bit for card-detected didn't move. So it's not fixed > yet. >=20 > The u-boot code uses gpios for card detect, and the wandboard schematic > agrees with that. I have no idea why the sdhci controller thinks one > slot has a card inserted and the other doesn't. Maybe there are just > some internal pads that aren't bonded and it's an accident of how the > lines are floating. I will try to make tests on MarSboard soon. It has an onboard emmc and a slot. Not sure which controllers they use for which - will have to read schematic f= irst. >=20 > There's a lot (a LOT) of work to be done to get to a proper solution. > The standard dev/sdhci driver has no concept of how to use a gpio to > check for card presence, so there's work to be done there. On the imx6 > side, we have nothing right now for pinmux or gpio support. >=20 > It should also be possible to use the DAT3 line for card detect, I'll > look into how to make that work. >=20 > -- Ian >=20 >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33F22422-5CFF-4023-A357-CDE265263477>