Skip to content

Commit 9abf8ac

Browse files
committed
Merge tag 'tty-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial driver updates from Greg KH: "Here is the big set of tty and serial driver patches for 4.17-rc1 Not all that big really, most are just small fixes and additions to existing drivers. There's a bunch of work on the imx serial driver recently for some reason, and a new embedded serial driver added as well. Full details are in the shortlog. All of these have been in the linux-next tree for a while with no reported issues" * tag 'tty-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (66 commits) serial: expose buf_overrun count through proc interface serial: mvebu-uart: fix tx lost characters tty: serial: msm_geni_serial: Fix return value check in qcom_geni_serial_probe() tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP 8250-men-mcb: add support for 16z025 and 16z057 powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused serial: stm32: fix initialization of RS485 mode ARM: dts: STi: Remove "console=ttyASN" from bootargs for STi boards vt: change SGR 21 to follow the standards serdev: Fix typo in serdev_device_alloc ARM: dts: STi: Fix aliases property name for STi boards tty: st-asc: Update tty alias serial: stm32: add support for RS485 hardware control mode dt-bindings: serial: stm32: add RS485 optional properties selftests: add devpts selftests devpts: comment devpts_mntget() devpts: resolve devpts bind-mounts devpts: hoist out check for DEVPTS_SUPER_MAGIC serial: 8250: Add Nuvoton NPCM UART serial: mxs-auart: disable clks of Alphascale ASM9260 ...
2 parents ac9053d + 4f79409 commit 9abf8ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2902
-738
lines changed

Documentation/devicetree/bindings/serial/8250.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Required properties:
2424
- "ti,da830-uart"
2525
- "aspeed,ast2400-vuart"
2626
- "aspeed,ast2500-vuart"
27+
- "nuvoton,npcm750-uart"
2728
- "serial" if the port type is unknown.
2829
- reg : offset and length of the register set for the device.
2930
- interrupts : should contain uart interrupt.

Documentation/devicetree/bindings/serial/renesas,sci-serial.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Required properties:
4343
- "renesas,hscif-r8a7796" for R8A7796 (R-Car M3-W) HSCIF compatible UART.
4444
- "renesas,scif-r8a77970" for R8A77970 (R-Car V3M) SCIF compatible UART.
4545
- "renesas,hscif-r8a77970" for R8A77970 (R-Car V3M) HSCIF compatible UART.
46+
- "renesas,scif-r8a77980" for R8A77980 (R-Car V3H) SCIF compatible UART.
47+
- "renesas,hscif-r8a77980" for R8A77980 (R-Car V3H) HSCIF compatible UART.
4648
- "renesas,scif-r8a77995" for R8A77995 (R-Car D3) SCIF compatible UART.
4749
- "renesas,hscif-r8a77995" for R8A77995 (R-Car D3) HSCIF compatible UART.
4850
- "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART.

Documentation/devicetree/bindings/serial/st,stm32-usart.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Required properties:
1515
Optional properties:
1616
- pinctrl: The reference on the pins configuration
1717
- st,hw-flow-ctrl: bool flag to enable hardware flow control.
18+
- rs485-rts-delay, rs485-rx-during-tx, rs485-rts-active-low,
19+
linux,rs485-enabled-at-boot-time: see rs485.txt.
1820
- dmas: phandle(s) to DMA controller node(s). Refer to stm32-dma.txt
1921
- dma-names: "rx" and/or "tx"
2022

arch/arm/boot/dts/stih407-b2120.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
compatible = "st,stih407-b2120", "st,stih407";
1515

1616
chosen {
17-
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
17+
bootargs = "clk_ignore_unused";
1818
linux,stdout-path = &sbc_serial0;
1919
};
2020

@@ -24,7 +24,7 @@
2424
};
2525

2626
aliases {
27-
ttyAS0 = &sbc_serial0;
27+
serial0 = &sbc_serial0;
2828
ethernet0 = &ethernet0;
2929
};
3030

