summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw (follow)
Commit message (Collapse)AuthorAgeFilesLines
* msi-map-mask is a pasto and should be iommu-map-mask.patrick2021-03-141-2/+2
| | | | | From Jared McNeill at NetBSD ok kettenis@
* Implement IOMMU OFW API for on-SoC/non-PCI devices.patrick2021-02-282-2/+46
| | | | ok kettenis@
* Only support #iommu-cells = <1> for now to make sure the correct stream IDkettenis2021-02-261-17/+8
| | | | | | is passed to the IOMMU device driver. ok patrick@
* Add a framework for IOMMUs.kettenis2021-02-252-2/+108
| | | | ok patrick@
* Keep polling if a temperature sensor reading fails. This is neededkettenis2020-12-311-3/+3
| | | | | | | | on Amlogic SoCs where amltemp(4) doesn't fully attach before the first polling timeout runs. This would stop the polling which means there was no thermal management on these platforms. ok patrick@
* Enter power-saving mode on POWER9 (ISA v3)gkoehler2020-12-302-2/+19
| | | | | | | | | | | | | | | | | | | When opal(4) attaches, look in the device tree for a psscr value. In cpu_idle_cycle(), use this psscr value and the stop instruction to wait for the next interrupt. In mp kernels, cpu_unidle() now sends an interrupt. In "sysctl hw.sensors", the power and temperature sensors from opalsens(4) may show lower values. The cpu may exit stop at the system reset vector after losing user registers. If so, restore some registers. For now, ignore deeper stop states that would lose hypervisor registers. Our mp kernel uses only the first hardware thread of each core. Take the extra threads from the firmware and stop them forever; this may switch the core from SMT4 to single-thread mode and increase performance. partly by kettenis@, ok kettenis@
* Fix regulators that use "active-low" polarity. Our implementation nowkettenis2020-12-231-9/+16
| | | | | | | | | ignores the presence "enable-active-high" property and relies on the encode polarity of the GPIO in the flags in the device tree instead. This might not be the case for older device trees; such device trees should be fixed. ok patrick@
* Add symbolic constants related to open source and open drain GPIOs.kettenis2020-12-181-3/+10
| | | | ok patrick@
* Implement mii_byname().kettenis2020-11-302-9/+17
|
* Add SFP+ support, including support for direct attach cables.kettenis2020-11-141-1/+36
| | | | ok patrick@
* Add 1000baseT media support and set active media to the appropriate value.kettenis2020-11-121-4/+15
| | | | ok patrick@
* Add interfaces to control optical output of an SFP.kettenis2020-11-102-2/+33
| | | | ok claudio@, patrick@
* Add code to determine the supported media types from the SFP EEPROM.kettenis2020-11-082-3/+40
| | | | ok patrick@
* Add functions to set/add properties on an FDT node.kettenis2020-07-182-6/+122
| | | | ok visa@
* IEEE1275 (Open Firmware) defines that parameter name strings can have akettenis2020-07-062-7/+6
| | | | | | | | | | | | | | | | | | | | | | length of up to 31 characters. This limit is also present in the flattened device tree specification/ Unfortunately this limit isn't enforced by the tooling and there are systems in the wild that use longer strings. This includes the device trees used on POWER9 systems and has been seen on some ARM systems as well. So bump the buffer size from 32 bytes (31 + terminating NUL) to 64 bytes. Centrally define OFMAXPARAM to this value (in <dev/ofw/openfirm.h>) replacing the various OPROMMAXPARAM definition scattered around the tree to make sure the FDT implementation of OF_nextprop() uses the same buffer size as its consumers. Eliminate the static buffer in various openprom(4) implementations on FDT systems. Makes it possible to dump the full device tree on POWER9 systems using eeprom -p. ok deraadt@, visa@
* Add a "framework" for MII busses.patrick2020-06-252-2/+52
| | | | ok kettenis@
* Add a "framework" for digital audio interfaces.patrick2020-06-102-2/+69
| | | | ok kettenis@
* Some devices have no phandle since they are not referenced in thepatrick2020-06-063-3/+39
| | | | | | | | | | device tree, but they are still registered in our OFW framework. These then tend to have a phandle 0. If we are trying to lookup a device by phandle, we should explicitly check for phandle 0 and bail, since otherwise it is possible that we falsely match that phandle and return a device. ok kettenis@
* Add gpio support to bcmgpio(4) and make gpio(4) attach such that GPIOskettenis2020-04-271-1/+3
| | | | | | that aren't claimed by kernel drivers can be used from userland. ok sthen@
* Implement support for "usb-nop-xceiv" PHYs.kettenis2020-04-071-2/+41
| | | | ok jsg@
* Don't allocate a framebuffer if no interface ports have been configured.kettenis2020-03-222-5/+10
| | | | ok patrick@
* The #pwm-cells attribute describes the amount of flags in additionpatrick2020-03-211-3/+3
| | | | | | to the phandle, so adjust the check to be more inclusive. ok kettenis@
* Fix crash when no device ports have been registered. Remove unused variablekettenis2020-03-211-4/+2
| | | | | | while I'm there. ok patrick@
* Replace video "framework" with a more generic port/endpoint "framework".kettenis2020-03-162-48/+178
| | | | | | | This also adds panel support to rkanxdp(4). Code to hook up simplepanel(4) is still missing and will come later. ok patrick@
* When activating a video port, don't bail out if activating an endpointkettenis2020-03-011-3/+3
| | | | | | | fails. Not reporting an error in that case isn't ideal, but this gets us a bit further along in supporting drm(4) on RK3399 SoCs. ok patrick@
* Implement a rather simple video interface support for OFW. This ispatrick2020-02-212-2/+77
| | | | | | | good enough to make the Pinebook Pro work, but probably needs a lot more thinking. ok kettenis@
* Make thermal framework support in sxitemp(4) interrupt driven such thatkettenis2020-01-232-2/+21
| | | | | | it works with future Linux device trees. ok patrick@
* Add an interface to read an nvmem "cell".kettenis2020-01-232-5/+78
| | | | ok patrick@
* Add the beginnings of an nvmem "framework".kettenis2020-01-212-2/+46
| | | | ok patrick@
* Since device tree trip points might not be sorted, but our codepatrick2019-12-031-4/+19
| | | | | | | expected a sorted list, do the sorting ourselves upon parsing the trip points. ok kurt@
* Add a PWM framework.kettenis2019-09-302-2/+96
| | | | ok patrick@
* Reserve a few GPIO_CONFIG bits for machine-dependent use.visa2019-09-291-1/+5
| | | | No objection from kettenis@
* Add an SFP framework which allows SFP providers to provide apatrick2019-09-072-2/+48
| | | | | | method to access its pages. ok kettenis@
* Add an I2C framework, so that nodes that need to use I2C butpatrick2019-09-072-2/+61
| | | | | | are not children of the I2C controller are able to use it. ok kettenis@
* Add comment.kettenis2019-09-041-1/+5
|
* This code calls task_add(9) from a timeout, so create the taskq withkettenis2019-08-281-2/+2
| | | | | | IPL_SOFTCLOCK instead of IPL_NONE. ok mpi@, deraadt@, patrick@
* Add a PHY "framework".kettenis2019-08-282-2/+119
| | | | ok patrick@
* Implement GPIO hogging.kettenis2019-08-261-2/+48
| | | | ok patrick@
* Make sure fdt_get_reg() looks beyond its parent to establish the correctkettenis2019-08-101-31/+36
| | | | | | | | | #address-cells and #size-cells for the bus it sits on. This makes sure the glass console works since the framebuffer shows up as a child of /chosen which typically doesn't have these properties. This makes us look at the root node instead. ok patrick@
* Skip thermal zones without "trips" or "cooling-maps" nodes.kettenis2019-07-031-1/+6
|
* OF_finddevice(9) returns -1 if the node in question couldn't be found.kettenis2019-07-031-2/+2
|
* Add thermal zone handling code. This provides support for thermal zoneskettenis2019-07-023-1/+499
| | | | | | | | defined in device trees that link together thermal sensors and cooling devices to actively or passively cool devices when certain trip points are reached. ok mlarkin@ patrick@
* We are allowed to enable regulators with the "regulator-always-on"patrick2019-04-301-3/+3
| | | | | | | property. The definition is that a regulator with this property should never be disabled. ok kettenis@
* Add support for current limit regulators in addition to the voltagepatrick2019-02-202-27/+143
| | | | | | | | regulators we already support. The GPIO-based regulators are rather independent of the type, we only need to know the type to check the upper and lower limits. With feedback from kettenis@
* In the voltage regulator getter we need to actually check the GPIOpatrick2019-02-181-2/+3
| | | | | | | pin before setting the "pin is high" bit in the index for the states. Otherwise the index always has all possible bits sets. ok kettenis@
* Setting a fixed voltage regulator to the voltage it is fixed topatrick2019-01-021-1/+5
| | | | | | should not throw an error. ok kettenis@
* A fixed regulator's minimum voltage attribute is called regulator-min-microvoltpatrick2019-01-021-2/+2
| | | | | | instead of regulator-min-voltage. ok kettenis@
* Fix OFW GPIO regulator by breaking out of the loop once the correctpatrick2018-10-231-2/+4
| | | | | | | match has been found. Otherwise the error condition will always be true. ok kettenis@
* avoid uninitialised variable usejsg2018-08-281-1/+2
| | | | ok patrick@ kettenis@
* Support GPIO-based voltage regulators.patrick2018-08-131-2/+118
| | | | ok kettenis@