QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1453|回复: 3

skyeye中的44b0x uart驱动错误

[复制链接]
发表于 2008-1-23 13:32:04 | 显示全部楼层 |阅读模式
最近一直在搞用skyeye模拟44b0x跑uclinux,发现一些问题,在arm板上跑的好好的,可到skyeye上就有些问题。其中uart有个问题,就是输入的字符不会回显,要uclinux主动打印信息时,才会打点出来。查看skyeye的44b0x驱动发现,有些问题。
1、当从uart收到字符时,只更新了UFSTAT中的Rx FIFO Count而没有更新UTRSTAT中的Receive buffer data ready位。
2、关于Tx中断就更奇怪了,Tx中断有下面两种情况:
     1)、0 = Pulse (Interrupt is requested the instant Tx buffer becomes empty)
     2)、1 = Level (Interrupt is requested while Tx buffer is empty)

说白了,都是针对Tx FIFO 为空的情况下发interrupt的,可skyeye里。
            while ((count = ((*pUfstat & 0xf0) >> 4)) > 0 && (*pUcon & 0xc) != 0x0) { /* handling TX FIFO */
        if (pUfifo->txcnt > 0) {
          pUfifo->txcnt -= 1;
          break;
        }
                                       
        if (*pUfstat & 0x200) count++;
        tmp_count = skyeye_uart_write(read_uart0 ? 0 : 1, &pUfifo->tx[0], count, NULL);
        if (tmp_count <= 0) break;
                                       
        count -= tmp_count;
                                       
        *pUfstat &= ~0x2f0;
        if (count > 0) {
          *pUfstat |= (count << 4);
          memmove(&pUfifo->tx[0], &pUfifo->tx[tmp_count], (size_t)count);
        } else {
          pUfifo->txcnt = 64;
        }
        /* Transmit Mode: Interrupt request or polling mode */
                                       
        if ((*pUcon & 0xc) == 0x4) {
          s3c44b0x_set_interrupt(read_uart0 ? INT_UTXD0 : INT_UTXD1);
        }
             }

其中first就用Tx FIFO中的数据个数做条件,那FIFO个数为0时,根本就不会进去,也就更不会发empty中断了啊!也更没有分上面的两种情况分别发中断。
希望skyeye越来越完整,稳定。

[ 本帖最后由 yymusic 于 2008-1-23 13:41 编辑 ]
发表于 2008-1-26 20:14:18 | 显示全部楼层
You are right. Most of simulation probably only support interrupt mode of uart.
回复

使用道具 举报

发表于 2008-1-31 04:38:26 | 显示全部楼层

回复 #1 yymusic 的帖子

I will check it once I'm free, thanks.
回复

使用道具 举报

 楼主| 发表于 2008-1-31 14:58:38 | 显示全部楼层
呵呵,tks!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-11 03:15 , Processed in 0.097591 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表