arch/arm/boot/dts/stih410-b2120.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
compatible = "st,stih410-b2120", "st,stih410";
1515

1616
chosen {
17-
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
17+
bootargs = "clk_ignore_unused";
1818
linux,stdout-path = &sbc_serial0;
1919
};
2020

@@ -24,7 +24,7 @@
2424
};
2525

2626
aliases {
27-
ttyAS0 = &sbc_serial0;
27+
serial0 = &sbc_serial0;
2828
ethernet0 = &ethernet0;
2929
};
3030

arch/arm/boot/dts/stih410-b2260.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
compatible = "st,stih410-b2260", "st,stih410";
1616

1717
chosen {
18-
bootargs = "console=ttyAS1,115200 clk_ignore_unused";
18+
bootargs = "clk_ignore_unused";
1919
linux,stdout-path = &uart1;
2020
};
2121

@@ -25,7 +25,7 @@
2525
};
2626

2727
aliases {
28-
ttyAS1 = &uart1;
28+
serial1 = &uart1;
2929
ethernet0 = &ethernet0;
3030
};
3131

arch/arm/boot/dts/stih418-b2199.dts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
compatible = "st,stih418-b2199", "st,stih418";
1515

1616
chosen {
17-
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
17+
bootargs = "clk_ignore_unused";
1818
linux,stdout-path = &sbc_serial0;
1919
};
2020

@@ -24,7 +24,7 @@
2424
};
2525

2626
aliases {
27-
ttyAS0 = &sbc_serial0;
27+
serial0 = &sbc_serial0;
2828
ethernet0 = &ethernet0;
2929
};
3030

drivers/parport/parport_serial.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,6 @@ static struct parport_pc_pci cards[] = {
156156
/* sunix_2s1p */ { 1, { { 3, -1 }, } },
157157
};
158158

159-
#define PCI_VENDOR_ID_SUNIX 0x1fd4
160-
#define PCI_DEVICE_ID_SUNIX_1999 0x1999
161-
162159
static struct pci_device_id parport_serial_pci_tbl[] = {
163160
/* PCI cards */
164161
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_110L,

drivers/tty/hvc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ config HVC_DCC
8888
driver. This console is used through a JTAG only on ARM. If you don't have
8989
a JTAG then you probably don't want this option.
9090

91+
config HVC_RISCV_SBI
92+
bool "RISC-V SBI console support"
93+
depends on RISCV
94+
select HVC_DRIVER
95+
help
96+
This enables support for console output via RISC-V SBI calls, which
97+
is normally used only during boot to output printk.
98+
99+
If you don't know what do to here, say Y.
100+
91101
config HVCS
92102
tristate "IBM Hypervisor Virtual Console Server support"
93103
depends on PPC_PSERIES && HVC_CONSOLE

drivers/tty/hvc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ obj-$(CONFIG_HVC_IRQ) += hvc_irq.o
99
obj-$(CONFIG_HVC_XEN) += hvc_xen.o
1010
obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o
1111
obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o
12+
obj-$(CONFIG_HVC_RISCV_SBI) += hvc_riscv_sbi.o
1213
obj-$(CONFIG_HVCS) += hvcs.o

drivers/tty/hvc/hvc_riscv_sbi.c

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Copyright (C) 2008 David Gibson, IBM Corporation
4+
* Copyright (C) 2012 Regents of the University of California
5+
* Copyright (C) 2017 SiFive
6+
*/
7+
8+
#include <linux/console.h>
9+
#include <linux/err.h>
10+
#include <linux/init.h>
11+
#include <linux/moduleparam.h>
12+
#include <linux/types.h>
13+
14+
#include <asm/sbi.h>
15+
16+
#include "hvc_console.h"
17+
18+
static int hvc_sbi_tty_put(uint32_t vtermno, const char *buf, int count)
19+
{
20+
int i;
21+
22+
for (i = 0; i < count; i++)
23+
sbi_console_putchar(buf[i]);
24+
25+
return i;
26+
}
27+
28+
static int hvc_sbi_tty_get(uint32_t vtermno, char *buf, int count)
29+
{
30+
int i, c;
31+
32+
for (i = 0; i < count; i++) {
33+
c = sbi_console_getchar();
34+
if (c < 0)
35+
break;
36+
buf[i] = c;
37+
}
38+
39+
return i;
40+
}
41+
42+
static const struct hv_ops hvc_sbi_ops = {
43+
.get_chars = hvc_sbi_tty_get,
44+
.put_chars = hvc_sbi_tty_put,
45+
};
46+
47+
static int __init hvc_sbi_init(void)
48+
{
49+
return PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_ops, 16));
50+
}
51+
device_initcall(hvc_sbi_init);
52+
53+
static int __init hvc_sbi_console_init(void)
54+
{
55+
hvc_instantiate(0, 0, &hvc_sbi_ops);
56+
add_preferred_console("hvc", 0, NULL);
57+
58+
return 0;
59+
}
60+
console_initcall(hvc_sbi_console_init);

