diff options
author | Benjamin Krill <ben@codiert.org> | 2009-01-07 04:32:38 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-01-08 00:25:18 -0500 |
commit | 5886188dc7ba9a76babcd37452f44079a9a77f71 (patch) | |
tree | 3d8e4e807c88b33299abb85e138970498f322f60 /drivers/serial/of_serial.c | |
parent | 2b79d6962322facfd377a402730e4b381af95a40 (diff) |
serial: Add driver for the Cell Network Processor serial port NWP device
Add support for the nwp serial device which is connected to a DCR bus. It
uses the of_serial device driver to determine necessary properties from
the device tree. The supported device is added as serial port number 85.
NWP stands for network processor and it is part of the QPACE - Quantum
Chromodynamics Parallel Computing on the Cell Broadband Engine project.
The implementation is a lightweight uart implementation with the focus
to consume as little resources as possible and it is connected to a
DCR bus.
Signed-off-by: Benjamin Krill <ben@codiert.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/serial/of_serial.c')
-rw-r--r-- | drivers/serial/of_serial.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/serial/of_serial.c b/drivers/serial/of_serial.c index 8fa0ff561e9f..a821e3a3d664 100644 --- a/drivers/serial/of_serial.c +++ b/drivers/serial/of_serial.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
15 | #include <linux/serial_8250.h> | 15 | #include <linux/serial_8250.h> |
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/nwpserial.h> | ||
17 | 18 | ||
18 | #include <asm/prom.h> | 19 | #include <asm/prom.h> |
19 | 20 | ||
@@ -99,9 +100,16 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, | |||
99 | goto out; | 100 | goto out; |
100 | 101 | ||
101 | switch (port_type) { | 102 | switch (port_type) { |
103 | #ifdef CONFIG_SERIAL_8250 | ||
102 | case PORT_8250 ... PORT_MAX_8250: | 104 | case PORT_8250 ... PORT_MAX_8250: |
103 | ret = serial8250_register_port(&port); | 105 | ret = serial8250_register_port(&port); |
104 | break; | 106 | break; |
107 | #endif | ||
108 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL | ||
109 | case PORT_NWPSERIAL: | ||
110 | ret = nwpserial_register_port(&port); | ||
111 | break; | ||
112 | #endif | ||
105 | default: | 113 | default: |
106 | /* need to add code for these */ | 114 | /* need to add code for these */ |
107 | case PORT_UNKNOWN: | 115 | case PORT_UNKNOWN: |
@@ -129,9 +137,16 @@ static int of_platform_serial_remove(struct of_device *ofdev) | |||
129 | { | 137 | { |
130 | struct of_serial_info *info = ofdev->dev.driver_data; | 138 | struct of_serial_info *info = ofdev->dev.driver_data; |
131 | switch (info->type) { | 139 | switch (info->type) { |
140 | #ifdef CONFIG_SERIAL_8250 | ||
132 | case PORT_8250 ... PORT_MAX_8250: | 141 | case PORT_8250 ... PORT_MAX_8250: |
133 | serial8250_unregister_port(info->line); | 142 | serial8250_unregister_port(info->line); |
134 | break; | 143 | break; |
144 | #endif | ||
145 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL | ||
146 | case PORT_NWPSERIAL: | ||
147 | nwpserial_unregister_port(info->line); | ||
148 | break; | ||
149 | #endif | ||
135 | default: | 150 | default: |
136 | /* need to add code for these */ | 151 | /* need to add code for these */ |
137 | break; | 152 | break; |
@@ -148,6 +163,10 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = { | |||
148 | { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, | 163 | { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, |
149 | { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, | 164 | { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, |
150 | { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, | 165 | { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, |
166 | #ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL | ||
167 | { .type = "serial", .compatible = "ibm,qpace-nwp-serial", | ||
168 | .data = (void *)PORT_NWPSERIAL, }, | ||
169 | #endif | ||
151 | { .type = "serial", .data = (void *)PORT_UNKNOWN, }, | 170 | { .type = "serial", .data = (void *)PORT_UNKNOWN, }, |
152 | { /* end of list */ }, | 171 | { /* end of list */ }, |
153 | }; | 172 | }; |