# [solved] Texas Instruments PCIxx21/x515 Cardbus Controller

## sidious

hi,

I've downloaded and installed kernel 2.6.17.2 from kernel.org,

because there is a new modul for the internal Card-Reader (Texas Instruments PCIxx21/x515 Cardbus Controller)

of my laptop (Acer Extensa 3001 WLMi). The module name is "sdhci"

lspci:

```
00:00.0 Host bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)

00:00.1 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)

00:00.3 System peripheral: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to I/O Controller (rev 02)

00:01.0 PCI bridge: Intel Corporation 82852/82855 GM/GME/PM/GMV Processor to AGP Controller (rev 02)

00:1d.0 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 (rev 03)

00:1d.1 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 (rev 03)

00:1d.2 USB Controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 (rev 03)

00:1d.7 USB Controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 83)

00:1f.0 ISA bridge: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge (rev 03)

00:1f.1 IDE interface: Intel Corporation 82801DBM (ICH4-M) IDE Controller (rev 03)

00:1f.3 SMBus: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller (rev 03)

00:1f.5 Multimedia audio controller: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 03)

00:1f.6 Modem: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller (rev 03)

01:00.0 VGA compatible controller: ATI Technologies Inc RV350 [Mobility Radeon 9600 M10]

02:02.0 Ethernet controller: Broadcom Corporation BCM4401 100Base-T (rev 01)

02:04.0 Network controller: Intel Corporation PRO/Wireless 2200BG Network Connection (rev 05)

02:06.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller

02:06.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller

02:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
```

the last 3 ones are the controller.

I compiled the fakephp driver as module and loaded it, then I followed this howto:

http://gentoo-wiki.com/HARDWARE_Gentoo_Acer_Ferrari_4005WLMi_Manual#SDHCI

I executet the lines from the sdhci.sh script 

```
#!/bin/bash

modprobe fakephp

setpci -s 06:09.0 86.b=90:d0 # SDHCI enable

echo 0 > /sys/bus/pci/slots/0000:06:09.3/power

echo 0 > /sys/bus/pci/slots/0000:06:09.2/power

echo 0 > /sys/bus/pci/slots/0000:06:09.0/power

echo 1 > /sys/bus/pci/slots/0000:06:09.0/power

setpci -s 06:09.3 4c.b=02 # FlashMedia SD disable

setpci -s 06:09.4 04.b=06 # SDHCI Mem+ BusMaster+

setpci -s 06:09.4 88.b=01 # SDHCI DMA enable
```

one by one with my PCI IDs 

```
modprobe fakephp

setpci -s 02:06.0 86.b=90:d0 # SDHCI enable

echo 0 > /sys/bus/pci/slots/0000:02:06.3/power

echo 0 > /sys/bus/pci/slots/0000:02:06.2/power

echo 0 > /sys/bus/pci/slots/0000:02:06.0/power
```

the last line gives an error:

```
acer ~ # echo 0 > /sys/bus/pci/slots/0000:02:06.0/power

bash: echo: write error: No such device
```

but the file

```
 /sys/bus/pci/slots/0000:02:06.0/power
```

exists

this is the output of dmesg

```
pci_hotplug: PCI Hot Plug PCI Core version: 0.5

fakephp: Fake PCI Hot Plug Controller Driver

fakephp: Can't remove PCI devices with other PCI devices behind it yet.
```

If I run the complete script I get two errors 

```
./sdhci.sh: line 7: echo: write error: No such device

./sdhci.sh: line 8: echo: write error: No such device

```

 that are this lines of the script

```
echo 0 > /sys/bus/pci/slots/0000:02:06.0/power

echo 1 > /sys/bus/pci/slots/0000:02:06.0/power
```

and dmesg:

```
pci_hotplug: PCI Hot Plug PCI Core version: 0.5

fakephp: Fake PCI Hot Plug Controller Driver

fakephp: Can't remove PCI devices with other PCI devices behind it yet.

sdhci: Secure Digital Host Controller Interface driver, 0.11

sdhci: Copyright(c) Pierre Ossman

PCI: Device 0000:02:06.4 not available because of resource collisions

sdhci: probe of 0000:02:06.4 failed with error -22

ieee1394: Initialized config rom entry `ip1394'