drivers/tty/serdev/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ static struct bus_type serdev_bus_type = {
350350
};
351351

352352
/**
353-
* serdev_controller_alloc() - Allocate a new serdev device
353+
* serdev_device_alloc() - Allocate a new serdev device
354354
* @ctrl: associated controller
355355
*
356356
* Caller is responsible for either calling serdev_device_add() to add the

drivers/tty/serial/8250/8250_dw.c

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* LCR is written whilst busy. If it is, then a busy detect interrupt is
1010
* raised, the LCR needs to be rewritten and the uart status register read.
1111
*/
12+
#include <linux/delay.h>
1213
#include <linux/device.h>
1314
#include <linux/io.h>
1415
#include <linux/module.h>
@@ -119,10 +120,27 @@ static void dw8250_check_lcr(struct uart_port *p, int value)
119120
*/
120121
}
121122

123+
/* Returns once the transmitter is empty or we run out of retries */
124+
static void dw8250_tx_wait_empty(struct uart_port *p, int tries)
125+
{
126+
unsigned int lsr;
127+
128+
while (tries--) {
129+
lsr = readb (p->membase + (UART_LSR << p->regshift));
130+
if (lsr & UART_LSR_TEMT)
131+
break;
132+
udelay (10);
133+
}
134+
}
135+
122136
static void dw8250_serial_out(struct uart_port *p, int offset, int value)
123137
{
124138
struct dw8250_data *d = p->private_data;
125139

140+
/* Allow the TX to drain before we reconfigure */
141+
if (offset == UART_LCR)
142+
dw8250_tx_wait_empty(p, 1000);
143+
126144
writeb(value, p->membase + (offset << p->regshift));
127145

128146
if (offset == UART_LCR && !d->uart_16550_compatible)
@@ -339,17 +357,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
339357
p->serial_in = dw8250_serial_in32be;
340358
p->serial_out = dw8250_serial_out32be;
341359
}
342-
} else if (has_acpi_companion(p->dev)) {
343-
const struct acpi_device_id *id;
344-
345-
id = acpi_match_device(p->dev->driver->acpi_match_table,
346-
p->dev);
347-
if (id && !strcmp(id->id, "APMC0D08")) {
348-
p->iotype = UPIO_MEM32;
349-
p->regshift = 2;
350-
p->serial_in = dw8250_serial_in32;
351-
data->uart_16550_compatible = true;
352-
}
360+
} else if (acpi_dev_present("APMC0D08", NULL, -1)) {
361+
p->iotype = UPIO_MEM32;
362+
p->regshift = 2;
363+
p->serial_in = dw8250_serial_in32;
364+
data->uart_16550_compatible = true;
353365
}
354366

355367
/* Platforms with iDMA */

0 commit comments

Comments
 (0)