[U-Boot] Question about interrupt-driven mode duart on MPC837xE-rdb board.

shawn Bai programassem at hotmail.com
Sat Aug 13 17:33:15 CEST 2011


 
Hello, guys.
 
I have 2 questions about duart on MPC837xE-rdb board.
 
1. why not implement duart driver in interrupt-driven mode, in addition to polling-mode?
   
   from the existing implementation of uboot, I find there is only polling-mode duart driver.
 
2. According to requirements from upper application, interrupt-driven mode duart driver is needed to be implemented on our board.
 
   But, there is a question on which I have spent a whole Saturday, even so, it has not been worked out yet.
 
   DUART's basic paramenters, such as character's length, stop bits' length, odd or even parity, baudrate, are configured normally, and also FIFO mode.
 
   DUART is used in interrupt-driven mode, so both external interrupt(EE in MSR), and UART1 interrupt in IPIC module is enabled. And interrupt handler routine has already been connected with DUART hardware interrupt signal.
 
   When a block of data is needed to transmit, the address of that block of data will be passed to uart driver as the parameter of uart tx function, like uint32 uart_put_buf(uchar channel, uchar *buf, uint32 len). when run in uart_put_buf function,  interrupt THREI(transmitter holding register empty interrupt) is enabled first, then,the first data in that buf is written into uart transmitter holding register, like *((volatile uchar*)IMMRBAR + 0x4500 + 0x00) = *buf; in my opinion, the rest of datas is transmitted in interrupt handler routine when THREI interrupt happens.
 
   Here the question comes, after the first data in buf is written into uthr register, this character is displayed on the screen actually as we expect, things are going well until now, but there is no THREI interrupt signal which should be triggered by completion of the first data transmission. Because Interrupt handler routine can not be run, the rest of datas in buf cannot be transmitted.
 
   After transmission of the first data in buf, there is no vector in IPIC vector register, which indicates the highest priority interrupt pending, and also value of the interupt pending register is 0, which means there is no interrupt pending.
 
   What seems strange is the whole way interrupts will pass through is set as needed, EE in MSR, UART1 int in IPIC module, THREI int in DUART moduel, and the first data in buf is written into thr register, which will also bring the presence of THREI interrupt.
 
   But, why interrupt handler routine cannot be entered? 
 
   Are some main points missed?
 
   Could you give me some guidance?
 
   Any suggestion is welcome.
 
   Thanks a lot.
 
-Shawn
 
   
    		 	   		  


More information about the U-Boot mailing list