Skip to content

Commit

Permalink
Merge tag 'tty-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
torvalds committed Apr 5, 2018
2 parents ac9053d + 4f79409 commit 9abf8ac
Show file tree
Hide file tree
Showing 53 changed files with 2,902 additions and 738 deletions.
1 change: 1 addition & 0 deletions Documentation/devicetree/bindings/serial/8250.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Required properties:
- "ti,da830-uart"
- "aspeed,ast2400-vuart"
- "aspeed,ast2500-vuart"
- "nuvoton,npcm750-uart"
- "serial" if the port type is unknown.
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Required properties:
- "renesas,hscif-r8a7796" for R8A7796 (R-Car M3-W) HSCIF compatible UART.
- "renesas,scif-r8a77970" for R8A77970 (R-Car V3M) SCIF compatible UART.
- "renesas,hscif-r8a77970" for R8A77970 (R-Car V3M) HSCIF compatible UART.
- "renesas,scif-r8a77980" for R8A77980 (R-Car V3H) SCIF compatible UART.
- "renesas,hscif-r8a77980" for R8A77980 (R-Car V3H) HSCIF compatible UART.
- "renesas,scif-r8a77995" for R8A77995 (R-Car D3) SCIF compatible UART.
- "renesas,hscif-r8a77995" for R8A77995 (R-Car D3) HSCIF compatible UART.
- "renesas,scifa-sh73a0" for SH73A0 (SH-Mobile AG5) SCIFA compatible UART.
Expand Down
2 changes: 2 additions & 0 deletions Documentation/devicetree/bindings/serial/st,stm32-usart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Required properties:
Optional properties:
- pinctrl: The reference on the pins configuration
- st,hw-flow-ctrl: bool flag to enable hardware flow control.
- rs485-rts-delay, rs485-rx-during-tx, rs485-rts-active-low,
linux,rs485-enabled-at-boot-time: see rs485.txt.
- dmas: phandle(s) to DMA controller node(s). Refer to stm32-dma.txt
- dma-names: "rx" and/or "tx"

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/stih407-b2120.dts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
compatible = "st,stih407-b2120", "st,stih407";

chosen {
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
bootargs = "clk_ignore_unused";
linux,stdout-path = &sbc_serial0;
};

Expand All @@ -24,7 +24,7 @@
};

aliases {
ttyAS0 = &sbc_serial0;
serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/stih410-b2120.dts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
compatible = "st,stih410-b2120", "st,stih410";

chosen {
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
bootargs = "clk_ignore_unused";
linux,stdout-path = &sbc_serial0;
};

Expand All @@ -24,7 +24,7 @@
};

aliases {
ttyAS0 = &sbc_serial0;
serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/stih410-b2260.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
compatible = "st,stih410-b2260", "st,stih410";

chosen {
bootargs = "console=ttyAS1,115200 clk_ignore_unused";
bootargs = "clk_ignore_unused";
linux,stdout-path = &uart1;
};

Expand All @@ -25,7 +25,7 @@
};

aliases {
ttyAS1 = &uart1;
serial1 = &uart1;
ethernet0 = &ethernet0;
};

Expand Down
4 changes: 2 additions & 2 deletions arch/arm/boot/dts/stih418-b2199.dts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
compatible = "st,stih418-b2199", "st,stih418";

chosen {
bootargs = "console=ttyAS0,115200 clk_ignore_unused";
bootargs = "clk_ignore_unused";
linux,stdout-path = &sbc_serial0;
};

Expand All @@ -24,7 +24,7 @@
};

aliases {
ttyAS0 = &sbc_serial0;
serial0 = &sbc_serial0;
ethernet0 = &ethernet0;
};

Expand Down
3 changes: 0 additions & 3 deletions drivers/parport/parport_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ static struct parport_pc_pci cards[] = {
/* sunix_2s1p */ { 1, { { 3, -1 }, } },
};

#define PCI_VENDOR_ID_SUNIX 0x1fd4
#define PCI_DEVICE_ID_SUNIX_1999 0x1999

