1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/serial_sci.h>
3 #include <linux/serial_core.h>
5 #include <cpu/serial.h>
7 #define SCPCR 0xA4000116
8 #define SCPDR 0xA4000136
10 static void sh770x_sci_init_pins(struct uart_port
*port
, unsigned int cflag
)
14 /* We need to set SCPCR to enable RTS/CTS */
15 data
= __raw_readw(SCPCR
);
16 /* Clear out SCP7MD1,0, SCP6MD1,0, SCP4MD1,0*/
17 __raw_writew(data
& 0x0fcf, SCPCR
);
19 if (!(cflag
& CRTSCTS
)) {
20 /* We need to set SCPCR to enable RTS/CTS */
21 data
= __raw_readw(SCPCR
);
22 /* Clear out SCP7MD1,0, SCP4MD1,0,
23 Set SCP6MD1,0 = {01} (output) */
24 __raw_writew((data
& 0x0fcf) | 0x1000, SCPCR
);
26 data
= __raw_readb(SCPDR
);
27 /* Set /RTS2 (bit6) = 0 */
28 __raw_writeb(data
& 0xbf, SCPDR
);
32 struct plat_sci_port_ops sh770x_sci_port_ops
= {
33 .init_pins
= sh770x_sci_init_pins
,