aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-21 12:33:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-21 12:33:10 -0400
commit41d5e08ea86af3359239d5a6f7021cdc61beaa49 (patch)
tree58ad584b29d097dfa3b5d7bc5e61370d676610a9 /include
parent8d582b94291b40dbb5961f99172ee8ebfafd4c9c (diff)
parent5dbc32a88f1e73f244e6134fc119dd4d60a398c0 (diff)
Merge tag 'tty-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH: "Here's the big tty/serial driver update for 4.1-rc1. It was delayed for a bit due to some questions surrounding some of the console command line parsing changes that are in here. There's still one tiny regression for people who were previously putting multiple console command lines and expecting them all to be ignored for some odd reason, but Peter is working on fixing that. If not, I'll send a revert for the offending patch, but I have faith that Peter can address it. Other than the console work here, there's the usual serial driver updates and changes, and a buch of 8250 reworks to try to make that driver easier to maintain over time, and have it support more devices in the future. All of these have been in linux-next for a while" * tag 'tty-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (119 commits) n_gsm: Drop unneeded cast on netdev_priv sc16is7xx: expose RTS inversion in RS-485 mode serial: 8250_pci: port failed after wakeup from S3 earlycon: 8250: Document kernel command line options earlycon: 8250: Fix command line regression earlycon: Fix __earlycon_table stride tty: clean up the tty time logic a bit serial: 8250_dw: only get the clock rate in one place serial: 8250_dw: remove useless ACPI ID check dmaengine: hsu: move memory allocation to GFP_NOWAIT dmaengine: hsu: remove redundant pieces of code serial: 8250_pci: add Intel Tangier support dmaengine: hsu: add Intel Tangier PCI ID serial: 8250_pci: replace switch-case by formula for Intel MID serial: 8250_pci: replace switch-case by formula tty: cpm_uart: replace CONFIG_8xx by CONFIG_CPM1 serial: jsm: some off by one bugs serial: xuartps: Fix check in console_setup(). serial: xuartps: Get rid of register access macros. serial: xuartps: Fix iobase use. ...
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h9
-rw-r--r--include/linux/console.h3
-rw-r--r--include/linux/dma/hsu.h48
-rw-r--r--include/linux/platform_data/dma-hsu.h25
-rw-r--r--include/linux/platform_data/msm_serial_hs.h49
-rw-r--r--include/linux/platform_data/serial-imx.h5
-rw-r--r--include/linux/serial_8250.h20
-rw-r--r--include/linux/serial_core.h23
-rw-r--r--include/linux/serial_mfd.h47
-rw-r--r--include/uapi/linux/serial_reg.h19
10 files changed, 115 insertions, 133 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 5c48c58514e5..8bd374d3cf21 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -153,6 +153,14 @@
153#define TRACE_SYSCALLS() 153#define TRACE_SYSCALLS()
154#endif 154#endif
155 155
156#ifdef CONFIG_SERIAL_EARLYCON
157#define EARLYCON_TABLE() STRUCT_ALIGN(); \
158 VMLINUX_SYMBOL(__earlycon_table) = .; \
159 *(__earlycon_table) \
160 *(__earlycon_table_end)
161#else
162#define EARLYCON_TABLE()
163#endif
156 164
157#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name) 165#define ___OF_TABLE(cfg, name) _OF_TABLE_##cfg(name)
158#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name) 166#define __OF_TABLE(cfg, name) ___OF_TABLE(cfg, name)
@@ -508,6 +516,7 @@
508 CPUIDLE_METHOD_OF_TABLES() \ 516 CPUIDLE_METHOD_OF_TABLES() \
509 KERNEL_DTB() \ 517 KERNEL_DTB() \
510 IRQCHIP_OF_MATCH_TABLE() \ 518 IRQCHIP_OF_MATCH_TABLE() \
519 EARLYCON_TABLE() \
511 EARLYCON_OF_TABLES() 520 EARLYCON_OF_TABLES()
512 521
513#define INIT_TEXT \ 522#define INIT_TEXT \
diff --git a/include/linux/console.h b/include/linux/console.h
index 7571a16bd653..9f50fb413c11 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -123,7 +123,7 @@ struct console {
123 struct tty_driver *(*device)(struct console *, int *); 123 struct tty_driver *(*device)(struct console *, int *);
124 void (*unblank)(void); 124 void (*unblank)(void);
125 int (*setup)(struct console *, char *); 125 int (*setup)(struct console *, char *);
126 int (*early_setup)(void); 126 int (*match)(struct console *, char *name, int idx, char *options);
127 short flags; 127 short flags;
128 short index; 128 short index;
129 int cflag; 129 int cflag;
@@ -141,7 +141,6 @@ extern int console_set_on_cmdline;
141extern struct console *early_console; 141extern struct console *early_console;
142 142
143extern int add_preferred_console(char *name, int idx, char *options); 143extern int add_preferred_console(char *name, int idx, char *options);
144extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
145extern void register_console(struct console *); 144extern void register_console(struct console *);
146extern int unregister_console(struct console *); 145extern int unregister_console(struct console *);
147extern struct console *console_drivers; 146extern struct console *console_drivers;
diff --git a/include/linux/dma/hsu.h b/include/linux/dma/hsu.h
new file mode 100644
index 000000000000..234393a6997b
--- /dev/null
+++ b/include/linux/dma/hsu.h
@@ -0,0 +1,48 @@
1/*
2 * Driver for the High Speed UART DMA
3 *
4 * Copyright (C) 2015 Intel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _DMA_HSU_H
12#define _DMA_HSU_H
13
14#include <linux/device.h>
15#include <linux/interrupt.h>
16
17#include <linux/platform_data/dma-hsu.h>
18
19struct hsu_dma;
20
21/**
22 * struct hsu_dma_chip - representation of HSU DMA hardware
23 * @dev: struct device of the DMA controller
24 * @irq: irq line
25 * @regs: memory mapped I/O space
26 * @length: I/O space length
27 * @offset: offset of the I/O space where registers are located
28 * @hsu: struct hsu_dma that is filed by ->probe()
29 * @pdata: platform data for the DMA controller if provided
30 */
31struct hsu_dma_chip {
32 struct device *dev;
33 int irq;
34 void __iomem *regs;
35 unsigned int length;
36 unsigned int offset;
37 struct hsu_dma *hsu;
38 struct hsu_dma_platform_data *pdata;
39};
40
41/* Export to the internal users */
42irqreturn_t hsu_dma_irq(struct hsu_dma_chip *chip, unsigned short nr);
43
44/* Export to the platform drivers */
45int hsu_dma_probe(struct hsu_dma_chip *chip);
46int hsu_dma_remove(struct hsu_dma_chip *chip);
47
48#endif /* _DMA_HSU_H */
diff --git a/include/linux/platform_data/dma-hsu.h b/include/linux/platform_data/dma-hsu.h
new file mode 100644
index 000000000000..8a1f6a4920b2
--- /dev/null
+++ b/include/linux/platform_data/dma-hsu.h
@@ -0,0 +1,25 @@
1/*
2 * Driver for the High Speed UART DMA
3 *
4 * Copyright (C) 2015 Intel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _PLATFORM_DATA_DMA_HSU_H
12#define _PLATFORM_DATA_DMA_HSU_H
13
14#include <linux/device.h>
15
16struct hsu_dma_slave {
17 struct device *dma_dev;
18 int chan_id;
19};
20
21struct hsu_dma_platform_data {
22 unsigned short nr_channels;
23};
24
25#endif /* _PLATFORM_DATA_DMA_HSU_H */
diff --git a/include/linux/platform_data/msm_serial_hs.h b/include/linux/platform_data/msm_serial_hs.h
deleted file mode 100644
index 98a2046f8b31..000000000000
--- a/include/linux/platform_data/msm_serial_hs.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright (C) 2008 Google, Inc.
3 * Author: Nick Pelly <npelly@google.com>
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __ASM_ARCH_MSM_SERIAL_HS_H
16#define __ASM_ARCH_MSM_SERIAL_HS_H
17
18#include <linux/serial_core.h>
19
20/* API to request the uart clock off or on for low power management
21 * Clients should call request_clock_off() when no uart data is expected,
22 * and must call request_clock_on() before any further uart data can be
23 * received. */
24extern void msm_hs_request_clock_off(struct uart_port *uport);
25extern void msm_hs_request_clock_on(struct uart_port *uport);
26
27/**
28 * struct msm_serial_hs_platform_data
29 * @rx_wakeup_irq: Rx activity irq
30 * @rx_to_inject: extra character to be inserted to Rx tty on wakeup
31 * @inject_rx: 1 = insert rx_to_inject. 0 = do not insert extra character
32 * @exit_lpm_cb: function called before every Tx transaction
33 *
34 * This is an optional structure required for UART Rx GPIO IRQ based
35 * wakeup from low power state. UART wakeup can be triggered by RX activity
36 * (using a wakeup GPIO on the UART RX pin). This should only be used if
37 * there is not a wakeup GPIO on the UART CTS, and the first RX byte is
38 * known (eg., with the Bluetooth Texas Instruments HCILL protocol),
39 * since the first RX byte will always be lost. RTS will be asserted even
40 * while the UART is clocked off in this mode of operation.
41 */
42struct msm_serial_hs_platform_data {
43 int rx_wakeup_irq;
44 unsigned char inject_rx_on_wakeup;
45 char rx_to_inject;
46 void (*exit_lpm_cb)(struct uart_port *);
47};
48
49#endif
diff --git a/include/linux/platform_data/serial-imx.h b/include/linux/platform_data/serial-imx.h
index 3cc2e3c40914..a938eba2f18e 100644
--- a/include/linux/platform_data/serial-imx.h
+++ b/include/linux/platform_data/serial-imx.h
@@ -20,14 +20,9 @@
20#define ASMARM_ARCH_UART_H 20#define ASMARM_ARCH_UART_H
21 21
22#define IMXUART_HAVE_RTSCTS (1<<0) 22#define IMXUART_HAVE_RTSCTS (1<<0)
23#define IMXUART_IRDA (1<<1)
24 23
25struct imxuart_platform_data { 24struct imxuart_platform_data {
26 unsigned int flags; 25 unsigned int flags;
27 void (*irda_enable)(int enable);
28 unsigned int irda_inv_rx:1;
29 unsigned int irda_inv_tx:1;
30 unsigned short transceiver_delay;
31}; 26};
32 27
33#endif 28#endif
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index a8efa235b7c1..78097e7a330a 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -60,6 +60,20 @@ enum {
60}; 60};
61 61
62struct uart_8250_dma; 62struct uart_8250_dma;
63struct uart_8250_port;
64
65/**
66 * 8250 core driver operations
67 *
68 * @setup_irq() Setup irq handling. The universal 8250 driver links this
69 * port to the irq chain. Other drivers may @request_irq().
70 * @release_irq() Undo irq handling. The universal 8250 driver unlinks
71 * the port from the irq chain.
72 */
73struct uart_8250_ops {
74 int (*setup_irq)(struct uart_8250_port *);
75 void (*release_irq)(struct uart_8250_port *);
76};
63 77
64/* 78/*
65 * This should be used by drivers which want to register 79 * This should be used by drivers which want to register
@@ -88,6 +102,8 @@ struct uart_8250_port {
88 unsigned char canary; /* non-zero during system sleep 102 unsigned char canary; /* non-zero during system sleep
89 * if no_console_suspend 103 * if no_console_suspend
90 */ 104 */
105 unsigned char probe;
106#define UART_PROBE_RSA (1 << 0)
91 107
92 /* 108 /*
93 * Some bits in registers are cleared on a read, so they must 109 * Some bits in registers are cleared on a read, so they must
@@ -100,6 +116,7 @@ struct uart_8250_port {
100 unsigned char msr_saved_flags; 116 unsigned char msr_saved_flags;
101 117
102 struct uart_8250_dma *dma; 118 struct uart_8250_dma *dma;
119 const struct uart_8250_ops *ops;
103 120
104 /* 8250 specific callbacks */ 121 /* 8250 specific callbacks */
105 int (*dl_read)(struct uart_8250_port *); 122 int (*dl_read)(struct uart_8250_port *);
@@ -118,11 +135,8 @@ void serial8250_resume_port(int line);
118 135
119extern int early_serial_setup(struct uart_port *port); 136extern int early_serial_setup(struct uart_port *port);
120 137
121extern int serial8250_find_port(struct uart_port *p);
122extern int serial8250_find_port_for_earlycon(void);
123extern unsigned int serial8250_early_in(struct uart_port *port, int offset); 138extern unsigned int serial8250_early_in(struct uart_port *port, int offset);
124extern void serial8250_early_out(struct uart_port *port, int offset, int value); 139extern void serial8250_early_out(struct uart_port *port, int offset, int value);
125extern int setup_early_serial8250_console(char *cmdline);
126extern void serial8250_do_set_termios(struct uart_port *port, 140extern void serial8250_do_set_termios(struct uart_port *port,
127 struct ktermios *termios, struct ktermios *old); 141 struct ktermios *termios, struct ktermios *old);
128extern int serial8250_do_startup(struct uart_port *port); 142extern int serial8250_do_startup(struct uart_port *port);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index d10965f0d8a4..025dad9dcde4 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -235,7 +235,9 @@ struct uart_port {
235 const struct uart_ops *ops; 235 const struct uart_ops *ops;
236 unsigned int custom_divisor; 236 unsigned int custom_divisor;
237 unsigned int line; /* port index */ 237 unsigned int line; /* port index */
238 unsigned int minor;
238 resource_size_t mapbase; /* for ioremap */ 239 resource_size_t mapbase; /* for ioremap */
240 resource_size_t mapsize;
239 struct device *dev; /* parent device */ 241 struct device *dev; /* parent device */
240 unsigned char hub6; /* this should be in the 8250 driver */ 242 unsigned char hub6; /* this should be in the 8250 driver */
241 unsigned char suspended; 243 unsigned char suspended;
@@ -336,24 +338,29 @@ struct earlycon_device {
336 char options[16]; /* e.g., 115200n8 */ 338 char options[16]; /* e.g., 115200n8 */
337 unsigned int baud; 339 unsigned int baud;
338}; 340};
339int setup_earlycon(char *buf, const char *match,
340 int (*setup)(struct earlycon_device *, const char *));
341 341
342struct earlycon_id {
343 char name[16];
344 int (*setup)(struct earlycon_device *, const char *options);
345} __aligned(32);
346
347extern int setup_earlycon(char *buf);
342extern int of_setup_earlycon(unsigned long addr, 348extern int of_setup_earlycon(unsigned long addr,
343 int (*setup)(struct earlycon_device *, const char *)); 349 int (*setup)(struct earlycon_device *, const char *));
344 350
345#define EARLYCON_DECLARE(name, func) \ 351#define EARLYCON_DECLARE(_name, func) \
346static int __init name ## _setup_earlycon(char *buf) \ 352 static const struct earlycon_id __earlycon_##_name \
347{ \ 353 __used __section(__earlycon_table) \
348 return setup_earlycon(buf, __stringify(name), func); \ 354 = { .name = __stringify(_name), \
349} \ 355 .setup = func }
350early_param("earlycon", name ## _setup_earlycon);
351 356
352#define OF_EARLYCON_DECLARE(name, compat, fn) \ 357#define OF_EARLYCON_DECLARE(name, compat, fn) \
353 _OF_DECLARE(earlycon, name, compat, fn, void *) 358 _OF_DECLARE(earlycon, name, compat, fn, void *)
354 359
355struct uart_port *uart_get_console(struct uart_port *ports, int nr, 360struct uart_port *uart_get_console(struct uart_port *ports, int nr,
356 struct console *c); 361 struct console *c);
362int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
363 char **options);
357void uart_parse_options(char *options, int *baud, int *parity, int *bits, 364void uart_parse_options(char *options, int *baud, int *parity, int *bits,
358 int *flow); 365 int *flow);
359int uart_set_options(struct uart_port *port, struct console *co, int baud, 366int uart_set_options(struct uart_port *port, struct console *co, int baud,
diff --git a/include/linux/serial_mfd.h b/include/linux/serial_mfd.h
deleted file mode 100644
index 2b071e0b034d..000000000000
--- a/include/linux/serial_mfd.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef _SERIAL_MFD_H_
2#define _SERIAL_MFD_H_
3
4/* HW register offset definition */
5#define UART_FOR 0x08
6#define UART_PS 0x0C
7#define UART_MUL 0x0D
8#define UART_DIV 0x0E
9
10#define HSU_GBL_IEN 0x0
11#define HSU_GBL_IST 0x4
12
13#define HSU_GBL_INT_BIT_PORT0 0x0
14#define HSU_GBL_INT_BIT_PORT1 0x1
15#define HSU_GBL_INT_BIT_PORT2 0x2
16#define HSU_GBL_INT_BIT_IRI 0x3
17#define HSU_GBL_INT_BIT_HDLC 0x4
18#define HSU_GBL_INT_BIT_DMA 0x5
19
20#define HSU_GBL_ISR 0x8
21#define HSU_GBL_DMASR 0x400
22#define HSU_GBL_DMAISR 0x404
23
24#define HSU_PORT_REG_OFFSET 0x80
25#define HSU_PORT0_REG_OFFSET 0x80
26#define HSU_PORT1_REG_OFFSET 0x100
27#define HSU_PORT2_REG_OFFSET 0x180
28#define HSU_PORT_REG_LENGTH 0x80
29
30#define HSU_DMA_CHANS_REG_OFFSET 0x500
31#define HSU_DMA_CHANS_REG_LENGTH 0x40
32
33#define HSU_CH_SR 0x0 /* channel status reg */
34#define HSU_CH_CR 0x4 /* control reg */
35#define HSU_CH_DCR 0x8 /* descriptor control reg */
36#define HSU_CH_BSR 0x10 /* max fifo buffer size reg */
37#define HSU_CH_MOTSR 0x14 /* minimum ocp transfer size */
38#define HSU_CH_D0SAR 0x20 /* desc 0 start addr */
39#define HSU_CH_D0TSR 0x24 /* desc 0 transfer size */
40#define HSU_CH_D1SAR 0x28
41#define HSU_CH_D1TSR 0x2C
42#define HSU_CH_D2SAR 0x30
43#define HSU_CH_D2TSR 0x34
44#define HSU_CH_D3SAR 0x38
45#define HSU_CH_D3TSR 0x3C
46
47#endif
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index 00adb01fa5f3..e9b4cb0cd7ed 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -242,25 +242,6 @@
242#define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */ 242#define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */
243 243
244/* 244/*
245 * Intel MID on-chip HSU (High Speed UART) defined bits
246 */
247#define UART_FCR_HSU_64_1B 0x00 /* receive FIFO treshold = 1 */
248#define UART_FCR_HSU_64_16B 0x40 /* receive FIFO treshold = 16 */
249#define UART_FCR_HSU_64_32B 0x80 /* receive FIFO treshold = 32 */
250#define UART_FCR_HSU_64_56B 0xc0 /* receive FIFO treshold = 56 */
251
252#define UART_FCR_HSU_16_1B 0x00 /* receive FIFO treshold = 1 */
253#define UART_FCR_HSU_16_4B 0x40 /* receive FIFO treshold = 4 */
254#define UART_FCR_HSU_16_8B 0x80 /* receive FIFO treshold = 8 */
255#define UART_FCR_HSU_16_14B 0xc0 /* receive FIFO treshold = 14 */
256
257#define UART_FCR_HSU_64B_FIFO 0x20 /* chose 64 bytes FIFO */
258#define UART_FCR_HSU_16B_FIFO 0x00 /* chose 16 bytes FIFO */
259
260#define UART_FCR_HALF_EMPT_TXI 0x00 /* trigger TX_EMPT IRQ for half empty */
261#define UART_FCR_FULL_EMPT_TXI 0x08 /* trigger TX_EMPT IRQ for full empty */
262
263/*
264 * These register definitions are for the 16C950 245 * These register definitions are for the 16C950
265 */ 246 */
266#define UART_ASR 0x01 /* Additional Status Register */ 247#define UART_ASR 0x01 /* Additional Status Register */