NetBSD Problem Report #5279

Received: (qmail 20859 invoked from network); 10 Apr 1998 09:35:06 -0000
Message-Id: <199804100929.LAA01195@rumolt.teuto.de>
Date: Fri, 10 Apr 1998 11:29:15 +0200 (MEST)
From: Martin Husemann <martin@rumolt.teuto.de>
Reply-To: martin@rumolt.teuto.de
To: gnats-bugs@gnats.netbsd.org
Subject: EISA drivers incorrectly claim their complete slot space
X-Send-Pr-Version: 3.95

>Number:         5279
>Category:       kern
>Synopsis:       EISA drivers reservere unnecessary parts of their slot space
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 10 02:50:00 +0000 1998
>Closed-Date:    Sat Jan 05 14:23:13 +0000 2002
>Last-Modified:  Sat Jan 05 14:23:13 +0000 2002
>Originator:     Martin Husemann
>Release:        1.3.1
>Organization:
UP-Vision Computergraphik GmbH, Bad Arolsen
>Environment:
System: NetBSD rumolt.teuto.de 1.3.1 NetBSD 1.3.1 (RUMOLT) #10: Fri Apr 10 13:03:45 CEST 1998 root@hwart.teuto.de:/usr/src-1.3.1/sys-i4b/arch/i386/compile/RUMOLT i386


>Description:

EISA drivers bus_space_map their whole io-port slot space. This is incorrect.
There are no other EISA devices in this address io-range, but there may be
other ISA cards. Although this ISA cards are IMHO broken by design, the user
can not fix this. And: these cards work with i386 specific drivers in the
same setup, so they should work with bus_space.h drivers as well.

>How-To-Repeat:

Install an AHB 1742 in EISA slot 1 and an AVM A1 (or Fritz!) ISDN card.
No matter at what IO-port you place the ISDN card, it will need a small
io-range somewhere in the port range between 0x1a00 and 0x1bff. Note that
this doesn't conflict with any register of the AHB controller, but lives
in EISA slot space 1.

A bus-spacified driver for the ISDN card (i.e. the driver in ISDN4BSD)
will fail to bus_space_map this extend and not probe/attach the card.

>Fix:

Since I don't have access to any other hardware supported by drivers under
sys/dev/eisa I only fixed it for the ahb.c driver.

diff -rbBc5 sys/dev/eisa/ahb.c sys-i4b/dev/eisa/ahb.c
*** sys/dev/eisa/ahb.c	Tue Nov  4 13:28:11 1997
--- sys-i4b/dev/eisa/ahb.c	Fri Apr 10 10:54:17 1998
***************
*** 226,242 ****
  	    strcmp(ea->ea_idstring, "ADP0001") &&
  	    strcmp(ea->ea_idstring, "ADP0002") &&
  	    strcmp(ea->ea_idstring, "ADP0400"))
  		return (0);

! 	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot),
! 	    EISA_SLOT_SIZE, 0, &ioh))
  		return (0);

  	rv = !ahb_find(iot, ioh, NULL);

! 	bus_space_unmap(iot, ioh, EISA_SLOT_SIZE);

  	return (rv);
  }

  /*
--- 226,242 ----
  	    strcmp(ea->ea_idstring, "ADP0001") &&
  	    strcmp(ea->ea_idstring, "ADP0002") &&
  	    strcmp(ea->ea_idstring, "ADP0400"))
  		return (0);

! 	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot) + AHB_PORT_OFFSET,
! 	    AHB_PORT_SIZE, 0, &ioh))
  		return (0);

  	rv = !ahb_find(iot, ioh, NULL);

! 	bus_space_unmap(iot, ioh, AHB_PORT_SIZE);

  	return (rv);
  }

  /*
***************
*** 266,277 ****
  		model = EISA_PRODUCT_ADP0400;
  	else
  		model = "unknown model!";
  	printf(": %s\n", model);

! 	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot),
! 	   EISA_SLOT_SIZE, 0, &ioh))
  		panic("ahbattach: could not map I/O addresses");

  	sc->sc_iot = iot;
  	sc->sc_ioh = ioh;
  	sc->sc_dmat = ea->ea_dmat;
--- 266,277 ----
  		model = EISA_PRODUCT_ADP0400;
  	else
  		model = "unknown model!";
  	printf(": %s\n", model);

! 	if (bus_space_map(iot, EISA_SLOT_ADDR(ea->ea_slot) + AHB_PORT_OFFSET,
! 	   AHB_PORT_SIZE, 0, &ioh))
  		panic("ahbattach: could not map I/O addresses");

  	sc->sc_iot = iot;
  	sc->sc_ioh = ioh;
  	sc->sc_dmat = ea->ea_dmat;
diff -rbBc5 sys/dev/eisa/ahbreg.h sys-i4b/dev/eisa/ahbreg.h
*** sys/dev/eisa/ahbreg.h	Wed Aug 27 13:31:02 1997
--- sys-i4b/dev/eisa/ahbreg.h	Fri Apr 10 10:39:15 1998
***************
*** 83,103 ****

  typedef u_long physaddr;
  typedef u_long physlen;

  /*
!  * AHA1740 EISA board mode registers (Offset from slot base)
   */
! #define PORTADDR	0xCC0
  #define	 PORTADDR_ENHANCED	0x80
! #define BIOSADDR	0xCC1
! #define	INTDEF		0xCC2
! #define	SCSIDEF		0xCC3
! #define	BUSDEF		0xCC4
! #define	RESV0		0xCC5
! #define	RESV1		0xCC6
! #define	RESV2		0xCC7
  /**** bit definitions for INTDEF ****/
  #define	INT9	0x00
  #define	INT10	0x01
  #define	INT11	0x02
  #define	INT12	0x03
