Skip to contentSkip to conversation

OMAP2430sdp MMC driver for 2.6.21

DISCUSSION 石洋 2 participants 2 messages Jul 23, 2007

lore
Share & tools
lore

石洋

author
#0 lore raw

Hi folks,

I'm doing on OMAP2430sdp MMC driver for 2.6.21.5. I based on minimal OMAP2430 patch on this mailing list and ported twl4030 GPIO and virtual busses drivers form 2.6.14.7. Now kernel works well on my board. I2C also works well on 2.6.21.5, following is I2C log message:

i2c_omap i2c_omap.2: bus 2 rev3.7 at 100 kHz
i2c_omap i2c_omap.1: bus 1 rev3.7 at 100 kHz
TWL4030: TRY attach Slave TWL4030-ID0 on Adapter OMAP I2C adapter[1][1]
TWL4030: TRY attach Slave TWL4030-ID1 on Adapter OMAP I2C adapter[1][1]
TWL4030: TRY attach Slave TWL4030-ID2 on Adapter OMAP I2C adapter[1][1]
TWL4030: TRY attach Slave TWL4030-ID3 on Adapter OMAP I2C adapter[1][1] TWL4030 Power Companion Active
TWL4030: Driver registration complete.

TWL4030 GPIO Demux: IRQ Range 329 to 338, Initialization Success

 56:          0        INTC  i2c_omap
 57:        130        INTC  i2c_omap

So I ported MMC driver from 2.6.14.7. New driver can initialize host coltroller successfully. It seems power supply, clocks and interrupt work well. Following is MMC log message:

Registering OMAP device 'omap2430-mmc12'. Parent at L3

mmc0: set_ios: clock 0Hz busmode 1 powermode 0 Vdd 0 Bus Width 0

Advanced Linux Sound Architecture Driver Version 1.0.14rc3 (Wed Mar 14 07:25:50 2007 UTC).
mmc0: set_ios: clock 0Hz busmode 1 powermode 1 Vdd 15 Bus Width 0
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 15 Bus Width 0
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 15 Bus Width 0
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 15 Bus Width 0
ALSA device list:

OMAP GPIO switch handler initializing
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 14 Bus Width 0
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 14 Bus Width 0
mmc0: set_ios: clock 400000Hz busmode 1 powermode 2 Vdd 14 Bus Width 0

 72:         74        INTC  serial
 83:        114        INTC  omap2430-mmc1
309:       2302        GPIO  eth0

There is a SD card in slot 1 on my board. But drvier can't detect this card. I printed SYSCTL, CAPA, CUR_CAPA and HCTL registers' values(SYSCTL is e0007. CAPA is 6e10080. CUR_CAPA is 0. HCTL is d00.), they are same as 2.6.14.7. And I enabled debug message for MMC driver. I found driver can send CMD1 command, but CMD1's reponse value always is 0x00ff8000. But according manual, the right reponse value should be 0x80ff8000. So CMD2 is always timeout. Following is the debug message:

...
mmc0: CMD1, argument 0x00300000

, 32-bit response,

Status in IRQ 1

mmc0: Response 00ff8000

mmc0: End request, err 0

mmc0: CMD1, argument 0x00300000

, 32-bit response,

Status in IRQ 1

mmc0: Response 00ff8000

mmc0: End request, err 0

mmc0: CMD2, argument 0x00000000

, 128-bit response, CRC

Status in IRQ 18000

mmc0: Response 00000000 00000000 00000000 00ff8000

mmc0: End request, err 1

mmc0: CMD2, argument 0x00000000

, 128-bit response, CRC

Status in IRQ 18000

mmc0: Response 00000000 00000000 00000000 00ff8000

mmc0: End request, err 1

mmc0: CMD2, argument 0x00000000

, 128-bit response, CRC

Status in IRQ 18000

mmc0: Response 00000000 00000000 00000000 00ff8000

mmc0: End request, err 1

mmc0: CMD2, argument 0x00000000
, 128-bit response, CRC

Status in IRQ 18000

mmc0: Response 00000000 00000000 00000000 00ff8000

mmc0: End request, err 1

mmc0: set_ios: clock 400000Hz busmode 2 powermode 2 Vdd 14 Bus Width 0

mmc0: set_ios: clock 0Hz busmode 1 powermode 0 Vdd 0 Bus Width 0

I suspected the root cause is not in MMC driver, maybe I forgot something else. So could anyone please give me some hints? Thanks.

Best Regards,
Yang Shi

《大 话 西 游 3》 首 届 玩 家 见 面 会 即 将 在 广 州 召 开!敬 请 关 注 >>

#1 lore raw
Quoted 9 lines

Hi folks,

I'm doing on OMAP2430sdp MMC driver for 2.6.21.5. I based on minimal OMAP2430 patch on this mailing list and ported twl4030 GPIO and virtual busses drivers form 2.6.14.7. Now kernel works well on my board. I2C also works well on 2.6.21.5, following is I2C log message:

mmc0: Response 00ff8000

Looks like your structure is corrupted, this value is default junk value. I was seeing this error with wrong INIT_WORK parameters, note that init_work parameters are changed now.

I suggest you to use twl and I2C drivers from OMAP GIT instead of porting it.

I have a working 2430 MMC code base for Latest OMAP GIT, I am in the process of adopting this to new data structures in include/asm/arch/mmc.h, some how not fitting in straight. But the attached code should work with minimal configuration. Need some cleanups before submitting for comments.

I have not validated SD but MMC is validated for sure. Should help you.

Regards,
Khasim