Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Apr 2018 06:45:15 +0300
From:      raul.becker@iki.fi
To:        freebsd-hackers@freebsd.org
Subject:   Re: Realtek RTS525A SD card reader
Message-ID:  <20180401034514.t4idseuyg53gap7g@tardis>
In-Reply-To: <fdc07dc1-6ada-929b-e3fc-a360e416b1e3@vangyzen.net>

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

I somehow got the same idea just recently that it would be a fun learning experi
ence to try to port rtsx from OpenBSD to FreeBSD and getting at the same time mo
re familiar with C. I practically have zero experience in writing drivers.

But I think that the relevant OpenBSD driver files are rtsx.c rtsxvar.h and rtsx
reg.h. Browsing through the FreeBSD src/sys/dev directories for any of the curre
ct drivers to see how the drivers are meant to be implemented in FreeBSD I found
 src/sys/dev/sdhci as a possible candidate. There are already driver modules for
 the sdhci.c which are atleast sdhci_pci.c, sdhci_fdt.c and sdhci_acpi.c. They a
ll follow same organization where in the end they map the DEVMETHODs what the sd
hci expects to get I believe. The sdhci_pci.c was abit overwhelming with all the
 quirks so I thought that maybe rtsx driver could be instead a separate driver m
odule like sdhci_rtsx.c for example. This separation I think would be helpful es
pecially when not too familiar with C and because it looks of like the task does
 not seem to be that straight forward to do either. The other mmc drivers are mo
stly spread out and many are for arm boards.

It would be sweet if someone could confirm that src/sys/dev/sdhci is a good loca
tion where to try to implement a driver module and/or point at the right(er) dir
ection.


My device:

none2@pci0:2:0:0:       class=0xff0000 card=0x221417aa chip=0x522710ec rev=0x01
hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTS5227 PCI Express Card Reader'

--
Raul Becker

p.s. I hope this time I got the In-Reply-To header right.




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