Skip to content

Use MMC cards with Ricoh R5C832 controllers!

Update: You do not need to use the setpci instructions in this article if your kernel is 2.6.25 or newer

The Ricoh R5C832 is a multi-function chip that provides Firewire and four types of memory card support (SD/MMC/Memory Stick/xD). It appears in many laptops including the Dell XPS m1330 that I recently bought for myself. It works great for SD cards, but due to the hardware design, with a separate dedicated MMC controller, it has been impossible, up until now, to use MMC cards on linux. This is because we don’t have specs for the MMC controller, and instead have written a driver for the SD controller (the SDHCI driver) that can additionally handle MMC cards. But for this to work, the SD controller has to be able to see the MMC cards. Unfortunately, the R5C832 detects MMC cards in hardware and directs them to the MMC controller – so the SD controller never sees them!

I strongly suspected that there was a way to disable the MMC controller, because some laptops, for various reasons, come with only the SD controller enabled (I believe the recent Thinkpads are configured this way) and these ones can handle MMC cards through the SD controller just fine. But there is a lack of useful documentation for the chip, so we had no way to know how to do this disabling. Fortunately, Dell were able to come to the rescue on this one – thanks to the efforts of Matt Domsch and Rezwanul Kabir, we know how to do it! You have to write to specific PCI config space register on the Firewire function of the controller. On my laptop, this is device ’03:01.0′ but it might not be on yours – so check your lspci output.

So, I type:

  • /sbin/setpci -s ’03:01.0′ 0xCA=0×57 (Write Enable)
  • /sbin/setpci -s ’03:01.0′ 0xCB=0×02 (MMC Disable)
  • /sbin/setpci -s ’03:01.0′ 0xCA=0×00 (Write Disable)

For now, you’ll want to put these in a startup script, but I’m looking at ways to get this into the kernel in an automatic way. Pierre doesn’t want to use a quirk, so we need to be creative. He suggested a dummy driver for the MMC controller that just disables it. Heh.

