Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2002 00:42:01 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17837 for review
Message-ID:  <200209210742.g8L7g1kH081886@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17837

Change 17837 by peter@peter_overcee on 2002/09/21 00:41:06

	more de-bios-ification

Affected files ...

.. //depot/projects/hammer/sys/x86_64/include/pci_cfgreg.h#3 edit
.. //depot/projects/hammer/sys/x86_64/pci/pci_bus.c#2 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#15 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/include/pci_cfgreg.h#3 (text+ko) ====

@@ -46,6 +46,3 @@
 u_int32_t	pci_cfgregread(int bus, int slot, int func, int reg, int bytes);
 void		pci_cfgregwrite(int bus, int slot, int func, int reg, u_int32_t data, int bytes);
 int		pci_cfgintr(int bus, int device, int pin, int oldirq);
-int		pci_kill_pcibios(void);
-int		pci_pcibios_active(void);
-int		pci_probe_route_table(int bus);

==== //depot/projects/hammer/sys/x86_64/pci/pci_bus.c#2 (text+ko) ====

@@ -44,14 +44,10 @@
 #include <machine/pci_cfgreg.h>
 #include <machine/segments.h>
 #include <machine/cputypes.h>
-#include <machine/pc/bios.h>
 #include <machine/md_var.h>
 
 #include "pcib_if.h"
 
-static int	pcibios_pcib_route_interrupt(device_t pcib, device_t dev,
-    int pin);
-
 static int
 nexus_pcib_maxslots(device_t dev)
 {
@@ -81,7 +77,9 @@
 static int
 nexus_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
 {
-	return (pcibios_pcib_route_interrupt(pcib, dev, pin));
+
+	/* No routing possible */
+	return (PCI_INVALID_IRQ);
 }
 
 static devclass_t	pcib_devclass;
@@ -299,7 +297,6 @@
 	int pcifunchigh;
 	int found824xx = 0;
 	int found_orion = 0;
-	int found_pcibios_flaming_death = 0;
 	device_t child;
 	devclass_t pci_devclass;
 
@@ -391,23 +388,6 @@
 	}
 
 	/*
-	 * This is just freaking brilliant!  Some BIOS writers have
-	 * decided that we must be forcibly prevented from using
-	 * PCIBIOS to query the host->pci bridges.  If you try and
-	 * access configuration registers, it pretends there is
-	 * no pci device at that bus:device:function address.
-	 */
-	if (!found && pci_pcibios_active() && !found_pcibios_flaming_death) {
-		/* retry with the old mechanism, or fail */
-		if (pci_kill_pcibios() == 0)
-			return;
-		printf("nexus_pcib_identify: found broken PCIBIOS - disabling it and retrying.\n");
-		printf("nexus_pcib_identify: it is bogusly censoring host->pci bridges.\n");
-		found_pcibios_flaming_death = 1;
-		goto retry;
-	}
-
-	/*
 	 * Make sure we add at least one bridge since some old
 	 * hardware doesn't actually have a host-pci bridge device.
 	 * Note that pci_cfgregopen() thinks we have PCI devices..
@@ -622,67 +602,3 @@
 static devclass_t pcibus_pnp_devclass;
 
 DRIVER_MODULE(pcibus_pnp, isa, pcibus_pnp_driver, pcibus_pnp_devclass, 0, 0);
-
-
-/*
- * Provide a PCI-PCI bridge driver for PCI busses behind PCI-PCI bridges
- * that appear in the PCIBIOS Interrupt Routing Table to use the routing
- * table for interrupt routing when possible.
- */
-static int	pcibios_pcib_probe(device_t bus);
-
-static device_method_t pcibios_pcib_pci_methods[] = {
-	/* Device interface */
-	DEVMETHOD(device_probe,		pcibios_pcib_probe),
-	DEVMETHOD(device_attach,	pcib_attach),
-	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
-	DEVMETHOD(device_suspend,	bus_generic_suspend),
-	DEVMETHOD(device_resume,	bus_generic_resume),
-
-	/* Bus interface */
-	DEVMETHOD(bus_print_child,	bus_generic_print_child),
-	DEVMETHOD(bus_read_ivar,	pcib_read_ivar),
-	DEVMETHOD(bus_write_ivar,	pcib_write_ivar),
-	DEVMETHOD(bus_alloc_resource,	pcib_alloc_resource),
-	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
-	DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
-	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-	DEVMETHOD(bus_setup_intr,	bus_generic_setup_intr),
-	DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
-
-	/* pcib interface */
-	DEVMETHOD(pcib_maxslots,	pcib_maxslots),
-	DEVMETHOD(pcib_read_config,	pcib_read_config),
-	DEVMETHOD(pcib_write_config,	pcib_write_config),
-	DEVMETHOD(pcib_route_interrupt,	pcibios_pcib_route_interrupt),
-
-	{0, 0}
-};
-
-static driver_t pcibios_pcib_driver = {
-	"pcib",
-	pcibios_pcib_pci_methods,
-	sizeof(struct pcib_softc),
-};
-
-DRIVER_MODULE(pcibios_pcib, pci, pcibios_pcib_driver, pcib_devclass, 0, 0);
-
-static int
-pcibios_pcib_probe(device_t dev)
-{
-
-	if ((pci_get_class(dev) != PCIC_BRIDGE) ||
-	    (pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
-		return (ENXIO);
-	if (pci_probe_route_table(pcib_get_bus(dev)) == 0)
-		return (ENXIO);
-	device_set_desc(dev, "PCIBIOS PCI-PCI bridge");
-	return (-2000);
-}
-
-static int
-pcibios_pcib_route_interrupt(device_t pcib, device_t dev, int pin)
-{
-	return(pci_cfgintr(pci_get_bus(dev), pci_get_slot(dev), pin,
-		   pci_get_irq(dev)));
-}

==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#15 (text+ko) ====

@@ -99,7 +99,6 @@
 #include <machine/specialreg.h>
 #include <machine/bootinfo.h>
 #include <machine/md_var.h>
-#include <machine/pc/bios.h>
 #include <machine/pcb_ext.h>		/* pcb.h included via sys/user.h */
 #include <machine/proc.h>
 #ifdef PERFMON

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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