From: "Alexandros Kostopoulos" <akostop@inaccessnetworks.com>
To: linuxppc-dev@ozlabs.org
Subject: uart_cpm scc Rx problem after second open of the device
Date: Mon, 28 Aug 2006 17:04:16 +0300 [thread overview]
Message-ID: <op.tezypejhnhx3hy@draco> (raw)
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.
next reply other threads:[~2006-08-28 14:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-28 14:04 Alexandros Kostopoulos [this message]
2006-08-28 14:50 ` uart_cpm scc Rx problem after second open of the device Vitaly Bordug
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.tezypejhnhx3hy@draco \
--to=akostop@inaccessnetworks.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox