Bug 38372

Summary: patch for puc(4) to support parallel ports
Product: Base System Reporter: thomas.brupbacher <thomas.brupbacher>
Component: kernAssignee: Doug Ambrisko <ambrisko>
Status: Closed FIXED    
Severity: Affects Only Me CC: jhay
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description thomas.brupbacher 2002-05-21 12:50:02 UTC
	The puc(4) driver supports only serial ports so far,
	the attached patch adds support for parallel ports. The patch
	below is good enough to print the apsfilter test.ps on my old
	LaserJet via the Oxford OX12PCI840 based card.

	The Oxford puc cards use a second IOPORT for the ECP area.  This
	gives rise to two questions:

	a) the code in puc.c should probably deal with that, maybe one could
	   provide a "generic" puc_attach that deals with most cards (the code
	   that is present now), and additionally add an entry in pucdata.c
	   that contains a pointer to a card specific puc_attach. This would
	   move us away from NetBSD though.

	   I could see something like (not certain about the syntax...)

	struct puc_device_description {
        	const char      *name;
        	uint32_t        rval[4];
        	uint32_t        rmask[4];
        	(int) __P(device_t))    *attach;
        	struct {
                	int     type;
                	int     bar;
                	int     offset;
                	u_int   serialfreq;
        	} ports[PUC_MAX_PORTS];
	};

	b) The code in ppc.c assumes that ECP can be accessed by just adding
	   0x400 to the base IOPORT.  I have no idea what the best way would
	   be to solve that (to enable the full feature set of the puc card).
Comment 1 Doug Ambrisko freebsd_committer freebsd_triage 2003-06-19 16:23:19 UTC
Responsible Changed
From-To: freebsd-bugs->ambrisko@freebsd.org

I'll take this enhancement.  I indepedantly did the same kind of thing 
and have requested a repo-copy of sys/isa/*ppc* to sys/dev/ppc.  I will 
look more at this implementation after that is done.  At first pass 
though it doesn't seem to address the bus bug issue in puc when you 
have a chaining of puc -> ppc -> ppbus -> plip for example.  There might 
be code in this patch to work around it in another way.
Comment 2 Doug Ambrisko freebsd_committer freebsd_triage 2003-08-01 03:28:43 UTC
State Changed
From-To: open->closed

This in essence is now in -current.  Thanks. 


Comment 3 Doug Ambrisko freebsd_committer freebsd_triage 2003-08-01 03:28:43 UTC
Responsible Changed
From-To: ambrisko@freebsd.org->ambrisko

This in essence is now in -current.  Thanks.