aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
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 /arch/x86
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 'arch/x86')
-rw-r--r--arch/x86/Kconfig.debug4
-rw-r--r--arch/x86/include/asm/intel-mid.h3
-rw-r--r--arch/x86/include/asm/serial.h8
-rw-r--r--arch/x86/kernel/early_printk.c6
-rw-r--r--arch/x86/platform/intel-mid/Makefile1
-rw-r--r--arch/x86/platform/intel-mid/early_printk_intel_mid.c112
6 files changed, 4 insertions, 130 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 20028da8ae18..72484a645f05 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -43,10 +43,6 @@ config EARLY_PRINTK
43 with klogd/syslogd or the X server. You should normally N here, 43 with klogd/syslogd or the X server. You should normally N here,
44 unless you want to debug such a crash. 44 unless you want to debug such a crash.
45 45
46config EARLY_PRINTK_INTEL_MID
47 bool "Early printk for Intel MID platform support"
48 depends on EARLY_PRINTK && X86_INTEL_MID
49
50config EARLY_PRINTK_DBGP 46config EARLY_PRINTK_DBGP
51 bool "Early printk via EHCI debug port" 47 bool "Early printk via EHCI debug port"
52 depends on EARLY_PRINTK && PCI 48 depends on EARLY_PRINTK && PCI
diff --git a/arch/x86/include/asm/intel-mid.h b/arch/x86/include/asm/intel-mid.h
index 705d35708a50..7c5af123bdbd 100644
--- a/arch/x86/include/asm/intel-mid.h
+++ b/arch/x86/include/asm/intel-mid.h
@@ -136,9 +136,6 @@ extern enum intel_mid_timer_options intel_mid_timer_options;
136#define SFI_MTMR_MAX_NUM 8 136#define SFI_MTMR_MAX_NUM 8
137#define SFI_MRTC_MAX 8 137#define SFI_MRTC_MAX 8
138 138
139extern struct console early_hsu_console;
140extern void hsu_early_console_init(const char *);
141
142extern void intel_scu_devices_create(void); 139extern void intel_scu_devices_create(void);
143extern void intel_scu_devices_destroy(void); 140extern void intel_scu_devices_destroy(void);
144 141
diff --git a/arch/x86/include/asm/serial.h b/arch/x86/include/asm/serial.h
index 460b84f64556..8378b8c9109c 100644
--- a/arch/x86/include/asm/serial.h
+++ b/arch/x86/include/asm/serial.h
@@ -12,11 +12,11 @@
12 12
13/* Standard COM flags (except for COM4, because of the 8514 problem) */ 13/* Standard COM flags (except for COM4, because of the 8514 problem) */
14#ifdef CONFIG_SERIAL_DETECT_IRQ 14#ifdef CONFIG_SERIAL_DETECT_IRQ
15# define STD_COMX_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ) 15# define STD_COMX_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_AUTO_IRQ)
16# define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | 0 | ASYNC_AUTO_IRQ) 16# define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | 0 | UPF_AUTO_IRQ)
17#else 17#else
18# define STD_COMX_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | 0 ) 18# define STD_COMX_FLAGS (UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | 0 )
19# define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | 0 | 0 ) 19# define STD_COM4_FLAGS (UPF_BOOT_AUTOCONF | 0 | 0 )
20#endif 20#endif
21 21
22#define SERIAL_PORT_DFNS \ 22#define SERIAL_PORT_DFNS \
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 49ff55ef9b26..89427d8d4fc5 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -375,12 +375,6 @@ static int __init setup_early_printk(char *buf)
375 if (!strncmp(buf, "xen", 3)) 375 if (!strncmp(buf, "xen", 3))
376 early_console_register(&xenboot_console, keep); 376 early_console_register(&xenboot_console, keep);
377#endif 377#endif
378#ifdef CONFIG_EARLY_PRINTK_INTEL_MID
379 if (!strncmp(buf, "hsu", 3)) {
380 hsu_early_console_init(buf + 3);
381 early_console_register(&early_hsu_console, keep);
382 }
383#endif
384#ifdef CONFIG_EARLY_PRINTK_EFI 378#ifdef CONFIG_EARLY_PRINTK_EFI
385 if (!strncmp(buf, "efi", 3)) 379 if (!strncmp(buf, "efi", 3))
386 early_console_register(&early_efi_console, keep); 380 early_console_register(&early_efi_console, keep);
diff --git a/arch/x86/platform/intel-mid/Makefile b/arch/x86/platform/intel-mid/Makefile
index 0a8ee703b9fa..0ce1b1913673 100644
--- a/arch/x86/platform/intel-mid/Makefile
+++ b/arch/x86/platform/intel-mid/Makefile
@@ -1,5 +1,4 @@
1obj-$(CONFIG_X86_INTEL_MID) += intel-mid.o intel_mid_vrtc.o mfld.o mrfl.o 1obj-$(CONFIG_X86_INTEL_MID) += intel-mid.o intel_mid_vrtc.o mfld.o mrfl.o
2obj-$(CONFIG_EARLY_PRINTK_INTEL_MID) += early_printk_intel_mid.o
3 2
4# SFI specific code 3# SFI specific code
5ifdef CONFIG_X86_INTEL_MID 4ifdef CONFIG_X86_INTEL_MID
diff --git a/arch/x86/platform/intel-mid/early_printk_intel_mid.c b/arch/x86/platform/intel-mid/early_printk_intel_mid.c
deleted file mode 100644
index 4e720829ab90..000000000000
--- a/arch/x86/platform/intel-mid/early_printk_intel_mid.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * early_printk_intel_mid.c - early consoles for Intel MID platforms
3 *
4 * Copyright (c) 2008-2010, Intel Corporation
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; version 2
9 * of the License.
10 */
11
12/*
13 * This file implements early console named hsu.
14 * hsu is based on a High Speed UART device which only exists in the Medfield
15 * platform
16 */
17
18#include <linux/serial_reg.h>
19#include <linux/serial_mfd.h>
20#include <linux/console.h>
21#include <linux/kernel.h>
22#include <linux/delay.h>
23#include <linux/io.h>
24
25#include <asm/fixmap.h>
26#include <asm/pgtable.h>
27#include <asm/intel-mid.h>
28
29/*
30 * Following is the early console based on Medfield HSU (High
31 * Speed UART) device.
32 */
33#define HSU_PORT_BASE 0xffa28080
34
35static void __iomem *phsu;
36
37void hsu_early_console_init(const char *s)
38{
39 unsigned long paddr, port = 0;
40 u8 lcr;
41
42 /*
43 * Select the early HSU console port if specified by user in the
44 * kernel command line.
45 */
46 if (*s && !kstrtoul(s, 10, &port))
47 port = clamp_val(port, 0, 2);
48
49 paddr = HSU_PORT_BASE + port * 0x80;
50 phsu = (void __iomem *)set_fixmap_offset_nocache(FIX_EARLYCON_MEM_BASE, paddr);
51
52 /* Disable FIFO */
53 writeb(0x0, phsu + UART_FCR);
54
55 /* Set to default 115200 bps, 8n1 */
56 lcr = readb(phsu + UART_LCR);
57 writeb((0x80 | lcr), phsu + UART_LCR);
58 writeb(0x18, phsu + UART_DLL);
59 writeb(lcr, phsu + UART_LCR);
60 writel(0x3600, phsu + UART_MUL*4);
61
62 writeb(0x8, phsu + UART_MCR);
63 writeb(0x7, phsu + UART_FCR);
64 writeb(0x3, phsu + UART_LCR);
65
66 /* Clear IRQ status */
67 readb(phsu + UART_LSR);
68 readb(phsu + UART_RX);
69 readb(phsu + UART_IIR);
70 readb(phsu + UART_MSR);
71
72 /* Enable FIFO */
73 writeb(0x7, phsu + UART_FCR);
74}
75
76#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
77
78static void early_hsu_putc(char ch)
79{
80 unsigned int timeout = 10000; /* 10ms */
81 u8 status;
82
83 while (--timeout) {
84 status = readb(phsu + UART_LSR);
85 if (status & BOTH_EMPTY)
86 break;
87 udelay(1);
88 }
89
90 /* Only write the char when there was no timeout */
91 if (timeout)
92 writeb(ch, phsu + UART_TX);
93}
94
95static void early_hsu_write(struct console *con, const char *str, unsigned n)
96{
97 int i;
98
99 for (i = 0; i < n && *str; i++) {
100 if (*str == '\n')
101 early_hsu_putc('\r');
102 early_hsu_putc(*str);
103 str++;
104 }
105}
106
107struct console early_hsu_console = {
108 .name = "earlyhsu",
109 .write = early_hsu_write,
110 .flags = CON_PRINTBUFFER,
111 .index = -1,
112};