Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 1995 21:49:38 +0200
From:      esser@ZPR.Uni-Koeln.DE (Stefan Esser)
To:        current@FreeBSD.ORG
Subject:   Please test this PCI bus init patch ...
Message-ID:  <199506121949.AA01970@FileServ1.MI.Uni-Koeln.DE>

next in thread | raw e-mail | index | archive | help
There have been a few reports on newer PCI chip sets 
not being correctly recognised as using configuration 
mechanism 1 (the preferred mechnism for all new PCI 
chip sets).

To make FreeBSD boot on these systems, I made a patch 
to "/sys/i386/isa/pcibus.c", which is expected to 
correctly determine the configuration mechanism on 
old and new systems ...

I've sent an earlier version of this patch to the 
"hackers@freebsd.org" list and got some feedback,
leading to one further small modification.


Please test this patch on all PCI systems you use,
to make sure your system will continue to work after
this patch goes into FreeBSD-current !


Thanks in advance,

STefan


Index: /sys/i386/isa/pcibus.c
===================================================================
RCS file: /usr/cvs/src/sys/i386/isa/pcibus.c,v
retrieving revision 1.8
diff -C2 -r1.8 pcibus.c
*** 1.8	1995/03/22 21:35:39
--- pcibus.c	1995/06/12 19:04:50
***************
*** 140,143 ****
--- 140,144 ----
  
  #define CONF1_ENABLE       0x80000000ul
+ #define CONF1_ENABLE_CHK   0xF0000000ul
  #define CONF1_ADDR_PORT    0x0cf8
  #define CONF1_DATA_PORT    0x0cfc
***************
*** 154,170 ****
  
  	/*---------------------------------------
- 	**      Configuration mode 2 ?
- 	**---------------------------------------
- 	*/
- 
- 	outb (CONF2_ENABLE_PORT,  0);
- 	outb (CONF2_FORWARD_PORT, 0);
- 	if (!inb (CONF2_ENABLE_PORT) && !inb (CONF2_FORWARD_PORT)) {
- 		pci_mechanism = 2;
- 		pci_maxdevice = 16;
- 		return;
- 	};
- 
- 	/*---------------------------------------
  	**      Configuration mode 1 ?
  	**---------------------------------------
--- 155,158 ----
***************
*** 172,176 ****
  
  	oldval = inl (CONF1_ADDR_PORT);
! 	outl (CONF1_ADDR_PORT, CONF1_ENABLE);
  	result = inl (CONF1_ADDR_PORT);
  	outl (CONF1_ADDR_PORT, oldval);
--- 160,165 ----
  
  	oldval = inl (CONF1_ADDR_PORT);
! 	outl (CONF1_ADDR_PORT, CONF1_ENABLE_CHK);
! 	outb (CONF1_ADDR_PORT +3, 0);
  	result = inl (CONF1_ADDR_PORT);
  	outl (CONF1_ADDR_PORT, oldval);
***************
*** 179,182 ****
--- 168,184 ----
  		pci_mechanism = 1;
  		pci_maxdevice = 32;
+ 		return;
+ 	};
+ 
+ 	/*---------------------------------------
+ 	**      Configuration mode 2 ?
+ 	**---------------------------------------
+ 	*/
+ 
+ 	outb (CONF2_ENABLE_PORT,  0);
+ 	outb (CONF2_FORWARD_PORT, 0);
+ 	if (!inb (CONF2_ENABLE_PORT) && !inb (CONF2_FORWARD_PORT)) {
+ 		pci_mechanism = 2;
+ 		pci_maxdevice = 16;
  		return;
  	};

-- 
 Stefan Esser				Internet:	<se@ZPR.Uni-Koeln.DE>
 Zentrum fuer Paralleles Rechnen	Tel:		+49 221 4706017
 Universitaet zu Koeln			FAX:		+49 221 4705160
 Weyertal 80
 50931 Koeln



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199506121949.AA01970>