FL2440 2.6.28 SD卡驱动BUG解决
2015-09-27 12:59
288 查看
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);
}
在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);
}
相关文章推荐
- mysql 加锁 解锁 页表行锁
- 条款43:学习处理模板化基类内的名称
- java web.xml listener servlet 和filter加载顺序
- Linux那些事读书笔记
- Android实现向Launcher添加快捷方式的方法
- 输入子系统分析
- 检测到有潜在危险的 Request.Form 值
- 下列的式子成立,采用的是几进制表示的
- WIFI网卡使用分析
- Linux内核学习之编译篇
- 分层分离的总线驱动模型分析
- Top 20 Java Libries Used by Github's Most Popular Java Projects
- 每周一个算法(1)---倒排索引
- Android浏览器控件WebView简单小实例
- spring_150909_hibernate_id_table
- 测试11班中秋晚会圆满结束
- C/C++ 一元二次方程
- Android通过应用程序创建快捷方式的方法
- EOF
- v4l2框架分析