uart_cpm scc Rx problem after second open of the device

2 messages, 2 authors, 2006-08-28 · open the first message on its own page

uart_cpm scc Rx problem after second open of the device

From: Alexandros Kostopoulos <hidden>
Date: 2006-08-28 14:24:34

I experienced a problem with the cpm_uart scc driver (kernel version  =

2.6.13) while running the driver for a serial port NOT configured as a  =

console.
The problem is as follows:
The first time the device (/dev/ttyCPM0) is opened, everything works ok.=
  =

The second time, however, the device is opened, receive does not work. T=
he  =

device can only transmit, but doesn't receive anything.

Well, by looking into the code, I found out that the ENR (Receiver enabl=
e)  =

bit of the GSMR-L register is only set in cpm_uart_init_scc and NOT in
cpm_uart_startup, as I think it should. Then, the bit is cleared on  =

cpm_uart_shutdown. Thus, the first time the device is opened, the bit is=
  =

set (and so, the device normally receives data), but the second time the=
  =

device is opened, the bit is NOT set and the device cannot receive  =

anything from the serial port.

The diff of my code against the original 2.6.13 code follows (although i=
  =

saw that the 2.6.17 code is exactly the same as far as the ENR bit is
concerned):

Index: cpm_uart_core.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- cpm_uart_core.c     (revision 79)
+++ cpm_uart_core.c     (revision 105)
@@ -393,6 +393,7 @@
                 pinfo->smcp->smc_smcm |=3D SMCM_RX;
                 pinfo->smcp->smc_smcmr |=3D SMCMR_REN;
         } else {
+        pinfo->sccp->scc_gsmrl |=3D (SCC_GSMRL_ENR);
                 pinfo->sccp->scc_sccm |=3D UART_SCCM_RX;
         }

Am I missing something here?

Thanks for any comments,
Alex.

Re: uart_cpm scc Rx problem after second open of the device

From: Vitaly Bordug <hidden>
Date: 2006-08-28 14:50:24

On Mon, 28 Aug 2006 17:04:16 +0300
"Alexandros Kostopoulos" [off-list ref] wrote:
I experienced a problem with the cpm_uart scc driver (kernel version  
2.6.13) while running the driver for a serial port NOT configured as a  
console.
The problem is as follows:
The first time the device (/dev/ttyCPM0) is opened, everything works ok.  
The second time, however, the device is opened, receive does not work. The  
device can only transmit, but doesn't receive anything.
I'm recalling to fix it a while ago (later than .14 though). There were not just the line below,
but you cant find the respective stuff on the line (linuxppc-embedded) archive/ kernel git.



-- 
Sincerely, 
Vitaly
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help