Skip to contentSkip to conversation

MPSC driver patch

PATCH New Mark A. Greer 1 participant 1 message Aug 27, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MPSC driver patch

Russell,

Please review and consider for inclusion, the following patch for the Marvell MultiProtocol Serial Controller (MPSC). This ctlr is on a series of host bridges (and other things) for PPC and MIPS processors.

I tried to design the driver to keep the processor/platform-specific code out of the main driver code. I made an additional file for ppc32 specific code. If/when someone with a mips platform wants to use it, they can create a mpsc_mips file.

The ctlr operates similar to a typical network controller with send and receive rings. Unfortunately there are many errata so you will see some "unusual" things in the code. For example:
a) An erratum prevents the reading of several registers on the ctlr (writing is okay). To work around that, a local copy of what the registers are is kept and special macros are used to access those mirrored values.
b) Another erratum says that the MPSC cannot be used to access cache coherent memory (and all of the systems I use are coherent). However, it seems to work okay as long as there are no snoop hits so there are macros in the code to manually manage the caches to prevent snoop hits. Each macro checks a flag to see if the manual cache mgmt is necessary as not all versions have the erratum.

The driver seems to work well but more testing is needed and it is lacking KGDB support. I will get to both of those in time.

One final thing, I need a minor number assignment for the 204 major (Low-density serial ports). How do I do that? (I'm using 5 as a place holder.)

Thank you,

Mark
--

drivers/serial/Kconfig +14 -0
diff -Nru a/drivers/serial/Kconfig b/drivers/serial/Kconfig
@@ -726,4 +726,18 @@
 	  This driver can also be built as a module.  If so, the module
 	  will be called icom.
 
+config SERIAL_MPSC
+	bool "Marvell MPSC serial port support"
+	depends on PPC32 && MV64X60
+	select SERIAL_CORE
+	help
+	  Say Y here if you want to use the Marvell MPSC serial controller.
+
+config SERIAL_MPSC_CONSOLE
+	bool "Support for console on Marvell MPSC serial port"
+	depends on SERIAL_MPSC
+	select SERIAL_CORE_CONSOLE
+	help
+	  Say Y here if you want to support a serial console on a Marvell MPSC.
+
 endmenu
drivers/serial/Makefile +1 -0
diff -Nru a/drivers/serial/Makefile b/drivers/serial/Makefile
@@ -41,3 +41,4 @@
 obj-$(CONFIG_SERIAL_SGI_L1_CONSOLE) += sn_console.o
 obj-$(CONFIG_SERIAL_CPM) += cpm_uart/
 obj-$(CONFIG_SERIAL_MPC52xx) += mpc52xx_uart.o
+obj-$(CONFIG_SERIAL_MPSC) += mpsc/
drivers/serial/mpsc/Makefile new file +6 -0
diff -Nru a/drivers/serial/mpsc/Makefile b/drivers/serial/mpsc/Makefile
@@ -0,0 +1,6 @@
+#
+# Make file for the Marvell MPSC driver.
+#
+
+obj-$(CONFIG_SERIAL_MPSC)	+= mpsc.o
+obj-$(CONFIG_PPC32)		+= mpsc_ppc32.o
drivers/serial/mpsc/mpsc.c new file +1472 -0

1,472 lines not on this page · raw message

drivers/serial/mpsc/mpsc.h new file +284 -0

284 lines not on this page · raw message

drivers/serial/mpsc/mpsc_defs.h new file +151 -0

151 lines not on this page · raw message

drivers/serial/mpsc/mpsc_ppc32.c new file +109 -0

109 lines not on this page · raw message