summaryrefslogtreecommitdiffstats
path: root/sys/sparc64/pci/ofw_pcibus.c
Commit message (Collapse)AuthorAgeFilesLines
* Delete the unused/not really used sparc64 (as in sun4u) cache.h,marius2007-05-201-2/+2
| | | | | | iommureg.h (which already began to bitrot) and iommuvar.h from the sun4v source and adjust some of the source which is shared between sparc64 and sun4v as appropriate.
* In ofw_pcibus_attach() skip dupe PCI devices reported by themarius2007-01-081-0/+2
| | | | | | | | | | | | | | | | | | firmware (mainly 'pmu' and its 'lomp' dupe found in a couple of later USII{e,i}-based machines) by checking whether a device with the same triple of bus number, slot and function already has been added. This is the simple yet effective approach introduced in OpenBSD some time ago, but which has the flaw that it assumes that the device and its dupe(s) found in the OFW device tree are equal or at least the one encountered first is in some way the more important one (this is the case with 'pmu' and 'lomp'; the 'pmu' node has couple of properties and children while the 'lomp' one misses most of these). If there's ever a device/dupe pair where we don't encounter the more important node first, we'll probably need to introduce a quirk list in order to add the desired device but prevent its dupe(s) from being added. MFC after: 1 week
* kernel clean up to make the sun4v kernel buildkmacy2006-10-091-2/+8
| | | | | Reviewed by: jmg Approved by: rwatson (mentor)
* Make the ACPI and OpenFirmware PCI bus drivers subclasses of the genericjhb2006-01-201-35/+3
| | | | PCI bus driver.
* Add a new method PCI_FIND_EXTCAP() to the pci bus interface that is usedjhb2005-12-201-0/+1
| | | | | | | to search for a specific extended capability. If the specified capability is found for the given device, then the function returns success and optionally returns the offset of that capability. If the capability is not found, the function returns an error.
* - Adhere style(9) (don't use function calls in initializers, use uintXX_tmarius2005-12-031-1/+3
| | | | | instead of u_intXX_t). - Use FBSDID.
* - Convert these bus drivers to make use of the newly introduced set ofmarius2005-11-221-80/+27
| | | | | | | | | | | | | ofw_bus_gen_get_*() for providing the ofw_bus KOBJ interface in order to reduce code duplication. - While here sync the various sparc64 bus drivers a bit (handle failure to attach a child gracefully instead of panicing, move the printing of child resources common to bus_print_child() and bus_probe_nomatch() implementations of a bus into a <bus>_print_res() function, ...) and fix some minor bugs and nits (plug memory leaks present when attaching a bus or child device fails, remove unused struct members, ...). Additional testing by: kris (central(4) and fhc(4))
* fix kldloading of pci driver modules after boot on sparc64... sincejmg2005-03-231-1/+1
| | | | | | | we weren't using the pci module, we weren't restoring the pci state... Submitted by: imp MFC after: 5 days
* At least on some U30 there's a spurious duplicate device node of an EBusmarius2005-01-201-5/+12
| | | | | | | | | | | | bridge in the device tree which lacks the mandatory (also by the OFW PCI bus binding spec) "reg" property. Change the code to just ignore nodes missing the "reg" property instead of panicing when encountering such a node. Also ignore nodes without a "name" property (guaranteed by the OFW PCI bus binding spec). This brings the behaviour of the MD OFW PCI code regarding such incomplete nodes in line with the EBus and the SBus code. Tested by: Cyril Tikhomiroff <tikho@anor.net> MFC after: 1 month
* Correct some uses of the wrong members of the *min()/*max()-familiy, e.g.marius2004-08-151-2/+2
| | | | | | min() on unsigned long. None of these are believed to have been fatal though. Reviewed by: tmm
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and amarius2004-08-121-9/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
* Add the new sparc64 OFW PCI framework, conditional on options OFW_NEWPCItmm2003-07-011-0/+264
for now. It introduces a OFW PCI bus driver and a generic OFW PCI-PCI bridge driver. By utilizing these, the PCI handling is much more elegant now. The advantages of the new approach are: - 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. There was also a report that previously bogus interrupt assignments are fixed now, which can be attributed to the new heuristics. A pitfall, and the reason why this is not the default yet, is that it changes device enumeration, as mentioned above, which can make it necessary to change the system configuration if more than one unit of a device type is present (on a system with two hme cars, for example, it is possible that hme0 becomes hme1 and vice versa after enabling the option). Systems with multiple disk controllers may need to be booted into single user (and require manual specification of the root file system on boot) to adjust the fstab. Nevertheless, I would like to encourage users to use this option, so that it can be made the default soon. In detail, 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 firmware-specific interrupt routing. 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. - Introduce types for firmware interrupt properties. - Rename the old sparcbus_if to ofw_pci_if by repo copy (it is only required for PCI), and move it to a more correct location (new support methodsx 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. Reviewed in part by: imp Tested by: jake, Marius Strobl <marius@alchemy.franken.de>, Sergey Mokryshev <mokr@mokr.net>, Chris Jackman <cjackNOSPAM@klatsch.org> Info on u30 firmware provided by: kris
OpenPOWER on IntegriCloud