summaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/sh3/serial-sh770x.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-06-15 11:03:58 +0200
committerPaul Mundt <lethal@linux-sh.org>2011-06-15 11:03:58 +0200
commit1f83812d61de8c09ad6ab6be29e0ebd0817d16f1 (patch)
tree32cc463e07a5efd7ec4702df003780664f543d5c /arch/sh/kernel/cpu/sh3/serial-sh770x.c
parentsh, exec: remove redundant set_fs(USER_DS) (diff)
parentserial: sh-sci: Support generic SCLSR overrun detection. (diff)
downloadlinux-1f83812d61de8c09ad6ab6be29e0ebd0817d16f1.tar.xz
linux-1f83812d61de8c09ad6ab6be29e0ebd0817d16f1.zip
Merge branch 'common/serial-rework' into sh-latest
Diffstat (limited to 'arch/sh/kernel/cpu/sh3/serial-sh770x.c')
-rw-r--r--arch/sh/kernel/cpu/sh3/serial-sh770x.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh3/serial-sh770x.c b/arch/sh/kernel/cpu/sh3/serial-sh770x.c
new file mode 100644
index 000000000000..4f7242c676b3
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh3/serial-sh770x.c
@@ -0,0 +1,33 @@
+#include <linux/serial_sci.h>
+#include <linux/serial_core.h>
+#include <linux/io.h>
+#include <cpu/serial.h>
+
+#define SCPCR 0xA4000116
+#define SCPDR 0xA4000136
+
+static void sh770x_sci_init_pins(struct uart_port *port, unsigned int cflag)
+{
+ unsigned short data;
+
+ /* We need to set SCPCR to enable RTS/CTS */
+ data = __raw_readw(SCPCR);
+ /* Clear out SCP7MD1,0, SCP6MD1,0, SCP4MD1,0*/
+ __raw_writew(data & 0x0fcf, SCPCR);
+
+ if (!(cflag & CRTSCTS)) {
+ /* We need to set SCPCR to enable RTS/CTS */
+ data = __raw_readw(SCPCR);
+ /* Clear out SCP7MD1,0, SCP4MD1,0,
+ Set SCP6MD1,0 = {01} (output) */
+ __raw_writew((data & 0x0fcf) | 0x1000, SCPCR);
+
+ data = __raw_readb(SCPDR);
+ /* Set /RTS2 (bit6) = 0 */
+ __raw_writeb(data & 0xbf, SCPDR);
+ }
+}
+
+struct plat_sci_port_ops sh770x_sci_port_ops = {
+ .init_pins = sh770x_sci_init_pins,
+};