FL2440 2.6.28 SD卡驱动BUG解决

FL2440的2.6.28的内核,SD卡驱动默认是有问题的,

在linux-2.6.28.7/drivers/mmc/host目录的s3cmci.c文件的do_pio_write函数中做如下修改:

[cpp] view plaincopystatic void do_pio_write(struct s3cmci_host *host) 

void __iomem *to_ptr;

 int res; u32 fifo; u32 *ptr;

 to_ptr = host->base + host->sdidata; 

//while ((fifo = fifo_free(host))) 

while ((fifo = fifo_free(host))>3) 

//lqm changed from feiling FAE.11-01-19

 { 

if (!host->pio_bytes)

 { 

res = get_data_buffer(host, &host->pio_bytes,&host->pio_ptr); 

if (res)

 { 

dbg(host, dbg_pio,"pio_write(): complete (no more data)./n");

 host->pio_active =XFER_NONE; return; 

dbg(host, dbg_pio,"pio_write(): new source: [%i]@[%p]/n",host->pio_bytes, host->pio_ptr); 

/* If we have reached the end of the block, we have to * write exactly the remaining number of bytes. If we * in the middle of the block, we have to write full * words, so round down to an even multiple of 4. */ 

if (fifo >=host->pio_bytes)

 fifo = host->pio_bytes;

 else fifo -= fifo & 3; 

host->pio_bytes -= fifo; 

host->pio_count += fifo; 

fifo = (fifo + 3) >> 2; 

ptr = host->pio_ptr; 

while (fifo--) 

writel(*ptr++, to_ptr); 

host->pio_ptr = ptr;

 } 

enable_imask(host, S3C2410_SDIIMSK_TXFIFOHALF); 

}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值