diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 17:39:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-07 17:39:20 -0500 |
commit | 56b85f32d530d09d6805488ad00775d4e0e3baab (patch) | |
tree | e7fbe69e338ef775d3b2dd822aa915d259b4bc94 /drivers/char | |
parent | 3e5b08cbbf78bedd316904ab0cf3b27119433ee5 (diff) | |
parent | 568389c257fa7d74ce36c2f78bad31965fded4cf (diff) |
Merge branch 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (36 commits)
serial: apbuart: Fixup apbuart_console_init()
TTY: Add tty ioctl to figure device node of the system console.
tty: add 'active' sysfs attribute to tty0 and console device
drivers: serial: apbuart: Handle OF failures gracefully
Serial: Avoid unbalanced IRQ wake disable during resume
tty: fix typos/errors in tty_driver.h comments
pch_uart : fix warnings for 64bit compile
8250: fix uninitialized FIFOs
ip2: fix compiler warning on ip2main_pci_tbl
specialix: fix compiler warning on specialix_pci_tbl
rocket: fix compiler warning on rocket_pci_ids
8250: add a UPIO_DWAPB32 for 32 bit accesses
8250: use container_of() instead of casting
serial: omap-serial: Add support for kernel debugger
serial: fix pch_uart kconfig & build
drivers: char: hvc: add arm JTAG DCC console support
RS485 documentation: add 16C950 UART description
serial: ifx6x60: fix memory leak
serial: ifx6x60: free IRQ on error
Serial: EG20T: add PCH_UART driver
...
Fixed up conflicts in drivers/serial/apbuart.c with evil merge that
makes the code look fairly sane (unlike either side).
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/Kconfig | 9 | ||||
-rw-r--r-- | drivers/char/Makefile | 1 | ||||
-rw-r--r-- | drivers/char/hvc_dcc.c | 133 | ||||
-rw-r--r-- | drivers/char/ip2/ip2main.c | 2 | ||||
-rw-r--r-- | drivers/char/rocket.c | 2 | ||||
-rw-r--r-- | drivers/char/specialix.c | 2 |
6 files changed, 146 insertions, 3 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 43d3395325c5..d4a7776f4b77 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -682,6 +682,15 @@ config HVC_UDBG | |||
682 | select HVC_DRIVER | 682 | select HVC_DRIVER |
683 | default n | 683 | default n |
684 | 684 | ||
685 | config HVC_DCC | ||
686 | bool "ARM JTAG DCC console" | ||
687 | depends on ARM | ||
688 | select HVC_DRIVER | ||
689 | help | ||
690 | This console uses the JTAG DCC on ARM to create a console under the HVC | ||
691 | driver. This console is used through a JTAG only on ARM. If you don't have | ||
692 | a JTAG then you probably don't want this option. | ||
693 | |||
685 | config VIRTIO_CONSOLE | 694 | config VIRTIO_CONSOLE |
686 | tristate "Virtio console" | 695 | tristate "Virtio console" |
687 | depends on VIRTIO | 696 | depends on VIRTIO |
diff --git a/drivers/char/Makefile b/drivers/char/Makefile index ba53ec956c95..fa0b824b7a65 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile | |||
@@ -34,6 +34,7 @@ obj-$(CONFIG_HVC_CONSOLE) += hvc_vio.o hvsi.o | |||
34 | obj-$(CONFIG_HVC_ISERIES) += hvc_iseries.o | 34 | obj-$(CONFIG_HVC_ISERIES) += hvc_iseries.o |
35 | obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o | 35 | obj-$(CONFIG_HVC_RTAS) += hvc_rtas.o |
36 | obj-$(CONFIG_HVC_TILE) += hvc_tile.o | 36 | obj-$(CONFIG_HVC_TILE) += hvc_tile.o |
37 | obj-$(CONFIG_HVC_DCC) += hvc_dcc.o | ||
37 | obj-$(CONFIG_HVC_BEAT) += hvc_beat.o | 38 | obj-$(CONFIG_HVC_BEAT) += hvc_beat.o |
38 | obj-$(CONFIG_HVC_DRIVER) += hvc_console.o | 39 | obj-$(CONFIG_HVC_DRIVER) += hvc_console.o |
39 | obj-$(CONFIG_HVC_IRQ) += hvc_irq.o | 40 | obj-$(CONFIG_HVC_IRQ) += hvc_irq.o |
diff --git a/drivers/char/hvc_dcc.c b/drivers/char/hvc_dcc.c new file mode 100644 index 000000000000..6470f63deb4b --- /dev/null +++ b/drivers/char/hvc_dcc.c | |||
@@ -0,0 +1,133 @@ | |||
1 | /* Copyright (c) 2010, Code Aurora Forum. All rights reserved. | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License version 2 and | ||
5 | * only version 2 as published by the Free Software Foundation. | ||
6 | * | ||
7 | * This program is distributed in the hope that it will be useful, | ||
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
10 | * GNU General Public License for more details. | ||
11 | * | ||
12 | * You should have received a copy of the GNU General Public License | ||
13 | * along with this program; if not, write to the Free Software | ||
14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
15 | * 02110-1301, USA. | ||
16 | */ | ||
17 | |||
18 | #include <linux/console.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/err.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/moduleparam.h> | ||
23 | #include <linux/types.h> | ||
24 | |||
25 | #include <asm/processor.h> | ||
26 | |||
27 | #include "hvc_console.h" | ||
28 | |||
29 | /* DCC Status Bits */ | ||
30 | #define DCC_STATUS_RX (1 << 30) | ||
31 | #define DCC_STATUS_TX (1 << 29) | ||
32 | |||
33 | static inline u32 __dcc_getstatus(void) | ||
34 | { | ||
35 | u32 __ret; | ||
36 | |||
37 | asm("mrc p14, 0, %0, c0, c1, 0 @ read comms ctrl reg" | ||
38 | : "=r" (__ret) : : "cc"); | ||
39 | |||
40 | return __ret; | ||
41 | } | ||
42 | |||
43 | |||
44 | #if defined(CONFIG_CPU_V7) | ||
45 | static inline char __dcc_getchar(void) | ||
46 | { | ||
47 | char __c; | ||
48 | |||
49 | asm("get_wait: mrc p14, 0, pc, c0, c1, 0 \n\ | ||
50 | bne get_wait \n\ | ||
51 | mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" | ||
52 | : "=r" (__c) : : "cc"); | ||
53 | |||
54 | return __c; | ||
55 | } | ||
56 | #else | ||
57 | static inline char __dcc_getchar(void) | ||
58 | { | ||
59 | char __c; | ||
60 | |||
61 | asm("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg" | ||
62 | : "=r" (__c)); | ||
63 | |||
64 | return __c; | ||
65 | } | ||
66 | #endif | ||
67 | |||
68 | #if defined(CONFIG_CPU_V7) | ||
69 | static inline void __dcc_putchar(char c) | ||
70 | { | ||
71 | asm("put_wait: mrc p14, 0, pc, c0, c1, 0 \n\ | ||
72 | bcs put_wait \n\ | ||
73 | mcr p14, 0, %0, c0, c5, 0 " | ||
74 | : : "r" (c) : "cc"); | ||
75 | } | ||
76 | #else | ||
77 | static inline void __dcc_putchar(char c) | ||
78 | { | ||
79 | asm("mcr p14, 0, %0, c0, c5, 0 @ write a char" | ||
80 | : /* no output register */ | ||
81 | : "r" (c)); | ||
82 | } | ||
83 | #endif | ||
84 | |||
85 | static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count) | ||
86 | { | ||
87 | int i; | ||
88 | |||
89 | for (i = 0; i < count; i++) { | ||
90 | while (__dcc_getstatus() & DCC_STATUS_TX) | ||
91 | cpu_relax(); | ||
92 | |||
93 | __dcc_putchar((char)(buf[i] & 0xFF)); | ||
94 | } | ||
95 | |||
96 | return count; | ||
97 | } | ||
98 | |||
99 | static int hvc_dcc_get_chars(uint32_t vt, char *buf, int count) | ||
100 | { | ||
101 | int i; | ||
102 | |||
103 | for (i = 0; i < count; ++i) { | ||
104 | int c = -1; | ||
105 | |||
106 | if (__dcc_getstatus() & DCC_STATUS_RX) | ||
107 | c = __dcc_getchar(); | ||
108 | if (c < 0) | ||
109 | break; | ||
110 | buf[i] = c; | ||
111 | } | ||
112 | |||
113 | return i; | ||
114 | } | ||
115 | |||
116 | static const struct hv_ops hvc_dcc_get_put_ops = { | ||
117 | .get_chars = hvc_dcc_get_chars, | ||
118 | .put_chars = hvc_dcc_put_chars, | ||
119 | }; | ||
120 | |||
121 | static int __init hvc_dcc_console_init(void) | ||
122 | { | ||
123 | hvc_instantiate(0, 0, &hvc_dcc_get_put_ops); | ||
124 | return 0; | ||
125 | } | ||
126 | console_initcall(hvc_dcc_console_init); | ||
127 | |||
128 | static int __init hvc_dcc_init(void) | ||
129 | { | ||
130 | hvc_alloc(0, 0, &hvc_dcc_get_put_ops, 128); | ||
131 | return 0; | ||
132 | } | ||
133 | device_initcall(hvc_dcc_init); | ||
diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c index fcd02baa7d65..c3a025356b8b 100644 --- a/drivers/char/ip2/ip2main.c +++ b/drivers/char/ip2/ip2main.c | |||
@@ -3224,7 +3224,7 @@ ip2trace (unsigned short pn, unsigned char cat, unsigned char label, unsigned lo | |||
3224 | 3224 | ||
3225 | MODULE_LICENSE("GPL"); | 3225 | MODULE_LICENSE("GPL"); |
3226 | 3226 | ||
3227 | static struct pci_device_id ip2main_pci_tbl[] __devinitdata = { | 3227 | static struct pci_device_id ip2main_pci_tbl[] __devinitdata __used = { |
3228 | { PCI_DEVICE(PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_IP2EX) }, | 3228 | { PCI_DEVICE(PCI_VENDOR_ID_COMPUTONE, PCI_DEVICE_ID_COMPUTONE_IP2EX) }, |
3229 | { } | 3229 | { } |
3230 | }; | 3230 | }; |
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 86308830ac42..3e4e73a0d7c1 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c | |||
@@ -1764,7 +1764,7 @@ static void rp_flush_buffer(struct tty_struct *tty) | |||
1764 | 1764 | ||
1765 | #ifdef CONFIG_PCI | 1765 | #ifdef CONFIG_PCI |
1766 | 1766 | ||
1767 | static struct pci_device_id __devinitdata rocket_pci_ids[] = { | 1767 | static struct pci_device_id __devinitdata __used rocket_pci_ids[] = { |
1768 | { PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) }, | 1768 | { PCI_DEVICE(PCI_VENDOR_ID_RP, PCI_ANY_ID) }, |
1769 | { } | 1769 | { } |
1770 | }; | 1770 | }; |
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index a7616d226a49..c2bca3f25ef3 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c | |||
@@ -2355,7 +2355,7 @@ static void __exit specialix_exit_module(void) | |||
2355 | func_exit(); | 2355 | func_exit(); |
2356 | } | 2356 | } |
2357 | 2357 | ||
2358 | static struct pci_device_id specialx_pci_tbl[] __devinitdata = { | 2358 | static struct pci_device_id specialx_pci_tbl[] __devinitdata __used = { |
2359 | { PCI_DEVICE(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_IO8) }, | 2359 | { PCI_DEVICE(PCI_VENDOR_ID_SPECIALIX, PCI_DEVICE_ID_SPECIALIX_IO8) }, |
2360 | { } | 2360 | { } |
2361 | }; | 2361 | }; |