Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jun 2018 10:40:19 +0300
From:      Raul Becker <raul.becker@iki.fi>
To:        Eric van Gyzen <eric@vangyzen.net>
Cc:        Warner Losh <imp@bsdimp.com>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: Realtek RTS525A SD card reader
Message-ID:  <20180603074017.jtrn3ykz6ngumdje@tardis>
In-Reply-To: <22ca4f05-3e3a-114d-ef95-d974541ee6d8@vangyzen.net>
References:  <fdc07dc1-6ada-929b-e3fc-a360e416b1e3@vangyzen.net> <20180401034514.t4idseuyg53gap7g@tardis> <CANCZdfoO2h31RToz73_xaeQR1rbyCTzYCrgiw357mdDnKtzFTA@mail.gmail.com> <22ca4f05-3e3a-114d-ef95-d974541ee6d8@vangyzen.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

yes, thanks for the quick list on what needs to be done!
This helped me a ton as well as the arch-handbook.
I got the probe to match my device (for now) and attach
that initializes the the device as you suggested with
freebsd bus resources. It even detects on kldload presence
of a sdcard in the slot and reports it in dmesg log. :)
But this is still far from anything usable.

Just wanted ask if there is any risk that I end up destroying my
sd-card device? Like there are some functions in the rtsx driver
where the voltages are being changed and also clock hz too.
I dont haven't included those functions that do voltage and
clock changes yet.

--
Raul Becker

On Mon, Apr 02, 2018 at 09:39:19AM -0500, Eric van Gyzen wrote:
> On 04/01/2018 02:06, Warner Losh wrote:
> > The interface you want to look for is the mmcbr_if.m inteface. In sdhci,
> > these routines implement the mmc interface:
> > sdhci_pci.c: DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios),
> > sdhci_pci.c: DEVMETHOD(mmcbr_switch_vccq, sdhci_generic_switch_vccq),
> > sdhci_pci.c: DEVMETHOD(mmcbr_tune, sdhci_generic_tune),
> > sdhci_pci.c: DEVMETHOD(mmcbr_retune, sdhci_generic_retune),
> > sdhci_pci.c: DEVMETHOD(mmcbr_request, sdhci_generic_request),
> > sdhci_pci.c: DEVMETHOD(mmcbr_get_ro, sdhci_generic_get_ro),
> > sdhci_pci.c: DEVMETHOD(mmcbr_acquire_host,   sdhci_generic_acquire_host),
> > sdhci_pci.c: DEVMETHOD(mmcbr_release_host,   sdhci_generic_release_host),
> > 
> > rtsz will almost certainly need it's own versions of these routines (which
> > is why I suggest having your own driver will be simpler: otherwise each of
> > these routines would be if (rtsz) do_rtsz_stuff(); else do_sdhci_stuff();
> > which won't end well and would be uncomittable to FreeBSD. You can see how
> > other chips implement these methods by grepping for them in the tree. You
> > may not need a tune/retune if rtsz doesn't support the latest, fastest
> > cards, for example. Switch vccq may not be needed either. update_ios will
> > be needed, and request is needed. Acquire and release host may be able to
> > be done as a dummy routine if there's only one slot.
> > 
> > I know this is a super-quick gloss of what needs to be done.
> 
> This mmc part was helpful, since I know nothing about this interface.
> Thanks!
> 
> Eric



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