当前时区 GMT+8, 现在时间是 2008-5-17 15:14 游客: 注册 登录 仅登录论坛 | 搜索 帮助


标题: skyeye中的44b0x uart驱动错误
yymusic
新手上路
Rank: 1


UID 8703
精华 0
积分 62
帖子 48
阅读权限 10
注册 2002-12-20
来自 China
状态 离线
发表于 2008-1-23 13:32  资料  短消息  加为好友 
skyeye中的44b0x uart驱动错误

最近一直在搞用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 编辑 ]

顶部
ksh
高级会员
Rank: 4


UID 92875
精华 1
积分 1447
帖子 736
阅读权限 50
注册 2004-2-4
来自 China
状态 离线
发表于 2008-1-26 20:14  资料  短消息  加为好友  添加 ksh 为MSN好友 通过MSN和 ksh 交谈
You are right. Most of simulation probably only support interrupt mode of uart.

顶部
AnthonyLee
注册会员
Rank: 2


UID 2903
精华 0
积分 222
帖子 96
阅读权限 20
注册 2002-9-28
状态 离线
发表于 2008-1-31 04:38  资料  短消息  加为好友 
回复 #1 yymusic 的帖子

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

顶部
yymusic
新手上路
Rank: 1


UID 8703
精华 0
积分 62
帖子 48
阅读权限 10
注册 2002-12-20
来自 China
状态 离线
发表于 2008-1-31 14:58  资料  短消息  加为好友 
呵呵,tks!

顶部
 


Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
清除 Cookies - 联系我们 - 中国Linux公社 - WAP