Commit 5886188d authored by Benjamin Krill's avatar Benjamin Krill Committed by Benjamin Herrenschmidt

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: default avatarBenjamin Krill <ben@codiert.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 2b79d696
...@@ -1320,13 +1320,30 @@ config SERIAL_NETX_CONSOLE ...@@ -1320,13 +1320,30 @@ config SERIAL_NETX_CONSOLE
config SERIAL_OF_PLATFORM config SERIAL_OF_PLATFORM
tristate "Serial port on Open Firmware platform bus" tristate "Serial port on Open Firmware platform bus"
depends on PPC_OF depends on PPC_OF
depends on SERIAL_8250 depends on SERIAL_8250 || SERIAL_OF_PLATFORM_NWPSERIAL
help help
If you have a PowerPC based system that has serial ports If you have a PowerPC based system that has serial ports
on a platform specific bus, you should enable this option. on a platform specific bus, you should enable this option.
Currently, only 8250 compatible ports are supported, but Currently, only 8250 compatible ports are supported, but
others can easily be added. others can easily be added.
config SERIAL_OF_PLATFORM_NWPSERIAL
tristate "NWP serial port driver"
depends on PPC_OF && PPC_DCR
select SERIAL_OF_PLATFORM
select SERIAL_CORE_CONSOLE
select SERIAL_CORE
help
This driver supports the cell network processor nwp serial
device.
config SERIAL_OF_PLATFORM_NWPSERIAL_CONSOLE
bool "Console on NWP serial port"
depends on SERIAL_OF_PLATFORM_NWPSERIAL=y
select SERIAL_CORE_CONSOLE
help
Support for Console on the NWP serial ports.
config SERIAL_QE config SERIAL_QE
tristate "Freescale QUICC Engine serial port support" tristate "Freescale QUICC Engine serial port support"
depends on QUICC_ENGINE depends on QUICC_ENGINE
......
...@@ -72,6 +72,7 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o ...@@ -72,6 +72,7 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o
obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o
obj-$(CONFIG_SERIAL_NETX) += netx-serial.o obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
obj-$(CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL) += nwpserial.o
obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o obj-$(CONFIG_KGDB_SERIAL_CONSOLE) += kgdboc.o
obj-$(CONFIG_SERIAL_QE) += ucc_uart.o obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
This diff is collapsed.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/serial_core.h> #include <linux/serial_core.h>
#include <linux/serial_8250.h> #include <linux/serial_8250.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/nwpserial.h>
#include <asm/prom.h> #include <asm/prom.h>
...@@ -99,9 +100,16 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev, ...@@ -99,9 +100,16 @@ static int __devinit of_platform_serial_probe(struct of_device *ofdev,
goto out; goto out;
switch (port_type) { switch (port_type) {
#ifdef CONFIG_SERIAL_8250
case PORT_8250 ... PORT_MAX_8250: case PORT_8250 ... PORT_MAX_8250:
ret = serial8250_register_port(&port); ret = serial8250_register_port(&port);
break; break;
#endif
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
case PORT_NWPSERIAL:
ret = nwpserial_register_port(&port);
break;
#endif
default: default:
/* need to add code for these */ /* need to add code for these */
case PORT_UNKNOWN: case PORT_UNKNOWN:
...@@ -129,9 +137,16 @@ static int of_platform_serial_remove(struct of_device *ofdev) ...@@ -129,9 +137,16 @@ static int of_platform_serial_remove(struct of_device *ofdev)
{ {
struct of_serial_info *info = ofdev->dev.driver_data; struct of_serial_info *info = ofdev->dev.driver_data;
switch (info->type) { switch (info->type) {
#ifdef CONFIG_SERIAL_8250
case PORT_8250 ... PORT_MAX_8250: case PORT_8250 ... PORT_MAX_8250:
serial8250_unregister_port(info->line); serial8250_unregister_port(info->line);
break; break;
#endif
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
case PORT_NWPSERIAL:
nwpserial_unregister_port(info->line);
break;
#endif
default: default:
/* need to add code for these */ /* need to add code for these */
break; break;
...@@ -148,6 +163,10 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = { ...@@ -148,6 +163,10 @@ static struct of_device_id __devinitdata of_platform_serial_table[] = {
{ .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, }, { .type = "serial", .compatible = "ns16450", .data = (void *)PORT_16450, },
{ .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, }, { .type = "serial", .compatible = "ns16550", .data = (void *)PORT_16550, },
{ .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, }, { .type = "serial", .compatible = "ns16750", .data = (void *)PORT_16750, },
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
{ .type = "serial", .compatible = "ibm,qpace-nwp-serial",
.data = (void *)PORT_NWPSERIAL, },
#endif
{ .type = "serial", .data = (void *)PORT_UNKNOWN, }, { .type = "serial", .data = (void *)PORT_UNKNOWN, },
{ /* end of list */ }, { /* end of list */ },
}; };
......
/*
* Serial Port driver for a NWP uart device
*
* Copyright (C) 2008 IBM Corp., Benjamin Krill <ben@codiert.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
*/
#ifndef _NWPSERIAL_H
#define _NWPSERIAL_H
int nwpserial_register_port(struct uart_port *port);
void nwpserial_unregister_port(int line);
#endif /* _NWPSERIAL_H */
...@@ -161,6 +161,9 @@ ...@@ -161,6 +161,9 @@
#define PORT_S3C6400 84 #define PORT_S3C6400 84
/* NWPSERIAL */
#define PORT_NWPSERIAL 85
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/compiler.h> #include <linux/compiler.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment