mmc does not work on HP NC6220

ales-76 at seznam.cz ales-76 at seznam.cz
Sun Aug 23 16:04:36 UTC 2009


Hello,

I have tried the hack and it works. By changing the one register value in pci config space of the FlashMedia one can reroute the card slot to the SD controller. The config of the controller after the manipulation looks like this:

02:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
	Subsystem: Hewlett-Packard Company Device 0944
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 64 (1750ns min, 1000ns max), Cache Line Size: 64 bytes
	Interrupt: pin B routed to IRQ 19
	Region 0: Memory at d0102000 (32-bit, non-prefetchable)
	Capabilities: [44] Power Management version 2
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
		Status: D3 PME-Enable- DSel=0 DScale=0 PME-
00: 4c 10 33 80 06 00 10 02 00 00 80 01 10 40 80 00
10: 00 20 10 d0 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 00 00 00 00 00 00 00 00 00 00 00 3c 10 44 09
30: 00 00 00 00 44 00 00 00 00 00 00 00 13 02 07 04
40: 00 00 00 00 01 00 02 7e 03 00 00 00 22 00 00 00
50: 3c 10 44 09 05 01 00 00 00 00 00 00 00 00 00 00
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

The process of the reconfiguration is easy:

setpci -s 06.3 4c=0x22

My instistence on pciutils is due to my Linux background, pciconf can do the trick as well:

pciconf -w pci0:2:6:3 76 34

You can check the result with:

lspci -s 02:6.3 -vvvxxx

or

pciconf -r pci0:2:6:3 76

Then I was able to see mmcsd0 device in /dev and mount the file system on it. The dmesg shows:

Aug 23 16:35:25 malka kernel: sdhci0: <TI XX21/XX11 SD> mem 0xd0104000-0xd01040ff,0xd0105000-0xd01050ff,0xd0106000-0xd01060ff irq 22 at device 6.4 on pci2
Aug 23 16:35:25 malka kernel: sdhci0: 3 slot(s) allocated
Aug 23 16:35:25 malka kernel: sdhci0: [ITHREAD]
Aug 23 16:35:51 malka kernel: sdhci0-slot2: Card inserted
Aug 23 16:35:51 malka kernel: mmc0: <MMC/SD bus> on sdhci0
Aug 23 16:35:51 malka kernel: mmc0: Probing bus
Aug 23 16:35:51 malka kernel: mmc0: SD 2.0 interface conditions: OK
Aug 23 16:35:51 malka kernel: mmc0: SD probe: OK (OCR: 0x00ff8000)
Aug 23 16:35:51 malka kernel: mmc0: Current OCR: 0x00ff8000
Aug 23 16:35:51 malka kernel: mmc0: Probing cards
Aug 23 16:35:51 malka kernel: mmc0: New card detected (CID 02544d534430324732a8fbcd99007a00)
Aug 23 16:35:51 malka kernel: mmc0: Card at relative address 63806 added:
Aug 23 16:35:51 malka kernel: mmc0:  card: SD (0x2/0x544d/"SD02G" rev 3.2 m/d 10.2007 s/n 00000000)
Aug 23 16:35:51 malka kernel: mmc0:  bus: 4bit, 50MHz, high speed timing
Aug 23 16:35:51 malka kernel: mmc0:  memory: 3932160 blocks, erase sector 8192 blocks
Aug 23 16:35:51 malka kernel: mmc0: setting transfer rate to 24.000MHz
Aug 23 16:35:51 malka kernel: mmcsd0: 1920MB <SD Memory Card> at mmc0 24MHz/4bit
Aug 23 16:35:51 malka kernel: mmc0: setting bus width to 4 bits

And after removal:

Aug 23 16:38:56 malka kernel: sdhci0-slot2: Card removed
Aug 23 16:38:56 malka kernel: mmc0: detached

Alexander, do you think you can incorporate this hack into the sdhci driver? At least as an option, like hw.sdhci.ti_hack or something. Well, I understand that driver poking in config space of a device that does not belong to it is not very elegant, but it should not do any harm, at least until there is a working FlashMedia driver. I also understand that if it works for me does not necessarily mean it will work for everybody, but as an option and with some safety checks it would be worthwhile.

Ales Blaha

