aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ofw/ofw_bus_if.m
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in current: (cherry picked from commit 031beb4e239b)
* Move gpiobus routines to dev/gpio. Avoid polluting ofw_bus with busLuiz Otavio O Souza2014-05-041-30/+0
| | | | | | | | | specific parts. Requested by: nwhitehorn Notes: svn path=/head/; revision=265310
* Fix the gpio-specifier decoding by respecting the GPIO controller'sLuiz Otavio O Souza2014-04-271-1/+29
| | | | | | | | | | | | | | | | | #gpio-cells property. Add a new ofw_bus method (OFW_BUS_MAP_GPIOS()) that allows the GPIO controller to implement its own mapping to deal with gpio-specifiers, allowing the decoding of gpio-specifiers to be controller specific. The default ofw_bus_map_gpios() decodes the linux standard (#gpio-cells = <2>) and the FreeBSD standard (#gpio-cells = <3>). It pass the gpio-specifier flag field to the children as an ivar variable so they can act upon. Notes: svn path=/head/; revision=265012
* Add a set of helpers (ofw_bus_get_status() and ofw_bus_status_okay()) toNathan Whitehorn2014-02-021-0/+1
| | | | | | | | | | | | process "status" properties of OF nodes. I've avoided adding new KOBJ methods here so that we don't have to modify every ofw_bus in the tree. Since 100% of implementations of ofw_bus use only ofw_bus_gen_*(), it might be worth garbage-collecting the other methods as well. Notes: svn path=/head/; revision=261403
* Open Firmware interrupt specifiers can consist of arbitrary-length byteNathan Whitehorn2014-02-011-26/+7
| | | | | | | | | | | | strings and include arbitrary information (IRQ line/domain/sense). When the ofw_bus_map_intr() API was introduced, it assumed that, as on most systems, these were either 1 cell, containing an interrupt line, or 2, containing a line number plus a sense code. It turns out a non-negligible number of ARM systems use 3 (or even 4!) cells for interrupts, so make this more general. Notes: svn path=/head/; revision=261351
* Fix a typo on a comment in ofw_bus_if.m, the default method will return -1Luiz Otavio O Souza2013-11-121-1/+1
| | | | | | | | | | when a node doesn't exist. Reviewed by: nwhitehorn Approved by: adrian (mentor) Notes: svn path=/head/; revision=258046
* Add two new interfaces to ofw_bus:Nathan Whitehorn2013-10-231-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | - ofw_bus_map_intr() Maps an (iparent, IRQ) tuple to a system-global interrupt number in some platform dependent way. This is meant to be implemented as a replacement for [FDT_]MAP_IRQ() that is an MI interface that knows about the bus hierarchy. - ofw_bus_config_intr() Configures an interrupt (previously mapped) based on firmware sense flags. This replaces manual interpretation of the sense field in bus drivers and will, in a follow-up, allow that interpretation to be redirected to the PIC drivers where it belongs. This will eventually replace the tables in /sys/dev/fdt/fdt_ARCH.c The PowerPC/AIM code has been converted to use these globally, with an implementation in terms of MAP_IRQ() and powerpc_config_intr(), assuming OpenPIC, at the bus root in nexus(4). The ofw_bus_config_intr() will shortly be integrated into pic_if.m and bounced through nexus into the PIC tree. FDT integration will happen significantly later due to larger testing requirements. This patch in general also lays the groundwork for the removal of /sys/dev/fdt/fdt_ARCH.c and machine/fdt.h. Notes: svn path=/head/; revision=256994
* Make ofw_bus_get_node() consistently return -1 when there is no associatedNathan Whitehorn2012-03-151-1/+1
| | | | | | | | | | OF node, instead of a random mixture of 0 and -1. Update all checks for 0 to check for -1 instead. MFC after: 4 weeks Notes: svn path=/head/; revision=233018
* - Add a new method ofw_bus_default_get_devinfo() that allows to retrieveMarius Strobl2005-11-221-2/+36
| | | | | | | | | | | | | | | | | | | a newly introduced struct ofw_bus_devinfo which can hold the OFW info of a device recallable via the ofw_bus KOBJ interface. Introduce a set of functions ofw_bus_gen_get_*() which use ofw_bus_default_get_devinfo() to provide generic subroutines for implementing the rest of the ofw_bus KOBJ interface in a bus driver. This is inspired by bus_get_resource_list() and bus_generic_rl_*_resource() and allows to reduce code duplication in bus drivers as they only have to provide an ofw_bus_default_get_devinfo() implementation in order to provide the ofw_bus KOBJ interface via ofw_bus_gen_get_*(). - While here add a comment to ofw_bus_if.m describing the intention of the ofw_bus KOBJ interface. Reviewed by: marcel Notes: svn path=/head/; revision=152683
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-0/+1
| | | | Notes: svn path=/head/; revision=139749
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and aMarius Strobl2004-08-121-0/+110
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 Notes: svn path=/head/; revision=133589