SDIO driver for OpenRD Ultimate/ Dreamplug

Matthieu Kraus matthieu.kraus at s2008.tu-chemnitz.de
Sat Jan 7 11:07:14 UTC 2012


Quoting Mattia Rossi <mrossi at 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 at 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



More information about the freebsd-arm mailing list