Skip to contentSkip to conversation

Parallel port support for SGI O2

PATCH In review Arnaud Giersch 1 participant 3 messages Oct 23, 2005 – Oct 26, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Parallel port support for SGI O2

Hello,

I wrote a low-level parallel port driver for the built-in port on SGI O2 (a.k.a. IP32).

The parallel port is driven by a standard ECP chipset, with memory-mapped I/O registers. That's why it was not possible to use the parport_pc module which assumes port-mapped I/O registers.

What works:
* Basic modes are supported: PCSPP, PS2.
* Compatibility mode with FIFO support is present.
* FIFO can be driven with or without interrupts.

What does not work:
* DMA support is not implemented (lack of documentation). If you have any information, please tell me.
* EPP and ECP modes are not implemented (lack of interest). I currently do not own any peripheral supporting this extended modes. It should not be too difficult to do.

All tests were done with an HP LaserJet 5MP connected to a R5000 SGI O2.

The module is named parport_ip32. The patch is not included in this mail because it is not very small (2383 lines, 73 Kb). It is however avalaible from:

http://arnaud.giersch.free.fr/parport_ip32/parport_ip32-latest.patch.gz

The patch is against the latest Linux/MIPS kernel (2.6.14-rc2 as of today). If you prefer that I post it on a mailing list, please just tell me where, and how (inlined, or gzip'ed attached file).

Further informations are available on:

http://arnaud.giersch.free.fr/parport_ip32.html

Regards,

Arnaud Giersch

#2 lore raw

I was told that it is OK to post patches to [email protected], so here it is.

This patch adds support for the built-in parallel port on SGI IP32. It defines two configuration options: PARPORT_IP32 to make it build, and PARPORT_IP32_FIFO to enable support for the hardware FIFO modes.

---

 drivers/parport/Kconfig        |   16 
 drivers/parport/Makefile       |    1 
 drivers/parport/parport_ip32.c | 2328 +++++++++++++++++++++++++++++++++++++++++
 include/linux/parport.h        |    6 
 4 files changed, 2351 insertions(+)
drivers/parport/Kconfig +16 -0
@@ -90,6 +90,22 @@ config PARPORT_ARC
 	depends on ARM && PARPORT
 	select PARPORT_NOT_PC
 
+config PARPORT_IP32
+	tristate "SGI IP32 builtin port (EXPERIMENTAL)"
+	depends on SGI_IP32 && PARPORT && EXPERIMENTAL
+	select PARPORT_NOT_PC
+	help
+	  Say Y here if you need support for the parallel port on
+	  SGI O2 machines. If in doubt, saying N is the safe plan.
+
+config PARPORT_IP32_FIFO
+	bool "Use FIFO if available (EXPERIMENTAL)"
+	depends on PARPORT_IP32 && EXPERIMENTAL
+	help
+	  The parallel port chipset on SGI O2 provide hardware that
+	  can speed up printing. Say Y here if you want to take
+	  advantage of that.
+
 config PARPORT_AMIGA
 	tristate "Amiga builtin port"
 	depends on AMIGA && PARPORT
drivers/parport/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_PARPORT_MFC3)	+= parport_mf
 obj-$(CONFIG_PARPORT_ATARI)	+= parport_atari.o
 obj-$(CONFIG_PARPORT_SUNBPP)	+= parport_sunbpp.o
 obj-$(CONFIG_PARPORT_GSC)	+= parport_gsc.o
+obj-$(CONFIG_PARPORT_IP32)	+= parport_ip32.o
drivers/parport/parport_ip32.c new file +2328 -0

2,328 lines not on this page · raw message

include/linux/parport.h +6 -0
@@ -128,6 +128,11 @@ struct amiga_parport_state {
        unsigned char statusdir;/* ciab.ddrb & 7 */
 };
 
+struct ip32_parport_state {
+	unsigned int dcr;
+	unsigned int ecr;
+};
+
 struct parport_state {
 	union {
 		struct pc_parport_state pc;
@@ -135,6 +140,7 @@ struct parport_state {
 		struct ax_parport_state ax;
 		struct amiga_parport_state amiga;
 		/* Atari has not state. */
+		struct ip32_parport_state ip32;
 		void *misc; 
 	} u;
 };