LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* uart_cpm scc Rx problem after second open of the device
@ 2006-08-28 14:04 Alexandros Kostopoulos
  2006-08-28 14:50 ` Vitaly Bordug
  0 siblings, 1 reply; 2+ messages in thread
From: Alexandros Kostopoulos @ 2006-08-28 14:04 UTC (permalink / raw)
  To: linuxppc-dev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-28 14:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-28 14:04 uart_cpm scc Rx problem after second open of the device Alexandros Kostopoulos
2006-08-28 14:50 ` Vitaly Bordug

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox