diff options
Diffstat (limited to 'drivers/serial/sh-sci.c')
| -rw-r--r-- | drivers/serial/sh-sci.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 68c7f6cfd728..42f3333c4ad0 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
| @@ -222,9 +222,9 @@ static inline void sci_init_pins(struct uart_port *port, unsigned int cflag) | |||
| 222 | Set SCP6MD1,0 = {01} (output) */ | 222 | Set SCP6MD1,0 = {01} (output) */ |
| 223 | __raw_writew((data & 0x0fcf) | 0x1000, SCPCR); | 223 | __raw_writew((data & 0x0fcf) | 0x1000, SCPCR); |
| 224 | 224 | ||
| 225 | data = ctrl_inb(SCPDR); | 225 | data = __raw_readb(SCPDR); |
| 226 | /* Set /RTS2 (bit6) = 0 */ | 226 | /* Set /RTS2 (bit6) = 0 */ |
| 227 | ctrl_outb(data & 0xbf, SCPDR); | 227 | __raw_writeb(data & 0xbf, SCPDR); |
| 228 | } | 228 | } |
| 229 | } | 229 | } |
| 230 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | 230 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) |
| @@ -897,11 +897,21 @@ static void sci_shutdown(struct uart_port *port) | |||
| 897 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, | 897 | static void sci_set_termios(struct uart_port *port, struct ktermios *termios, |
| 898 | struct ktermios *old) | 898 | struct ktermios *old) |
| 899 | { | 899 | { |
| 900 | unsigned int status, baud, smr_val; | 900 | unsigned int status, baud, smr_val, max_baud; |
| 901 | int t = -1; | 901 | int t = -1; |
| 902 | 902 | ||
| 903 | baud = uart_get_baud_rate(port, termios, old, 0, port->uartclk/16); | 903 | /* |
| 904 | if (likely(baud)) | 904 | * earlyprintk comes here early on with port->uartclk set to zero. |
| 905 | * the clock framework is not up and running at this point so here | ||
| 906 | * we assume that 115200 is the maximum baud rate. please note that | ||
| 907 | * the baud rate is not programmed during earlyprintk - it is assumed | ||
| 908 | * that the previous boot loader has enabled required clocks and | ||
| 909 | * setup the baud rate generator hardware for us already. | ||
| 910 | */ | ||
| 911 | max_baud = port->uartclk ? port->uartclk / 16 : 115200; | ||
| 912 | |||
| 913 | baud = uart_get_baud_rate(port, termios, old, 0, max_baud); | ||
| 914 | if (likely(baud && port->uartclk)) | ||
| 905 | t = SCBRR_VALUE(baud, port->uartclk); | 915 | t = SCBRR_VALUE(baud, port->uartclk); |
| 906 | 916 | ||
| 907 | do { | 917 | do { |
| @@ -1042,7 +1052,18 @@ static void __devinit sci_init_single(struct platform_device *dev, | |||
| 1042 | sci_port->port.ops = &sci_uart_ops; | 1052 | sci_port->port.ops = &sci_uart_ops; |
| 1043 | sci_port->port.iotype = UPIO_MEM; | 1053 | sci_port->port.iotype = UPIO_MEM; |
| 1044 | sci_port->port.line = index; | 1054 | sci_port->port.line = index; |
| 1045 | sci_port->port.fifosize = 1; | 1055 | |
| 1056 | switch (p->type) { | ||
| 1057 | case PORT_SCIFA: | ||
| 1058 | sci_port->port.fifosize = 64; | ||
| 1059 | break; | ||
| 1060 | case PORT_SCIF: | ||
| 1061 | sci_port->port.fifosize = 16; | ||
| 1062 | break; | ||
| 1063 | default: | ||
| 1064 | sci_port->port.fifosize = 1; | ||
| 1065 | break; | ||
| 1066 | } | ||
| 1046 | 1067 | ||
| 1047 | if (dev) { | 1068 | if (dev) { |
| 1048 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; | 1069 | sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; |