{ 69 } Comments

  1. Alex Ibrado | 11th September 2007 at 16:42 | Permalink

    Whoa! This actually worked for me on my Lenovo 3000 N100. Thanks! No more using a silly card reader. :-)

    (Note for those seeing extended characters, it’s setpci -s ‘aa:bb.c’ 0xCA=0×57 etc.)

  2. Daniel Drake | 12th September 2007 at 05:54 | Permalink

    Will this work on a R5C592? It’s a Dell Inspiron 640m laptop, same problem as you.

    I don’t have any MMC cards right now, but was bitten by this a while ago. SD does work fine.

  3. Philip Langdale | 12th September 2007 at 07:22 | Permalink

    Yes, it will work with a 640m. The 592 is the memory stick function.

    From the lspci dump I see for the 640m:

    02:01.0 FireWire (IEEE 1394): Ricoh Co Ltd Unknown device 0832
    02:01.1 Class 0805: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    02:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
    02:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
    02:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

    This set of devices is the R5C832. Note the firewire controller is the 0832. The annoying MMC controller is the ‘unknown’ 0843. If you see this output in lspci, you’ve got the controller and can fix it with this method.

  4. Robert González | 12th September 2007 at 09:57 | Permalink

    Thanks, it works OK on my HP Pavillion dv6152ea.

    How I can obtain a list of all the key/value pairs?

  5. Philip Langdale | 12th September 2007 at 23:35 | Permalink

    key/value pairs? Do you mean documentation for the full config space? We don’t have that – dunno whether we could get that.

  6. Robert González | 13th September 2007 at 06:50 | Permalink

    then… how you know that ’0xCB=0×02′ is ‘MMC Disable’?

    sorry, my english is a little bad.

  7. Philip Langdale | 13th September 2007 at 06:52 | Permalink

    The explaination of what each register does was given by Rezwanul from Dell. Technically speaking, ‘MMC Disable’ is only the second bit of the 0xCB register. Other bits in there will disable the other functions.

  8. skunk | 29th September 2007 at 20:24 | Permalink

    it doesn’t work for me that way:

    # setpci -s ’03:01.0′ 0xCA=0�57
    setpci: Invalid value “0�57″

    so i gave the values without 0x (…0xCA=57)
    but i still can’t read my mmc card…

    here’s my lspci output:

    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)

  9. Philip Langdale | 29th September 2007 at 20:26 | Permalink

    Well, I assume that’s because you’ve used some odd character ‘�’ instead of an ‘x’ in 0×57…

  10. skunk | 30th September 2007 at 04:40 | Permalink

    i copied the commands directly from your blog and the odd character looks like a x but isn’t…
    anyway even with the right values it doesn’t work for me.
    i’ve the following modules loaded: mmc_block (loaded manually), mmc_core and sdhci.

  11. Philip Langdale | 30th September 2007 at 12:33 | Permalink

    What does setpci report the values of 0xCA and 0XCB as before and after you try and set them?

  12. skunk | 2nd October 2007 at 09:24 | Permalink

    after a fresh reboot:

    # setpci -s ’03:01.0′ 0xCA 0xCB
    00
    02

    it looks like the regs are already set to that value… (using kernel 2.6.22.9)

  13. Philip Langdale | 2nd October 2007 at 09:45 | Permalink

    Skunk,

    Yes, it appears that the change is actually sticky and will be remembered across a reboot. But I’m afraid that if you’ve got those values and you still can’t use your mmc cards (but can use your SD cards), then you have a separate problem which will require a separate solution.

  14. Mike Taht | 3rd October 2007 at 17:22 | Permalink

    I was delighted to hear that a solution potentially existed for this problem – not being able to read XD cards on the hp dv6308nr (in x86 mode, haven’t tried x86_64) was a tad annoying. However, it looks like this fix doesn’t quite apply to this laptop’s mmc interface.

    I looped and tested through all the potential single bit values in the CB register to some ill effect.

    With an SD card inserted and values other than “1″ in that register, I see this fairly often:

    Oct 3 19:00:18 localhost kernel: b43-phy0 ERROR: PHY transmission error

    No effect on the XD card.

    lspci -v

    07:05.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (prog-if 10 [OHCI])
    Subsystem: Hewlett-Packard Company Unknown device 30b7
    Flags: bus master, medium devsel, latency 64, IRQ 10
    Memory at bc000000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: [dc] Power Management version 2

    07:05.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    Subsystem: Hewlett-Packard Company Unknown device 30b7
    Flags: bus master, medium devsel, latency 64, IRQ 11
    Memory at bc000800 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    07:05.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
    Subsystem: Hewlett-Packard Company Unknown device 30b7
    Flags: bus master, medium devsel, latency 0, IRQ 11
    Memory at bc000c00 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    07:05.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
    Subsystem: Hewlett-Packard Company Unknown device 30b7
    Flags: medium devsel, IRQ 11
    Memory at bc001000 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    07:05.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
    Subsystem: Hewlett-Packard Company Unknown device 30b7
    Flags: medium devsel, IRQ 11
    Memory at bc001400 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    Kernel 2.6.22.9-91.fc7 #1 SMP

  15. Philip Langdale | 3rd October 2007 at 17:32 | Permalink

    Hmm? xD? There’s absolutely no support for xD cards in the linux kernel. No amount of bit flipping will change that.

  16. Mike Taht | 3rd October 2007 at 17:38 | Permalink

    setting that register to not have the 1st bit set has an interesting side effect here:

    lspci -v # changes the output for this device to:

    07:05.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff) (prog-if ff)
    !!! Unknown header type 7f

    So methinks the relevant register for this tweak is not CB, for this machine. Ah, well, only 253 registers to try….

  17. Mike Taht | 3rd October 2007 at 18:10 | Permalink

    Ah, thx, sorry for the confusion. hope springs eternal.

    I’ll give a mmc card a shot with this setup…..

  18. skunk | 13th October 2007 at 05:31 | Permalink

    hi!

    with kernel 2.6.23 something is moving but i still get no access to the mmc card with the following error when inserting the card:

    mmc0: error 4 whilst initialising MMC card

    so i recompiled with MMC_DEBUG…
    when loading the sdhci module i get this output:

    sdhci: Secure Digital Host Controller Interface driver
    sdhci: Copyright(c) Pierre Ossman
    sdhci: SDHCI controller found at 0000:03:01.1 [1180:0822] (rev 22)
    sdhci [sdhci_probe()]: found 1 slot(s)
    ACPI: PCI Interrupt 0000:03:01.1[B] -> GSI 18 (level, low) -> IRQ 18
    sdhci [sdhci_probe_slot()]: slot 0 at 0xf9bfd400, irq 18
    sdhci: ============== REGISTER DUMP ==============
    sdhci: Sys addr: 0×00000000 | Version: 0×00000400
    sdhci: Blk size: 0×00000000 | Blk cnt: 0×00000000
    sdhci: Argument: 0×00000000 | Trn mode: 0×00000000
    sdhci: Present: 0x01f20000 | Host ctl: 0×00000000
    sdhci: Power: 0×00000000 | Blk gap: 0×00000000
    sdhci: Wake-up: 0×00000000 | Clock: 0×00000000
    sdhci: Timeout: 0×00000000 | Int stat: 0×00000000
    sdhci: Int enab: 0x00ff00fb | Sig enab: 0x00ff00fb
    sdhci: AC12 err: 0×00000000 | Slot int: 0×00000000
    sdhci: Caps: 0x01e021a1 | Max curr: 0×00000040
    sdhci: ===========================================
    mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
    mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    mmc0: SDHCI at 0xf9bfd400 irq 18 DMA
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
    mmc0: starting CMD0 arg 00000000 flags 00000040
    mmc0: req done (CMD0): 1: 00000000 00000000 00000000 00000000
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    mmc0: starting CMD8 arg 000001aa flags 00000075
    mmc0: req done (CMD8): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD1 arg 00000000 flags 00000061
    mmc0: req done (CMD1): 1: 00000000 00000000 00000000 00000000
    mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

    after inserting the card:

    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000040
    mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 1 Vdd 21 width 0 timing 0
    mmc0: starting CMD0 arg 00000000 flags 00000040
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000001
    mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    mmc0: starting CMD8 arg 000001aa flags 00000075
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD8): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD55 arg 00000000 flags 00000075
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD55): 1: 00000000 00000000 00000000 00000000
    mmc0: starting CMD1 arg 00000000 flags 00000061
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000001
    mmc0: req done (CMD1): 0: 00ff8000 00000000 00000000 00000000
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 20 width 0 timing 0
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 1 Vdd 20 width 0 timing 0
    mmc0: starting CMD0 arg 00000000 flags 00000040
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000001
    mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
    mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 20 width 0 timing 0
    mmc0: starting CMD1 arg 40300000 flags 00000061
    sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    mmc0: req done (CMD1): 1: 00000000 00000000 00000000 00000000
    mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0
    mmc0: error 4 whilst initialising MMC card

    0xCA 0xCB values before apply setpci was 00 00, now they are 00 02

    i don’t have a sd card to try with right now…

    thank you!

  19. Philip Langdale | 13th October 2007 at 08:11 | Permalink

    Given that error, I’d ask on the sdhci mailing list.

  20. hermouche | 14th October 2007 at 12:02 | Permalink

    i’ve got an IBM ThinkPad z60m and this is the output of the lspci -v:

    [root@ibm dev]# lspci -v
    00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
    Subsystem: IBM Unknown device 0575
    Flags: bus master, fast devsel, latency 0
    Capabilities: [e0] Vendor Specific Information

    00:01.0 PCI bridge: Intel Corporation Mobile 915GM/PM Express PCI Express Root Port (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 00002000-00002fff
    Memory behind bridge: b0100000-b01fffff
    Prefetchable memory behind bridge: c8000000-cfffffff
    Capabilities: [88] Subsystem: IBM Unknown device 0578
    Capabilities: [80] Power Management version 2
    Capabilities: [90] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable
    Capabilities: [a0] Express Root Port (Slot ) IRQ 0
    Capabilities: [100] Virtual Channel
    Capabilities: [140] Unknown (5)

    00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)
    Subsystem: IBM Unknown device 05b7
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at b0000000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [50] Power Management version 2
    Capabilities: [60] Message Signalled Interrupts: Mask- 64bit Queue=0/0 Enable-
    Capabilities: [70] Express Unknown type IRQ 0
    Capabilities: [100] Virtual Channel
    Capabilities: [130] Unknown (5)

    00:1c.0 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1 (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
    Memory behind bridge: b0200000-b02fffff
    Capabilities: [40] Express Root Port (Slot ) IRQ 0
    Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable
    Capabilities: [90] Subsystem: IBM Unknown device 05b8
    Capabilities: [a0] Power Management version 2
    Capabilities: [100] Virtual Channel
    Capabilities: [180] Unknown (5)

    00:1c.1 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2 (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=03, subordinate=0a, sec-latency=0
    I/O behind bridge: 00003000-00004fff
    Memory behind bridge: b2000000-b3ffffff
    Prefetchable memory behind bridge: 00000000d0000000-00000000d00fffff
    Capabilities: [40] Express Root Port (Slot ) IRQ 0
    Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable
    Capabilities: [90] Subsystem: IBM Unknown device 05b8
    Capabilities: [a0] Power Management version 2
    Capabilities: [100] Virtual Channel
    Capabilities: [180] Unknown (5)

    00:1c.2 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3 (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=0b, subordinate=12, sec-latency=0
    I/O behind bridge: 00005000-00006fff
    Memory behind bridge: b4000000-b5ffffff
    Prefetchable memory behind bridge: 00000000d0100000-00000000d01fffff
    Capabilities: [40] Express Root Port (Slot ) IRQ 0
    Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable
    Capabilities: [90] Subsystem: IBM Unknown device 05b8
    Capabilities: [a0] Power Management version 2
    Capabilities: [100] Virtual Channel
    Capabilities: [180] Unknown (5)

    00:1c.3 PCI bridge: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 4 (rev 03) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=13, subordinate=13, sec-latency=0
    I/O behind bridge: 00007000-00008fff
    Memory behind bridge: b6000000-b7ffffff
    Prefetchable memory behind bridge: 00000000d0200000-00000000d02fffff
    Capabilities: [40] Express Root Port (Slot ) IRQ 0
    Capabilities: [80] Message Signalled Interrupts: Mask- 64bit- Queue=0/0 Enable
    Capabilities: [90] Subsystem: IBM Unknown device 05b8
    Capabilities: [a0] Power Management version 2
    Capabilities: [100] Virtual Channel
    Capabilities: [180] Unknown (5)

    00:1d.0 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03) (prog-if 00 [UHCI])
    Subsystem: IBM Unknown device 0565
    Flags: bus master, medium devsel, latency 0, IRQ 16
    I/O ports at 1800 [size=32]

    00:1d.1 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03) (prog-if 00 [UHCI])
    Subsystem: IBM Unknown device 0565
    Flags: bus master, medium devsel, latency 0, IRQ 21
    I/O ports at 1820 [size=32]

    00:1d.2 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03) (prog-if 00 [UHCI])
    Subsystem: IBM Unknown device 0565
    Flags: bus master, medium devsel, latency 0, IRQ 22
    I/O ports at 1840 [size=32]

    00:1d.3 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03) (prog-if 00 [UHCI])
    Subsystem: IBM Unknown device 0565
    Flags: bus master, medium devsel, latency 0, IRQ 23
    I/O ports at 1860 [size=32]

    00:1d.7 USB Controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03) (prog-if 20 [EHCI])
    Subsystem: IBM Unknown device 0566
    Flags: bus master, medium devsel, latency 0, IRQ 23
    Memory at b0004000 (32-bit, non-prefetchable) [size=1K]
    Capabilities: [50] Power Management version 2
    Capabilities: [58] Debug port

    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3) (prog-if 01 [Subtractive decode])
    Flags: bus master, fast devsel, latency 0
    Bus: primary=00, secondary=14, subordinate=17, sec-latency=64
    I/O behind bridge: 00009000-0000cfff
    Memory behind bridge: b8000000-c00fffff
    Prefetchable memory behind bridge: 00000000d8000000-00000000dfffffff
    Capabilities: [50] Subsystem: Gammagraphx, Inc. Unknown device 0000

    00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
    Subsystem: IBM Unknown device 0568
    Flags: bus master, medium devsel, latency 0

    00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03) (prog-if 80 [Master])
    Subsystem: IBM Unknown device 056a
    Flags: bus master, 66MHz, medium devsel, latency 0
    I/O ports at 01f0 [size=8]
    I/O ports at 03f4 [size=1]
    I/O ports at 0170 [size=8]
    I/O ports at 0374 [size=1]
    I/O ports at 1880 [size=16]
    Capabilities: [70] Power Management version 2

    00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
    Subsystem: IBM Unknown device 056b
    Flags: medium devsel, IRQ 20
    I/O ports at 18a0 [size=32]

    01:00.0 VGA compatible controller: ATI Technologies Inc M22 [Mobility Radeon X300] (prog-if 00 [VGA])
    Subsystem: IBM Unknown device 058d
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at c8000000 (32-bit, prefetchable) [size=128M]
    I/O ports at 2000 [size=256]
    Memory at b0100000 (32-bit, non-prefetchable) [size=64K]
    [virtual] Expansion ROM at b0120000 [disabled] [size=128K]
    Capabilities: [50] Power Management version 2
    Capabilities: [58] Express Endpoint IRQ 0
    Capabilities: [80] Message Signalled Interrupts: Mask- 64bit Queue=0/0 Enable-
    Capabilities: [100] Advanced Error Reporting

    02:00.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5751M Gigabit Ethernet PCI Express (rev 11)
    Subsystem: IBM Unknown device 0577
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at b0200000 (64-bit, non-prefetchable) [size=64K]
    Capabilities: [48] Power Management version 2
    Capabilities: [50] Vital Product Data
    Capabilities: [58] Message Signalled Interrupts: Mask- 64bit Queue=0/3 Enable-
    Capabilities: [d0] Express Endpoint IRQ 0
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [13c] Virtual Channel

    14:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b3)
    Subsystem: IBM Unknown device 056c
    Flags: bus master, medium devsel, latency 168, IRQ 16
    Memory at c0000000 (32-bit, non-prefetchable) [size=4K]
    Bus: primary=14, secondary=15, subordinate=16, sec-latency=176
    Memory window 0: d8000000-dbfff000 (prefetchable)
    Memory window 1: b8000000-bbfff000
    I/O window 0: 00009000-000090ff
    I/O window 1: 00009400-000094ff
    16-bit legacy interface ports at 0001

    14:00.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C552 IEEE 1394 Controller (rev 08) (prog-if 10 [OHCI])
    Subsystem: IBM ThinkPad A/T/X Series
    Flags: bus master, medium devsel, latency 64, IRQ 21
    Memory at c0001000 (32-bit, non-prefetchable) [size=2K]
    Capabilities: [dc] Power Management version 2

    14:00.2 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 17)
    Subsystem: IBM Thinkpad Z60m
    Flags: bus master, medium devsel, latency 64, IRQ 22
    Memory at c0001800 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    14:00.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 08)
    Subsystem: IBM Unknown device 0596
    Flags: medium devsel, IRQ 11
    Memory at c0001c00 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    14:02.0 Network controller: Intel Corporation PRO/Wireless 2915ABG Network Connection (rev 05)
    Subsystem: Intel Corporation Unknown device 1011
    Flags: bus master, medium devsel, latency 64, IRQ 18
    Memory at c0002000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [dc] Power Management version 2

    [root@ibm dev]#

    So does it work for me? if it does what should i do or edit please ?

    Thanks

    red

  21. Philip Langdale | 14th October 2007 at 12:04 | Permalink

    hermouche, Your machine already doesn’t have the MMC controller active, so it should work without doing anything special.

  22. xavier | 23rd October 2007 at 13:22 | Permalink

    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev f

    Qu’est ce que je dois faire avec ça pour que ça marche au moins avec les cartes sd? modprode quoi? J’écris quoi dans la config pci?
    (je ne suis débutant qu’en sdhci donc vous pouvez y aller dans les explications techniques :) )

  23. Philip Langdale | 24th October 2007 at 16:13 | Permalink

    Xavier,

    Pour les cartes SD, vous n’avez pas besoin de faire quoi que ce soit. Ils devraient fonctionner automatiquement.

  24. lonegunman | 27th October 2007 at 03:51 | Permalink

    Dell Inspiron 1510 with Ricoh Co Ltd R5C843 MMC Host Controller

    work !

  25. onlinelli | 29th October 2007 at 02:24 | Permalink

    Unfortunately I didn’t manage to get it work yet:

    nelli@chuck-norris:~$ lspci -v | grep Ricoh
    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (prog-if 10 [OHCI])
    03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19) (prog-if 01)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 0a)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 05)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff) (prog-if ff)

    Which device am I to take? The Firewire (’03:01.0′) or the MMC Host Controller (’03:01.2′) or whatever?

    Thanks a lot in advance, Nelli

  26. Philip Langdale | 29th October 2007 at 06:38 | Permalink

    You want the firewire controller.

    Also, if you want to try out 2.6.24-rc1, it includes a fake driver that does this automatically.

  27. Sebastian | 30th October 2007 at 09:46 | Permalink

    I have summarized this post and then translated it to Polish.
    The translation is available here: http://osnews.pl/ricoh-r5c822-i-linux-obsluga-mmc (with link to the source preserved).

    I hope, you don’t mind.

  28. Georges | 1st November 2007 at 03:20 | Permalink

    Hi !
    I may be dumb but, I’m having problems making my Ricoh Memory stick Pro card reader to work into my brand new Lenovo 3000 N200 model 0769-BAG.
    Lspci says :
    06:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5906M Fast Ethernet PCI Express (rev 02)
    08:06.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
    08:06.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    08:06.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 0a)
    08:06.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 05)
    08:06.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)
    So I’ve done :
    /sbin/setpci -s ’08:06.0′ 0xCA=0×57
    /sbin/setpci -s ’08:06.0′ 0xCB=0×02
    /sbin/setpci -s ’08:06.0′ 0xCA=0×00
    then inserted my card, but nothing appears into dmesg nor /var/log/messages. I wonder if I need to insert a module or something else ?
    I’ve worked with the Firewire registers as suggested on your blog above but I may be wrong.
    All help will be appreciated.
    Thanks

  29. Philip Langdale | 1st November 2007 at 06:35 | Permalink

    Well, as clearly stated, this article is about using MMC cards. Memory Stick is not supported by Linux in any way.

  30. Allan | 13th November 2007 at 03:17 | Permalink

    Great work! Worked beautifully for my Dell 6400

  31. Grothesk | 23rd November 2007 at 09:14 | Permalink

    Works here with that hardware:

    03:0b.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
    03:0b.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    03:0b.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)

    I’d like to see that included into the kernel. Would make it easier for everyone to get that cardreader to work.

  32. Philip Langdale | 23rd November 2007 at 09:27 | Permalink

    It will be in 2.6.24. You can see it already in the current rc releases.

  33. Gürkan Gür | 25th November 2007 at 14:00 | Permalink

    hi, i’ve edit this.. this month i’ll write our Turkish linux e-magazine named “eniXma”

    this is automatically finds which pci number that you’re using for firewire..

    Thanks to you :)

    here:

    #!/bin/bash
    modprobe -r sdhci
    setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCA=0×57
    setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCB=0×02
    # setpci -s `lspci | grep “IEEE” | awk ‘{print $1}’` 0xCA=0×00
    modprobe sdhci

  34. Gürkan Gür | 25th November 2007 at 14:02 | Permalink

    ooops sorry.. delete the “#” in third setpci line..
    :)

  35. Dustin | 5th December 2007 at 10:44 | Permalink

    This worked for me! I am using a Dell Inspiron 6400 running OpenSuSe 10.3. Only tested it with SD memory cards so far. I just put the commands in /etc/init.d/boot.local so they would load at startup. Works fine! Hope it works with xD cards as well.

  36. Philip Langdale | 5th December 2007 at 11:03 | Permalink

    Umm, as the title says – this is to allow you to use MMC cards. SD cards work anyway and xD cards don’t work at all.

  37. En-Cu-Kou | 25th December 2007 at 03:03 | Permalink

    Works like a charm on my Asus F3TC… Thank you!

  38. Jorge Maroto | 26th December 2007 at 13:15 | Permalink

    This work for me too on Dell Inspiron 9400

    Thanks for your job

  39. Gonzague Reydet | 4th February 2008 at 10:53 | Permalink

    I have the same kind of problem as skunk who posted above.

    After a reboot, the command setpci returns as below:
    # setpci -s ‘09:01.0′ 0xCA 0xCB
    00
    02

    And Memory Sticks are still not recognized… (But SD cards work well!)
    I have an Asus F3sv Laptop with Ubuntu 7.10 and kernel 2.6.22

  40. Farbod N | 12th February 2008 at 17:49 | Permalink

    Hi I’ve got a Lenovo T61 with a Ricoh R5C822 in it. I’ve compiled 2.6.24 (which has SDIO support) on my Ubuntu but I can’t get it to work with my SPECTEC SDIO WLAN Card (http://www.spectec.com.tw/sdw821.htm). I have no problems with normal SD cards, however it seems that SDIO card responses are not reaching the SDHCI driver properly.

    # lspci -s 15:00.2 -v
    15:00.2 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 21)
    Subsystem: Lenovo Unknown device 20c8
    Flags: medium devsel, IRQ 23
    Memory at f8101800 (32-bit, non-prefetchable) [size=256]
    Capabilities: [80] Power Management version 2

    /var/log/messages (From when I insert the SDIO card)
    [92726.193113] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000040
    [92726.502139] mmc0: clock 0Hz busmode 1 powermode 1 cs 0 Vdd 21 width 0 timing 0
    [92726.504142] mmc0: clock 128906Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    [92726.506143] mmc0: clock 128906Hz busmode 1 powermode 2 cs 2 Vdd 21 width 0 timing 0
    [92726.507147] mmc0: starting CMD0 arg 00000000 flags 00000004
    [92726.507645] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00000001
    [92726.507658] mmc0: req done (CMD0): 0: 00000000 00000000 00000000 00000000
    [92726.508666] mmc0: clock 187500Hz busmode 1 powermode 2 cs 0 Vdd 21 width 0 timing 0
    [92726.509670] mmc0: starting CMD5 arg 00000000 flags 00000061
    [92726.510822] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    [92726.512845] mmc0: req failed (CMD5): -110, retrying…
    [92726.513786] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    [92726.515807] mmc0: req failed (CMD5): -110, retrying…
    [92726.516752] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    [92726.518761] mmc0: req failed (CMD5): -110, retrying…
    [92726.519554] sdhci [sdhci_irq()]: *** sdhci:slot0 got interrupt: 0×00018000
    [92726.521565] mmc0: req done (CMD5): -110: 00000000 00000000 00000000 00000000
    [92726.521580] mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

    Things to note:
    1. I’ve removed polling for SD and MMC cards to make it easier to read dmesg
    2. 0×00018000 is (SDHCI_INT_TIMEOUT|SDHCI_INT_ERROR). It seems that the Ricoh chip is not returning the CMD5 responses. Even though they are valid and happening within a few clock cycles of the command (I’ve verified with logic analyser).
    3. I’ve also tried it with a 187500Hz clock. (This is the clock used by the Arasan host which connects to the same SDIO card properly using the same sequence of initial SDIO commands).
    4. I tried the above-mentioned ‘setpci’ commands, and nothing changed. Still no good.

    Has anyone tried the SDIO driver on the 2.6.24 kernel and got it working?

    Anyone have any ideas?

  41. Philip Langdale | 13th February 2008 at 07:46 | Permalink

    Farbod,

    That’s strange. CMD5 is a ‘standard’ command on the host side and it shouldn’t be possible for it to fail uniquely in this way. I’d suggest asking on the sdhci list.

  42. Farbod Nejati | 13th February 2008 at 14:53 | Permalink

    Philip,

    I did that right after the post here yesterday. I’m working on getting some images from the logic analyser as well. Hopefully we’ll get to the bottom of it soon.

    Regards
    Farbod Nejati

  43. Eric Sacha Callejas | 25th February 2008 at 09:43 | Permalink

    Bonjour Philip,

    Not sure which language is best to ask, but here I go:

    I am new at this and i have a Memory Stick PRO that I would like to use on my HP DV2035EA.

    Here is my info:
    sacha@sacha-laptop:~$ lspci | grep Ricoh
    05:09.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
    05:09.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    05:09.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 01)
    05:09.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
    05:09.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)

    When I tried:
    sacha@sacha-laptop:/bin$ setpci -s ‘05:09.0′ 0xCA=0×57
    setpci: -s: Invalid bus number
    sacha@sacha-laptop:/bin$ setpci -s 05:09.0 0xCA=0×57
    setpci: Invalid value “0×57″

    What am I doing wrong?

  44. Philip Langdale | 25th February 2008 at 09:55 | Permalink

    Memory Stick is not the same as MMC. So you shouldn’t be surprised that this does nothing for you. There is no Memory Stick or xD support with these controllers yet.

  45. Mike | 28th February 2008 at 00:15 | Permalink

    Perfect! Work on Acer Aspire 4720z
    0a:09.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    0a:09.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    0a:09.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 12)
    0a:09.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    0a:09.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)
    Thanks!

  46. Guillaume | 9th April 2008 at 14:07 | Permalink

    Hi. Thanks for these informations! I’ve just a last problem : ok SD cards and MMC cards works fine with the Ricoh R5C832 card on m1330 but the firewire part don’t works for me. Impossible to plug a HDD or a video camera. Any ideas?

    $ sudo lspci -v | grep -A5 1394
    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05) (prog-if 10 [OHCI])
    Subsystem: Dell Unknown device 0209
    Flags: bus master, medium devsel, latency 64, IRQ 18
    Memory at fe4ff800 (32-bit, non-prefetchable) [size=2K]
    Capabilities: [dc] Power Management version 2

    $ sudo modprobe raw1394
    $ sudo modprobe dv1394

    $ sudo chmod 777 /dev/raw1394
    $ sudo mount /dev/raw1394 /media/disk
    mount: /dev/raw1394 n’est pas un périphérique de type bloc

  47. Philip Langdale | 9th April 2008 at 14:28 | Permalink

    Uhh, that has nothing to do with what I’m talking about but you want to load the ‘sbp2′ module for firewire storage devices and then mount the appropriate /dev/sdd or whatever node.

  48. Bill Southwell | 8th June 2008 at 17:41 | Permalink

    Hello Philip,

    Thank you for this mod. Not working however on my HP 8710w with Ricoh R5C822.

    I’ve enabled the dummy driver and compiled Kubongo 2.6.24-18 (Hardy Heron), and I see the driver disabling MMC, and in lspci I see the four devices now, and sdhci is compiled into the kernel, but plugging in an sd card has no effect. No response in dmesg nor by the system.

    # dmesg
    [ 17.905963] mmc0: SDHCI at 0xe4103000 irq 19 DMA
    [ 17.907070] ricoh-mmc: Ricoh MMC Controller disabling driver
    [ 17.907138] ricoh-mmc: Copyright(c) Philip Langdale
    [ 17.908520] ricoh-mmc: Ricoh MMC controller found at 0000:02:06.4 [1180:0843] (rev 10)
    [ 17.908611] ricoh-mmc: Controller is now disabled.

    # lspci
    02:06.3 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 20)
    02:06.4 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 10)
    02:06.5 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 10)
    02:06.6 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 10)

  49. Philip Langdale | 8th June 2008 at 17:55 | Permalink

    If you’re trying to use an SD card, then this mod isn’t necessary – and if that SD card doesn’t work, then you have a more fundamental problem. I’d recommend asking on the sdhci mailing list.

  50. Milton Jimenez | 12th June 2008 at 06:13 | Permalink

    Dell Inspiron 1420 ubuntu 8.04 i have been trying your solution but does not work,lspci (03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)).Can you help me thanks

  51. Milton Jimenez | 12th June 2008 at 06:20 | Permalink

    When i use your instruccions it says:setpci: -s: Invalid bus number

  52. Philip Langdale | 12th June 2008 at 06:39 | Permalink

    You shouldn’t need to use these instructions. The driver is already in the kernel shipped with Ubuntu 8.04

  53. Bill Southwell | 14th June 2008 at 21:08 | Permalink

    Well I guess I’m at a dead-end.

    The driver gives me all four interfaces and I’ve compiled in the SDHCI driver, but when I insert an SD card there is no response and nothing in dmesg.

    And the sdhci mailing list is shut down.

  54. Bill Southwell | 14th June 2008 at 21:11 | Permalink

    Well I guess I’m at a dead end.

    The driver enables all four interfaces and I’ve compiled in the sdhci module, but when I insert an SD card there’s no response and nothing in dmesg.

    And the sdhci mailing list is shut down.

  55. Philip Langdale | 16th June 2008 at 21:21 | Permalink

    Bill, can you try a 2.6.25 kernel from kernel.org?

  56. Andi | 3rd July 2008 at 06:57 | Permalink

    Hello!
    I have tryed the commands but i only get kernel freeze (2.6.24-19 Ubuntu 8.04).
    People with the same notebeook (HP dv6648) got the Cardreader working out of the box.
    How can i set the Cardreader PCI device back to default values? Maybe it would work then with 2.6.25
    And how can i see what i have changed?(the values of the pci device)
    I don’t know how to use the setpci command and man don’t help me.

    The setpci command changes the hardware registers, true?

    lspci:
    07:05.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    07:05.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    07:05.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    07:05.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    07:05.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)

    greetz, Andi

  57. Philip Langdale | 3rd July 2008 at 07:00 | Permalink

    There is a bug related to interrupts in the Ubuntu 8.04 kernel that stops the card reader working. You *do not* need to type any of these commands as the driver in new kernels does it automatically.

    http://ubuntuforums.org/showthread.php?t=724062

    I recommend you upgrade to a 2.6.25 kernel.

  58. Andi | 4th July 2008 at 03:59 | Permalink

    Hello Philip!

    I tryed Fedora 9 which is using the 2.6.25 kernel but it don’t work too. Have i changed hardware registers with the setpci command or is it only a kernel configuration command?

    greetz, Andi

  59. Souley | 28th July 2008 at 04:53 | Permalink

    It works for me, I can read MMC cards on the laptop Asus F3jv AS022P.

    Here is my output with the command ‘lspci | grep Ricoh’

    06:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
    06:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
    06:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 0a)
    06:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 05)

    Then as advised in the first post I have typed in a terminal
    sudo setpci -s ’06:01.0′ 0xCA=0×57 …

    note : As a lazy user, I did a copy&paste of the commands to my terminal, it did not worked. Then I typed the commands and it did…

    Thanks to philip and the DELL’s guys !

  60. Milton Jimenez | 29th July 2008 at 14:58 | Permalink

    Well i´ll have to thank you for your effort,now i know that not Sony memory stick,nor Xd can be read in linux
    so lets time to resolve it
    now i understand.
    thanks anyway

  61. dinpel | 11th August 2008 at 02:22 | Permalink

    Hi i have Dell inspiron 1720,and i have the same problem with the mmc.I use ubuntu hardy 8.04.1.

    Here is my output with the command ‘lspci | grep Ricoh’

    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)

    I write.

    dnit@dnit-laptop:~$ sudo setpci -s ‘03:01.0′ 0xCA=0×57
    setpci: -s: Invalid bus number
    dnit@dnit-laptop:~$

    and write.

    dnit@dnit-laptop:~$ sudo /sbin/setpci -s ‘03:01.0′ 0xCA=0×57
    sudo: /sbin/setpci: command not found
    dnit@dnit-laptop:~$

    I am a novice at this and I just needed to use the card reader. Sorry for my english i am spanish.

    byezZ. Help…..

  62. Philip Langdale | 11th August 2008 at 06:54 | Permalink

    dinpel, see comment #1

  63. Smashin | 22nd August 2008 at 04:47 | Permalink

    Dell XPS M1330

    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)

    Fedora 8 64bit 2.6.25.14-69 – MMC not working. Nothing happens on card insert, no log.
    SD card is working fine.
    I guess it is related to the revision.

  64. Smashin | 22nd August 2008 at 05:34 | Permalink

    OK, I have a solution based on
    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=882c49164d72c45f37d7fa1bb3de7c31cf1a5fab

    To get MMC running on DELL XPS M1330 with Fedora 8 x64 and hardware:
    03:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)
    03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)

    save the following into a file, add exec rights and run it as root:

    #!/bin/bash
    DISABLE=`setpci -s ’03:01.0′ 0xB7`
    if [ $(($DISABLE & 2)) -eq 2 ]
    then
    echo “Controller already disabled. Nothing to do.”
    exit 0
    fi
    WRITE_ENABLE=`setpci -s ’03:01.0′ 0x8e`
    setpci -s ’03:01.0′ 0x8e=0xAA
    WRITE_TARGET=`setpci -s ’03:01.0′ 0x8d`
    setpci -s ’03:01.0′ 0x8d=0xb7
    setpci -s ’03:01.0′ 0xB7=0×02
    setpci -s ’03:01.0′ 0x8e=0x$WRITE_ENABLE
    setpci -s ’03:01.0′ 0x8d=0x$WRITE_TARGET

  65. Smashin | 23rd August 2008 at 06:25 | Permalink

    Script updated!

    You can get it also from http://www.gips.net/mmc/enable-mmc.sh

    #!/bin/bash
    DISABLE=`setpci -s ’03:01.0′ 0xB7`
    if [ $(($DISABLE & 2)) -eq 2 ]
    then
    echo “Controller already disabled. Nothing to do.”
    exit 0
    fi
    WRITE_ENABLE=`setpci -s ’03:01.0′ 08e`
    setpci -s ’03:01.0′ 0x8e=0xAA
    WRITE_TARGET=`setpci -s ’03:01.0′ 08d`
    setpci -s ’03:01.0′ 0x8d=0xb7
    setpci -s ’03:01.0′ 0xB7=$(($DISABLE | 2))
    setpci -s ’03:01.0′ 0x8e=0x$WRITE_ENABLE
    setpci -s ’03:01.0′ 0x8d=0x$WRITE_TARGET

  66. Lili | 14th September 2008 at 02:24 | Permalink

    On a Dell Vostro 1400, it works using the following parameters:

    setpci -s 03:01.0 0xCA=0X57
    setpci -s 03:01.0 0xCB=0X02
    setpci -s 03:01.0 0xCA=0X00

    Lspci output is:
    03:01.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)
    03:01.2 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)
    03:01.3 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 12)

  67. Big_Gray | 17th December 2008 at 07:28 | Permalink

    Thank you! Works good on dell Inspiron 15011501

  68. Ivan | 7th November 2009 at 16:31 | Permalink

    Hi guys -

    Any ideas how to make SD works with Fedora 11 on a Vaio TZ?

    Here some info:

    lspci | grep Ricoh

    09:04.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev ba)
    09:04.1 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 04)
    09:04.4 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 11)

  69. Philip Langdale | 8th November 2009 at 10:42 | Permalink

    @Ivan: You’re out of luck. Your machine only has a memory stick slot (go Sony!)

{ 1 } Trackback

  1. Lenovo 3000 N200 / Ubuntu Gutsy | 10th August 2009 at 12:52 | Permalink

    [...] Blogbeitrag zum Cardreaderbug [...]