ACPI: PCI Interrupt 0000:02:06.2[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[10]  MMIO=[d020a000-d020a7ff]  Max Packet=[2048]  IR/IT contexts=[4/8]

ieee1394: Host added: ID:BUS[0-00:1023]  GUID[00c09f000041ab29]

```

lspci shows a new device 

```
02:06.4 Class 0805: Texas Instruments PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Secure Digital (SD) Controller
```

but I can't use it..... (PCI: Device 0000:02:06.4 not available because of resource collisions). I think it's because the two lines from the script don't work...

any ideas what I can do to get the (SD)-Card-Reader working?

this is my thread in a german gentoo forum...

http://www.gentooforum.de/thread.php?threadid=10675

----------

## bandreabis

How to compile fakephp?

Andrea

----------

## sidious

select the Fake PCI Hotplug Driver in the kernel-config

```
Bus Options (PCI, PCMCIA, EISA, MCA, ISA) -->

   PCI Hotplug Support -->

           <M> Support for PCI Hotplug (EXPERIMENTAL)

           <M> Fake PCI Hotplug Driver
```

----------

## bandreabis

I was asking about "diff -u" of fakephp.c ... but it doesn't matter because it was enough putting

```
setpci -s 06:09.0 86.b=90:d0 # SDHCI enable

setpci -s 06:09.3 4c.b=02 # FlashMedia SD disable

setpci -s 06:09.4 04.b=06 # SDHCI Mem+ BusMaster+

setpci -s 06:09.4 88.b=01 # SDHCI DMA enable
```

into /etc/conf.d/local.start

(I built-in kernel (original   :Laughing:  )"Fake PCI Hotplug Driver")

and magically SD card was recognized!   :Very Happy: 

now ivman mounts it automatically only after manually setting a mountpoint in fstab (pmount does't do its job  :Confused:  ).

I only can say: *Quote:*   

> THANK YOU VERY MUCH!!!

 

Andrea

----------

## sidious

I think in newer kernels like 2.6.17.2 it's not neccessary to patch the fakephp.c file...

hmm, my Card-Reader won't work  :Sad: 

I tried to use a "clean" kernel, means without any patches and the originally DSDT. 

(I need a patch and a modified DSDT to read out the smart-battery)

But with the same result..

here are the PCI relevant outputs of dmesg (with the patched kernel and DSDT)

```

dmesg | grep PCI

Allocating PCI resources starting at 30000000 (gap: 20000000:dec10000)

PCI: PCI BIOS revision 2.10 entry at 0xfd782, last bus=2

Setting up standard PCI resources

ACPI: PCI Root Bridge [PCI0] (0000:00)

PCI: Probing PCI hardware (bus 00)

PCI quirk: region 1000-107f claimed by ICH4 ACPI/GPIO/TCO

PCI quirk: region 1180-11bf claimed by ICH4 GPIO

PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1

PCI: Transparent bridge - 0000:00:1e.0

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGP_._PRT]

ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PCIB._PRT]

ACPI: PCI Interrupt Link [LNKA] (IRQs *6)

ACPI: PCI Interrupt Link [LNKB] (IRQs *10)

ACPI: PCI Interrupt Link [LNKC] (IRQs *6)

ACPI: PCI Interrupt Link [LNKD] (IRQs *6)

ACPI: PCI Interrupt Link [LNKE] (IRQs *10)

ACPI: PCI Interrupt Link [LNKF] (IRQs 10) *0, disabled.

ACPI: PCI Interrupt Link [LNKG] (IRQs 6) *0, disabled.

ACPI: PCI Interrupt Link [LNKH] (IRQs *10)

PCI: Using ACPI for IRQ routing

PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report

PCI: Bridge: 0000:00:01.0

PCI: Bus 3, cardbus bridge: 0000:02:06.0

PCI: Bridge: 0000:00:1e.0

PCI: Setting latency timer of device 0000:00:1e.0 to 64

PCI: Enabling device 0000:02:06.0 (0104 -> 0107)

ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 10

PCI: setting IRQ 10 as level-triggered