static struct pci_device_id parport_serial_pci_tbl[] = {
/* PCI cards */
{ PCI_VENDOR_ID_TITAN, PCI_DEVICE_ID_TITAN_110L,
Expand Down
10 changes: 10 additions & 0 deletions drivers/tty/hvc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ config HVC_DCC
driver. This console is used through a JTAG only on ARM. If you don't have
a JTAG then you probably don't want this option.

config HVC_RISCV_SBI
bool "RISC-V SBI console support"
depends on RISCV
select HVC_DRIVER
help
This enables support for console output via RISC-V SBI calls, which
is normally used only during boot to output printk.

If you don't know what do to here, say Y.

config HVCS
tristate "IBM Hypervisor Virtual Console Server support"
depends on PPC_PSERIES && HVC_CONSOLE
Expand Down
1 change: 1 addition & 0 deletions drivers/tty/hvc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ obj-$(CONFIG_HVC_IRQ) += hvc_irq.o
obj-$(CONFIG_HVC_XEN) += hvc_xen.o
obj-$(CONFIG_HVC_IUCV) += hvc_iucv.o
obj-$(CONFIG_HVC_UDBG) += hvc_udbg.o
obj-$(CONFIG_HVC_RISCV_SBI) += hvc_riscv_sbi.o
obj-$(CONFIG_HVCS) += hvcs.o
60 changes: 60 additions & 0 deletions drivers/tty/hvc/hvc_riscv_sbi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright (C) 2008 David Gibson, IBM Corporation
* Copyright (C) 2012 Regents of the University of California
* Copyright (C) 2017 SiFive
*/

#include <linux/console.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/types.h>

#include <asm/sbi.h>

#include "hvc_console.h"

static int hvc_sbi_tty_put(uint32_t vtermno, const char *buf, int count)
{
int i;

for (i = 0; i < count; i++)
sbi_console_putchar(buf[i]);

return i;
}

static int hvc_sbi_tty_get(uint32_t vtermno, char *buf, int count)
{
int i, c;

for (i = 0; i < count; i++) {
c = sbi_console_getchar();
if (c < 0)
break;
buf[i] = c;
}

return i;
}

static const struct hv_ops hvc_sbi_ops = {
.get_chars = hvc_sbi_tty_get,
.put_chars = hvc_sbi_tty_put,
};

static int __init hvc_sbi_init(void)
{
return PTR_ERR_OR_ZERO(hvc_alloc(0, 0, &hvc_sbi_ops, 16));
}
device_initcall(hvc_sbi_init);

static int __init hvc_sbi_console_init(void)
{
hvc_instantiate(0, 0, &hvc_sbi_ops);
add_preferred_console("hvc", 0, NULL);

return 0;
}
console_initcall(hvc_sbi_console_init);
2 changes: 1 addition & 1 deletion drivers/tty/serdev/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ static struct bus_type serdev_bus_type = {
};

/**
* serdev_controller_alloc() - Allocate a new serdev device
* serdev_device_alloc() - Allocate a new serdev device
* @ctrl: associated controller
*
* Caller is responsible for either calling serdev_device_add() to add the
Expand Down
34 changes: 23 additions & 11 deletions drivers/tty/serial/8250/8250_dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* LCR is written whilst busy. If it is, then a busy detect interrupt is
* raised, the LCR needs to be rewritten and the uart status register read.
*/
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
Expand Down Expand Up @@ -119,10 +120,27 @@ static void dw8250_check_lcr(struct uart_port *p, int value)
*/
}

/* Returns once the transmitter is empty or we run out of retries */
static void dw8250_tx_wait_empty(struct uart_port *p, int tries)
{
unsigned int lsr;

while (tries--) {
lsr = readb (p->membase + (UART_LSR << p->regshift));
if (lsr & UART_LSR_TEMT)
break;
udelay (10);
}
}

static void dw8250_serial_out(struct uart_port *p, int offset, int value)
{
struct dw8250_data *d = p->private_data;

/* Allow the TX to drain before we reconfigure */
if (offset == UART_LCR)
dw8250_tx_wait_empty(p, 1000);

writeb(value, p->membase + (offset << p->regshift));

if (offset == UART_LCR && !d->uart_16550_compatible)
Expand Down Expand Up @@ -339,17 +357,11 @@ static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
p->serial_in = dw8250_serial_in32be;
p->serial_out = dw8250_serial_out32be;
}
} else if (has_acpi_companion(p->dev)) {
const struct acpi_device_id *id;

id = acpi_match_device(p->dev->driver->acpi_match_table,
p->dev);
if (id && !strcmp(id->id, "APMC0D08")) {
p->iotype = UPIO_MEM32;
p->regshift = 2;
p->serial_in = dw8250_serial_in32;
data->uart_16550_compatible = true;
}
} else if (acpi_dev_present("APMC0D08", NULL, -1)) {
p->iotype = UPIO_MEM32;
p->regshift = 2;
p->serial_in = dw8250_serial_in32;
data->uart_16550_compatible = true;
}

/* Platforms with iDMA */
Expand Down
Loading

0 comments on commit 9abf8ac

Please sign in to comment.