SD-Card driver modification for Zynq questions

Lee D embaudarm at gmail.com
Fri Sep 30 02:39:45 UTC 2016


On Wed, Sep 28, 2016 at 5:53 PM, Oleksandr Tymoshenko <gonzo at bluezbox.com>
wrote:

>
> > On Sep 28, 2016, at 2:49 PM, Thomas Skibo <thomasskibo at yahoo.com> wrote:
> >
> >
> >> On Sep 28, 2016, at 2:00 PM, Oleksandr Tymoshenko <gonzo at bluezbox.com>
> wrote:
> >>
> >>
> >>> On Sep 28, 2016, at 7:16 AM, Thomas Skibo via freebsd-arm <
> freebsd-arm at freebsd.org> wrote:
> >>>
> >>>
> >>> Why not just set max-frequency to 200Mhz in the DTS file entry?
> >>
> >> From quick glance it’s not going to help. Slot’s max_clk is set to that
> value but then it’s
> >> overwritten in sdhci_init_slot by value obtained from register.  We
> need to fix it and also
> >> add tunable for non-fdt systems.
> >
> > I checked the Zynq manual and it looks like it doesn’t provide a
> frequency in the capabilities register so sdhci_init_slot() won’t change
> the slot’s max_clk.
>
> You’re right, I misread code, max-frequency can do the trick.  Still
> tunable may be a good idea.


Setting max-frequency to an incorrect value will technically work, but it
will make many cards run much more slowly than they need to.  See my other
post.

It would be nice to have a DTS file parameter to set the max data rate of
the card.  Do you have any pointers on where I might find information on
how to do this?

I have read "FreeBSD Device Drivers: A guide for the intrepid", but it only
scratches the surface.  I've written a few drivers for my custom devices
but I think I am pretty far from being able to do any serious kernel work.
One thing I am confused about is how drivers talk to each other.  I spent a
few days trying to understand the source for the mmc and sdhci drivers but
there is a lot going on that I couldn't figure out.

Thanks,

Lee


More information about the freebsd-arm mailing list