ACPI: PCI Interrupt 0000:02:06.0[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 6

PCI: setting IRQ 6 as level-triggered

ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 6 (level, low) -> IRQ 6

ICH4: IDE controller at PCI slot 0000:00:1f.1

PCI: Enabling device 0000:00:1f.1 (0005 -> 0007)

ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 6

ACPI: PCI Interrupt 0000:00:1f.1[A] -> Link [LNKC] -> GSI 6 (level, low) -> IRQ 6

GLAN MPCI T394 MDM0 USB1 USB2 USB3 

ACPI: PCI Interrupt 0000:02:06.0[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

Yenta: Using CSCINT to route CSC interrupts to PCI

Yenta: Routing CardBus interrupts to PCI

Yenta: ISA IRQ mask 0x08b8, PCI irq 10

pcmcia: parent PCI bridge I/O window: 0x4000 - 0x4fff

pcmcia: parent PCI bridge Memory window: 0xd0200000 - 0xd05fffff

pcmcia: parent PCI bridge Memory window: 0x30000000 - 0x32ffffff

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10

ACPI: PCI Interrupt 0000:00:1f.5[B] -> Link [LNKB] -> GSI 10 (level, low) -> IRQ 10

PCI: Setting latency timer of device 0000:00:1f.5 to 64

ACPI: PCI Interrupt Link [LNKH] enabled at IRQ 10

ACPI: PCI Interrupt 0000:00:1d.7[D] -> Link [LNKH] -> GSI 10 (level, low) -> IRQ 10

PCI: Setting latency timer of device 0000:00:1d.7 to 64

PCI: cache line size of 32 is not supported by device 0000:00:1d.7

ACPI: PCI Interrupt 0000:00:1d.0[A] -> Link [LNKA] -> GSI 6 (level, low) -> IRQ 6

PCI: Setting latency timer of device 0000:00:1d.0 to 64

ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 6

ACPI: PCI Interrupt 0000:00:1d.1[B] -> Link [LNKD] -> GSI 6 (level, low) -> IRQ 6

PCI: Setting latency timer of device 0000:00:1d.1 to 64

ACPI: PCI Interrupt 0000:00:1d.2[C] -> Link [LNKC] -> GSI 6 (level, low) -> IRQ 6

PCI: Setting latency timer of device 0000:00:1d.2 to 64

ACPI: PCI Interrupt 0000:02:02.0[A] -> Link [LNKD] -> GSI 6 (level, low) -> IRQ 6

ACPI: PCI Interrupt 0000:02:04.0[A] -> Link [LNKB] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI Interrupt 0000:01:00.0[A] -> Link [LNKA] -> GSI 6 (level, low) -> IRQ 6

pci_hotplug: PCI Hot Plug PCI Core version: 0.5

fakephp: Fake PCI Hot Plug Controller Driver

fakephp: Can't remove PCI devices with other PCI devices behind it yet.

fakephp: Can't remove PCI devices with other PCI devices behind it yet.

PCI: Device 0000:02:06.4 not available because of resource collisions

ACPI: PCI Interrupt 0000:02:06.2[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[10]  MMIO=[d020a000-d020a7ff]  Max Packet=[2048]  IR/IT ontexts=[4/8]

```

and the dmesg outputs which contain the PCI-IDs 02:06.x

```
PCI: Bus 3, cardbus bridge: 0000:02:06.0

PCI: Enabling device 0000:02:06.0 (0104 -> 0107)

ACPI: PCI Interrupt 0000:02:06.0[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

ACPI: PCI Interrupt 0000:02:06.0[A] -> Link [LNKE] -> GSI 10 (level, low) -> IRQ 10

Yenta: CardBus bridge found at 0000:02:06.0 [1025:0064]

Yenta TI: socket 0000:02:06.0, mfunc 0x01a21b22, devctl 0x64

PCI: Device 0000:02:06.4 not available because of resource collisions

sdhci: probe of 0000:02:06.4 failed with error -22
```

I tried to add 

```
pci=routeirq
```

to the kernel options in /boot/grub/grub.conf  ,but it still wont' work.   :Crying or Very sad: 

just putting 

```
setpci -s 02:06.0 86.b=90:d0 # SDHCI enable

setpci -s 02:06.3 4c.b=02 # FlashMedia SD disable

setpci -s 02:06.4 04.b=06 # SDHCI Mem+ BusMaster+

setpci -s 02:06.4 88.b=01 # SDHCI DMA enable
```

into /etc/conf.d/local.start doesn't work, too.

Someone out there who can help me?

----------

## sidious

Nobody who has an idea?

 :Confused: 

edit:

Card-Reader works with the tifm-drivers...  :Very Happy: 

https://forums.gentoo.org/viewtopic-t-490178-highlight-pcixx21.html?sid=65b9d1a4afdaca6c10b6f9e641272a1c

----------

