TESTERS NEEDED: new OFW PCI code

Thomas Moestl t.moestl at tu-bs.de
Fri Jun 13 09:01:26 PDT 2003


Hi,

I've finished implementing the long-promised new OFW PCI code; the
patch is available at
  http://people.freebsd.org/~tmm/ofw-newpci.diff

It would be very nice if people could test this on different types of
sparc64 PCI machines, espcially those with more exotic firmware
properties such as Ultra 30, e450 and Netra t1, and ones with the apb
PCI-PCI bridge.

To do so, please apply the patch, and add the new option OFW_NEWPCI to
your configuration (and, to make debugging easier, OFW_PCI_DEBUG and
PSYCHO_DEBUG). Test reports for kernels with the patch applied, but
without OFW_NEWPCI are also very welcome, since some of the old code
has also been changed.
WARNING: Please be aware that device enumeration may have changed on
your box with that option, so you might need to do some
reconfiguration to make the system boot properly (like changing device
names in your fstab and exchanging the configuration of network
interfaces). You might not even be able to boot without correcting the
boot device on the rootmount prompt if you've got multiple disk
controllers with disks attached to more than one.

I plan to commit this as soon as I'm reasonably convinced that it
works on most boxen. It will still be conditional on OFW_NEWPCI then
for a while, since the enumeration changes could cause major upgrade
pains. I'll see how to go about making it the default later; I want to
kick out the old code as soon as possible :)

The advantages of the new approach are:
- Odd devices (like the gem(4)s, hme(4)s etc. without function 0 in
  the firmware) should just work now.
- Device enumeration should hopefully be more like on Solaris now,
  so unit numbers should match what's printed on the box more
  closely.
- Real interrupt routing is implemented now, so cardbus bridges
  etc. have at least a chance to work.
- The quirk tables are gone and have been replaced by (hopefully
  sufficient) heuristics.
- Much cleaner code.

For the interested, the changes are:
- Introduce an OFW PCI bus driver; it inherits most methods from the
  generic PCI bus driver, but uses the firmware for enumeration,
  performs additional initialization for devices and performs
  firmware-specific interrupt routing in a stub alloc_resource
  method. It also implements an OFW-specific method to allow child
  devices to get their firmware nodes.
- Introduce an OFW PCI-PCI bridge driver; again, it inherits most
  of the generic PCI-PCI bridge driver; it has it's own method for
  interrupt routing, as well as some sparc64-specific methods (one to
  get the node again, and one to adjust the bridge bus range, since
  we need to reenumerate all PCI buses).
- Convert the apb driver to the new way of handling things
- Provide a common framework for OFW bridge drivers, used be the two
  drivers above.
- Provide a small common framework for interrupt routing (for all
  bridge types).
- Convert the psycho driver to the new framework; this gets rid of a
  bunch of old kludges in pci_read_config(), and the whole
  preinitialization  (ofw_pci_init()).
- Convert the ISA MD part and the EBus driver to the new way
  interrupts and nodes are handled.
- Correct bogus intpin settings in the driver (and allow PCI devices
  to use pci_set_intpin() to make this possible).
- Introduce types for firmware interrupt properties.
- Rename the old sparcbus_if to ofw_pci_if (it is only required for
  PCI), and move it to a more correct location (new support methods
  were also added, and an old one was deprecated).
- Fix a bunch of minor bugs, perform some cleanups.

In some cases, I introduced some minor code duplication to keep the
new code clean, in hopes that the old code will be unifdef'ed soon.

Thanks,
	- Thomas

-- 
Thomas Moestl <t.moestl at tu-bs.de>	http://www.tu-bs.de/~y0015675/
              <tmm at FreeBSD.org>		http://people.FreeBSD.org/~tmm/
PGP fingerprint: 1C97 A604 2BD0 E492 51D0  9C0F 1FE6 4F1D 419C 776C


More information about the freebsd-sparc64 mailing list