Realtek RTS525A SD card reader
raul.becker at iki.fi
raul.becker at iki.fi
Sun Apr 1 03:45:16 UTC 2018
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 at 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.
More information about the freebsd-hackers
mailing list