linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Experimental driver for Ricoh Bay1Controller SD Card readers
@ 2007-01-06 23:32 Sascha Sommer
  2007-01-07  9:56 ` Jiri Slaby
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Sascha Sommer @ 2007-01-06 23:32 UTC (permalink / raw)
  To: LKML; +Cc: rmk+mmc

[-- Attachment #1: Type: text/plain, Size: 1654 bytes --]

Hi,

Attached is a very experimental driver for a Ricoh SD Card reader that can be 
found in some notebooks like the Samsung P35.

Whenever a sd card is inserted into one of these notebooks, a virtual pcmcia 
card will show up:

Socket 0:
  product info: "RICOH", "Bay1Controller", "", ""
  manfid: 0x0000, 0x0000

In order to write this driver I hacked qemu to have access to the cardbus 
bridge containing this card. I then logged the register accesses of the 
windows xp driver and tryed to analyse them.

As the meanings of most of the register are still unknown to me, I consider 
this driver very experimental. It is possible that this driver might destroy 
your data or your hardware. Use at your own risk! 

Other problems:
- I only implemented reading support
- I only tested with a 128 MB SD card, no idea what would be needed to support
  other card types
- irqs are not supported
- dma is not supported
- it is very slow
- the registers can be found on the cardbus bridge and not on the virtual 
  pcmcia card. The cardbus bridge is already claimed by yenta_socket. 
  Therefore the driver currently uses pci_find_device to find the cardbus
  bridge containing the sd card reader registers.
- it will probably crash when you remove the sd card without unmounting first
- the ios stuff is not really understood
- there are a bunch of extra MMC_APP_CMDs inside the driver
- only tested with kernel 2.6.18

apart from all these problems reading an image from my sd card seems to have 
worked ;) 

If you are still brave enough to try it out make at least a backup of the data 
on your sd card.

Feedback is highly appreciated.

Regards

Sascha


[-- Attachment #2: Makefile --]
[-- Type: text/x-makefile, Size: 406 bytes --]

KERNEL_VERSION = $(shell uname -r)
KERNEL_DIR = /lib/modules/$(KERNEL_VERSION)/build
MDIR = /lib/modules/$(KERNEL_VERSION)/kernel/drivers/mmc

obj-m += sdricoh_cs.o

default:
	$(MAKE) -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules

install:
	if test ! -d $(MDIR) ; then mkdir -p $(MDIR) ; fi
	install -D -m 644 *.ko $(MDIR)
	depmod -a

clean:
	rm -f *.o *.ko *.mod.c .*o.cmd .*o.d .*o.flags
	rm -rf .tmp_versions

[-- Attachment #3: sdricoh_cs.c.gz --]
[-- Type: application/x-gzip, Size: 4197 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: Experimental driver for Ricoh Bay1Controller SD Card readers
@ 2007-02-15 22:34 Ivan Babkin
  2007-03-09 13:23 ` James
  0 siblings, 1 reply; 10+ messages in thread
From: Ivan Babkin @ 2007-02-15 22:34 UTC (permalink / raw)
  To: linux-kernel

Hi!
> Apart from that I did the following changes:
> - implemented suspend/resume support (not tested very much)
> - named the registers
> - fixed a bug that caused a major slowdown when modprobed without debug=1
> - added writting support (disabled by default, modprobe with write=1)
> Before you enable writting please make sure that you did a proper backup of 
> the data on the card. Do not use this driver to save important data.
Thank for the job you've done!
Your driver works with 1 Gb sd-card (x86_64 suse's 2.16.18.2 kernel).
Read rate for me was around 250 Kb/s, write - 28 Kb/s (using dd utility).
BTW, I get continuous flow of "sdricoh_cs: timeout waiting for data"
messages in dmesg.

Good luck!

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-03-09 13:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06 23:32 Experimental driver for Ricoh Bay1Controller SD Card readers Sascha Sommer
2007-01-07  9:56 ` Jiri Slaby
2007-02-11 20:22   ` Sascha Sommer
2007-02-13  5:47     ` Pierre Ossman
2007-02-13  9:48       ` Samuel Thibault
2007-02-13 11:42       ` Sascha Sommer
2007-01-09 20:57 ` Samuel Thibault
2007-01-10 20:10 ` Pierre Ossman
2007-02-15 22:34 Ivan Babkin
2007-03-09 13:23 ` James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).