On Thu, Apr 17, 2014 at 11:58:03PM +0200, Mark Kettenis wrote: > > Date: Thu, 17 Apr 2014 23:42:26 +0200 > > From: Claudio Jeker <[email protected]> > > > > Found this in my X240, the following diff makes it work. > > > > rtsx0 at pci1 dev 0 function 0 "Realtek RTS5227 Card Reader" rev 0x01: msi > > sdmmc0 at rtsx0 > > scsibus4 at sdmmc0: 2 targets, initiator 0 > > sd1 at scsibus4 targ 1 lun 0: <SD/MMC, Drive #01, > SCSI2 0/direct fixed > > sd1: 15296MB, 512 bytes/sector, 31326208 sectors > > > > A bit surprised since it seems Linux has two different drivers for RTS52x9 > > and RTS5227. > > You might want to sort the IDs such that they are in numerical order. > > Anyway, if this works, ok kettenis@, there is no downside.
The linux driver (mfd/rts5227.c, compared to mfd/rts5229.c) seems to enable some optional PCI express features (LTR, OBFF), and also tweaks some settings for cases that might not apply because we currently run SD cards in the lowest clock mode. So, yes, if this makes read/write for SD cards work for you, please commit. Could you also adjust the man page? We can still try some of the tweaks the Linux driver applies later. E.g. the rts5227_force_power_down() code might be interesting, or the check for a "reverse socket" in rts5229_fetch_vendor_settings(). > > Index: dev/pci/rtsx_pci.c > > =================================================================== > > RCS file: /cvs/src/sys/dev/pci/rtsx_pci.c,v > > retrieving revision 1.4 > > diff -u -p -r1.4 rtsx_pci.c > > --- dev/pci/rtsx_pci.c 6 Nov 2013 13:51:02 -0000 1.4 > > +++ dev/pci/rtsx_pci.c 4 Apr 2014 20:13:41 -0000 > > @@ -58,7 +58,8 @@ rtsx_pci_match(struct device *parent, vo > > return 0; > > > > if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RTS5209 || > > - PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RTS5229) > > + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RTS5229 || > > + PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_REALTEK_RTS5227) > > return 1; > > > > return 0; > > > >
