Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Jan 2012 12:07:12 +0100
From:      Matthieu Kraus <matthieu.kraus@s2008.tu-chemnitz.de>
To:        freebsd-arm@freebsd.org
Subject:   Re: SDIO driver for OpenRD Ultimate/ Dreamplug
Message-ID:  <20120107120712.20461tdas89ih1eo@mail.tu-chemnitz.de>
In-Reply-To: <4F07D8BE.3060001@swin.edu.au>
References:  <4F05503D.4030303@swin.edu.au> <1325884830.25037.91.camel@revolution.hippie.lan> <4F07D8BE.3060001@swin.edu.au>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Mattia Rossi <mrossi@swin.edu.au>:

> On 07/01/12 08:20, Ian Lepore wrote:
>> On Thu, 2012-01-05 at 18:24 +1100, Mattia Rossi wrote:
>>> Hi all,
>>>
>>> I've tried to compile and use the SDIO driver found here:
>>> http://people.freebsd.org/~raj/misc/mv_sdio.c
>>>
>>
>> Hmmm, on second thought, I'll bet interrupt 34 needs to be listed in the
>> sdio section of the FDT, not the gpio like I said earlier.  The code
>> sets the resource id to 1 to allocate that interrupt, so it probably
>> needs to be listed as the 2nd interrupt for the sdio dev.
>>
>> -- Ian
>>
>
> Well, right, I've had a look at that as well and couldn't find where  
> the problem was, as:
>
>
> sdio@90000 {
> 	compatible = "mrvl,sdio";
>         reg = <0x90000 0x134>;
>         interrupts = <28>;
>         interrupt-parent = <&PIC>;
>
>         gpios = <&GPIO 29 1 0x00030000   /* GPIO[29]: IN_POL_LOW,  
> IRQ (edge) */
>                  &GPIO 34 2 0x00000000>; /* GPIO[34]: OUT */
>
>         };
>
> So the second SDIO pin is set to GPIO 34, thus the logical wiring  
> should be correct.
> The error message also complains about the GPIO PIN 34and not the  
> Interrupt 34.
>
> I've found the Marvell Kirkwood 88F6281 SOC documentation online,  
> and compared the MPP map there to the FDT MPP map, and it fits the  
> register settings, so no error there.  Given it's the same SOC as  
> for the OpenRD Ultimate, it makes sense, as people using it would  
> have complained otherwise. The same would apply to the GPIO  
> description I believe.
>
> But I don't really know, so maybe somebody with some more FDT  
> knowledge could help us out here?
>
> Mat

note that the FDT gpio part for sdio is ignored in the driver and  
wasn't present in http://people.freebsd.org/~raj/misc/mv_sdio.c

instead the gpio pin settings are hardcoded via #defines in the  
modified mv_sdio.c which may lead to issues.

on another note, the gpio usage isn't strictly necessary. those pins  
are used to get gpio interrupts for card detection, however they  
aren't connected on all kirkwood boards afaik, so using them despite  
them not being connected in hardware or them not being properly set in  
the MPP config may lead to issues as this breaks the card detection  
and hence may lead to kernel panics and/or undetected cards.

as a simple workaround just commenting out the pin #defines or using  
the original mv_sdio.c should work just fine in which case it'll fall  
back to polling accordingly.

Matthieu




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120107120712.20461tdas89ih1eo>