--- 83,109 ----

  typedef u_long physaddr;
  typedef u_long physlen;

  /*
!  * Bus space mapping (relative to slot base)
   */
! #define	AHB_PORT_OFFSET	0xCC0
! #define	AHB_PORT_SIZE	32
! 
! /*
!  * AHA1740 EISA board mode registers (Offset from AHB_PORT_OFFSET)
!  */
! #define PORTADDR	0x00
  #define	 PORTADDR_ENHANCED	0x80
! #define BIOSADDR	0x01
! #define	INTDEF		0x02
! #define	SCSIDEF		0x03
! #define	BUSDEF		0x04
! #define	RESV0		0x05
! #define	RESV1		0x06
! #define	RESV2		0x07
  /**** bit definitions for INTDEF ****/
  #define	INT9	0x00
  #define	INT10	0x01
  #define	INT11	0x02
  #define	INT12	0x03
***************
*** 112,139 ****
  #define	B0uS	0x00		/* give up bus immediatly */
  #define	B4uS	0x01		/* delay 4uSec. */
  #define	B8uS	0x02

  /*
!  * AHA1740 ENHANCED mode mailbox control regs (Offset from slot base)
   */
! #define MBOXOUT0	0xCD0
! #define MBOXOUT1	0xCD1
! #define MBOXOUT2	0xCD2
! #define MBOXOUT3	0xCD3

! #define	ATTN		0xCD4
! #define	G2CNTRL		0xCD5
! #define	G2INTST		0xCD6
! #define G2STAT		0xCD7

! #define	MBOXIN0		0xCD8
! #define	MBOXIN1		0xCD9
! #define	MBOXIN2		0xCDA
! #define	MBOXIN3		0xCDB

! #define G2STAT2		0xCDC

  /*
   * Bit definitions for the 5 control/status registers
   */
  #define	ATTN_TARGET		0x0F
--- 118,145 ----
  #define	B0uS	0x00		/* give up bus immediatly */
  #define	B4uS	0x01		/* delay 4uSec. */
  #define	B8uS	0x02

  /*
!  * AHA1740 ENHANCED mode mailbox control regs (Offset from AHB_PORT_OFFSET)
   */
! #define MBOXOUT0	0x10
! #define MBOXOUT1	0x11
! #define MBOXOUT2	0x12
! #define MBOXOUT3	0x13

! #define	ATTN		0x14
! #define	G2CNTRL		0x15
! #define	G2INTST		0x16
! #define G2STAT		0x17

! #define	MBOXIN0		0x18
! #define	MBOXIN1		0x19
! #define	MBOXIN2		0x1A
! #define	MBOXIN3		0x1B

! #define G2STAT2		0x1C

  /*
   * Bit definitions for the 5 control/status registers
   */
  #define	ATTN_TARGET		0x0F
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: thorpej 
State-Changed-When: Sun Jul 12 01:26:45 PDT 1998 
State-Changed-Why:  
Problem has been analyzed, solution in the works. 


Responsible-Changed-From-To: kern-bug-people->thorpej 
Responsible-Changed-By: thorpej 
Responsible-Changed-When: Sun Jul 12 01:26:45 PDT 1998 
Responsible-Changed-Why:  
I'll claim this one. 

From: Martin Husemann <martin@rumolt.teuto.de>
To: gnats-bugs@NetBSD.ORG
Cc: thorpej@NetBSD.ORG
Subject: Re: kern/5279
Date: Sun, 7 May 2000 15:44:47 +0200 (MEST)

 I'm commiting a fix for the if_ep_eisa.c driver, which leaves only
 if_fea.c and if_tlp_eisa.c left with this bug, all others have been fixed.
 We're nearly there, finaly.

 Martin
Responsible-Changed-From-To: thorpej->kern-bug-people 
Responsible-Changed-By: thorpej 
Responsible-Changed-When: Fri May 26 22:37:59 PDT 2000 
Responsible-Changed-Why:  
I don't have time to deal with this, and recently other people 
have picked up this ball. 
Responsible-Changed-From-To: kern-bug-people->martin 
Responsible-Changed-By: martin 
Responsible-Changed-When: Mon May 29 12:59:22 PDT 2000 
Responsible-Changed-Why:  
I'll take care of this ;-) 
State-Changed-From-To: analyzed->suspended 
State-Changed-By: martin 
State-Changed-When: Wed Oct 11 13:24:45 PDT 2000 
State-Changed-Why:  
Thankfully newer bus architectures have replaced EISA, so no urgent need 
forces imediate action. 

Most drivers have been changed to not allocate unnecessary parts of the 
IO space now. Two issues remain unfixed: 

syssrc/dev/eisa/if_tlp_eisa.c 
syssrc/dev/eisa/if_fea.c 

The EISA tulip address decoder seems to be strange and use large parts of the 
allocated space. The backend code is shared with other busses, so not making 
the driver any more complicated is more important than avoiding unnecessary 
allocation of io space. 

The if_fea.c driver would allow the use of two small io regions (one at offset 
0x0040 for PDQ_EISA_BURST_HOLDOFF, the other between 0x0c80 and 0x0caf for 
all other registers), but this driver is shared between us and other BSDs. 
I will ask the author to do the change globally for all supported systems. 
State-Changed-From-To: suspended->closed 
State-Changed-By: martin 
State-Changed-When: Sat Jan 5 06:20:22 PST 2002 
State-Changed-Why:  
Further work on this is unlikely to happen. Most drivers have been fixed, 
the conflicting configuration itself is unlikely too. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.