> ------------ Původní zpráva ------------
> Od: Alexander Motin <mav at FreeBSD.org>
> Předmět: Re: mmc does not work on HP NC6220
> Datum: 18.8.2009 20:21:48
> ----------------------------------------
> ales-76 at seznam.cz wrote:
> > The mmc does not seem to work on my HP NC6220 notebook. I have the mmc, mmcsd
> and sdhci compiled as modules, all the modules get loaded properly. The system
> is FreeBSD 7.2, i386, specifically configured and compiled for this machine. If
> i set hw.mmc.debug=1 and hw.sdhci.debug=1 I see following in dmesg:
> > 
> > Aug 17 22:00:36 malka kernel: sdhci0: <TI XX21/XX11 SD> mem
> 0xd0104000-0xd01040ff,0xd0105000-0xd01050ff,0xd0106000-0xd01060ff irq 22 at
> device 6.4 on pci2
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: 16MHz 4bits 3.3V DMA
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: ============== REGISTER DUMP
> ==============
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Sys addr: 0x00000000 | Version: 
> 0x00008400
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Blk size: 0x00000000 | Blk cnt: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Argument: 0x00000000 | Trn mode:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Present:  0x00020000 | Host ctl:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Power:    0x00000000 | Blk gap: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Wake-up:  0x00000000 | Clock:   
> 0x00000002
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Timeout:  0x00000000 | Int stat:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Int enab: 0x01ff00fb | Sig enab:
> 0x01ff00fb
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: AC12 err: 0x00000000 | Slot int:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0: Caps:     0x01821090 | Max curr:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot0:
> ===========================================
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: 16MHz 4bits 3.3V DMA
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: ============== REGISTER DUMP
> ==============
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Sys addr: 0x00000000 | Version: 
> 0x00008400
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Blk size: 0x00000000 | Blk cnt: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Argument: 0x00000000 | Trn mode:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Present:  0x00020000 | Host ctl:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Power:    0x00000000 | Blk gap: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Wake-up:  0x00000000 | Clock:   
> 0x00000002
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Timeout:  0x00000000 | Int stat:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Int enab: 0x01ff00fb | Sig enab:
> 0x01ff00fb
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: AC12 err: 0x00000000 | Slot int:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1: Caps:     0x01821090 | Max curr:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot1:
> ===========================================
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: 24MHz 4bits 3.3V DMA
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: ============== REGISTER DUMP
> ==============
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Sys addr: 0x00000000 | Version: 
> 0x00008400
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Blk size: 0x00000000 | Blk cnt: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Argument: 0x00000000 | Trn mode:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Present:  0x000a0000 | Host ctl:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Power:    0x00000000 | Blk gap: 
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Wake-up:  0x00000000 | Clock:   
> 0x00000002
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Timeout:  0x00000000 | Int stat:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Int enab: 0x01ff00fb | Sig enab:
> 0x01ff00fb
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: AC12 err: 0x00000000 | Slot int:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2: Caps:     0x01821898 | Max curr:
> 0x00000000
> > Aug 17 22:00:36 malka kernel: sdhci0-slot2:
> ===========================================
> > Aug 17 22:00:36 malka kernel: sdhci0: 3 slot(s) allocated
> > Aug 17 22:00:36 malka kernel: sdhci0: [ITHREAD]
> > 
> > That is form sdhci, mmc does not say anything at all. If I put a SD card
> inside the slot nothing happens - no message in dmesg, no device created in
> /dev. Seems that the mmc does not recognize the hw.
> > 
> > Lspci output is there:
> > 
> > 02:06.3 Mass storage controller: Texas Instruments PCIxx21 Integrated
> FlashMedia Controller
> > 	Subsystem: Hewlett-Packard Company Device 0944
> > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
> SERR- FastB2B- DisINTx-
> > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
> <MAbort- >SERR- <PERR- INTx-
> > 	Latency: 64 (1750ns min, 1000ns max), Cache Line Size: 64 bytes
> > 	Interrupt: pin B routed to IRQ 19
> > 	Region 0: Memory at d0102000 (32-bit, non-prefetchable)
> > 	Capabilities: [44] Power Management version 2
> > 		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
> > 		Status: D3 PME-Enable- DSel=0 DScale=0 PME-
> > 
> > 02:06.4 SD Host controller: Texas Instruments
> PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller
> > 	Subsystem: Hewlett-Packard Company Device 0944
> > 	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
> SERR- FastB2B- DisINTx+
> > 	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
> <MAbort- >SERR- <PERR- INTx-
> > 	Latency: 64 (1750ns min, 1000ns max), Cache Line Size: 64 bytes
> > 	Interrupt: pin C routed to IRQ 22
> > 	Region 0: Memory at d0104000 (32-bit, non-prefetchable)
> > 	Region 1: Memory at d0105000 (32-bit, non-prefetchable)
> > 	Region 2: Memory at d0106000 (32-bit, non-prefetchable)
> > 	Capabilities: [80] Power Management version 2
> > 		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
> > 		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
> > 
> > According to the entries in the driver the TI chipset is supported. I know the
> hardware is not broken, because it worked flawlessly under Linux. I have tried
> to play with hw.pci.do_power_resume and hw.pci_do_power_nodriver, but to no
> avail. Have I forgot something? Are there any dependencies that are not forced
> during compile time? I include full dmesg, lspci and kldstat.
> 
> TI chips have two incompatible controllers, supporting same card types. 
> Lack of activity on card insertion may mean that BIOS routes SD slot to 
> the FlashMedia, but not to the SD Controller. Linus either works via 
> FlashMedia Controller, as driver was made there, or it somehow reroutes 
> slot to the SD controller. I have no hardware to work on first part and 
> both hardware and specifications for the second. You may try Google to 
> find description of hack required for second solution, but it doesn't 
> works in some unknown cases.
> 
> -- 
> Alexander Motin
> _______________________________________________
> freebsd-mobile at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-mobile
> To unsubscribe, send any mail to "freebsd-mobile-unsubscribe at freebsd.org"
> 
> 
> 


More information about the freebsd-mobile mailing list