summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
AgeCommit message (Collapse)AuthorFilesLines
2021-03-14msi-map-mask is a pasto and should be iommu-map-mask.patrick1-2/+2
From Jared McNeill at NetBSD ok kettenis@
2021-02-28Implement IOMMU OFW API for on-SoC/non-PCI devices.patrick2-2/+46
ok kettenis@
2021-02-26Only support #iommu-cells = <1> for now to make sure the correct stream IDkettenis1-17/+8
is passed to the IOMMU device driver. ok patrick@
2021-02-25Add a framework for IOMMUs.kettenis2-2/+108
ok patrick@
2020-12-31Keep polling if a temperature sensor reading fails. This is neededkettenis1-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@
2020-12-30Enter power-saving mode on POWER9 (ISA v3)gkoehler2-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@
2020-12-23Fix regulators that use "active-low" polarity. Our implementation nowkettenis1-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@
2020-12-18Add symbolic constants related to open source and open drain GPIOs.kettenis1-3/+10
ok patrick@
2020-11-30Implement mii_byname().kettenis2-9/+17
2020-11-14Add SFP+ support, including support for direct attach cables.kettenis1-1/+36
ok patrick@
2020-11-12Add 1000baseT media support and set active media to the appropriate value.kettenis1-4/+15
ok patrick@
2020-11-10Add interfaces to control optical output of an SFP.kettenis2-2/+33
ok claudio@, patrick@
2020-11-08Add code to determine the supported media types from the SFP EEPROM.kettenis2-3/+40
ok patrick@
2020-07-18Add functions to set/add properties on an FDT node.kettenis2-6/+122
ok visa@
2020-07-06IEEE1275 (Open Firmware) defines that parameter name strings can have akettenis2-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@
2020-06-25Add a "framework" for MII busses.patrick2-2/+52
ok kettenis@
2020-06-10Add a "framework" for digital audio interfaces.patrick2-2/+69
ok kettenis@
2020-06-06Some devices have no phandle since they are not referenced in thepatrick3-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@
2020-04-27Add gpio support to bcmgpio(4) and make gpio(4) attach such that GPIOskettenis1-1/+3
that aren't claimed by kernel drivers can be used from userland. ok sthen@
2020-04-07Implement support for "usb-nop-xceiv" PHYs.kettenis1-2/+41
ok jsg@
2020-03-22Don't allocate a framebuffer if no interface ports have been configured.kettenis2-5/+10
ok patrick@
2020-03-21The #pwm-cells attribute describes the amount of flags in additionpatrick1-3/+3
to the phandle, so adjust the check to be more inclusive. ok kettenis@
2020-03-21Fix crash when no device ports have been registered. Remove unused variablekettenis1-4/+2
while I'm there. ok patrick@
2020-03-16Replace video "framework" with a more generic port/endpoint "framework".kettenis2-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@
2020-03-01When activating a video port, don't bail out if activating an endpointkettenis1-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@
2020-02-21Implement a rather simple video interface support for OFW. This ispatrick2-2/+77
good enough to make the Pinebook Pro work, but probably needs a lot more thinking. ok kettenis@
2020-01-23Make thermal framework support in sxitemp(4) interrupt driven such thatkettenis2-2/+21
it works with future Linux device trees. ok patrick@
2020-01-23Add an interface to read an nvmem "cell".kettenis2-5/+78
ok patrick@
2020-01-21Add the beginnings of an nvmem "framework".kettenis2-2/+46
ok patrick@
2019-12-03Since device tree trip points might not be sorted, but our codepatrick1-4/+19
expected a sorted list, do the sorting ourselves upon parsing the trip points. ok kurt@
2019-09-30Add a PWM framework.kettenis2-2/+96
ok patrick@
2019-09-29Reserve a few GPIO_CONFIG bits for machine-dependent use.visa1-1/+5
No objection from kettenis@
2019-09-07Add an SFP framework which allows SFP providers to provide apatrick2-2/+48
method to access its pages. ok kettenis@
2019-09-07Add an I2C framework, so that nodes that need to use I2C butpatrick2-2/+61
are not children of the I2C controller are able to use it. ok kettenis@
2019-09-04Add comment.kettenis1-1/+5
2019-08-28This code calls task_add(9) from a timeout, so create the taskq withkettenis1-2/+2
IPL_SOFTCLOCK instead of IPL_NONE. ok mpi@, deraadt@, patrick@
2019-08-28Add a PHY "framework".kettenis2-2/+119
ok patrick@
2019-08-26Implement GPIO hogging.kettenis1-2/+48
ok patrick@
2019-08-10Make sure fdt_get_reg() looks beyond its parent to establish the correctkettenis1-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@
2019-07-03Skip thermal zones without "trips" or "cooling-maps" nodes.kettenis1-1/+6
2019-07-03OF_finddevice(9) returns -1 if the node in question couldn't be found.kettenis1-2/+2
2019-07-02Add thermal zone handling code. This provides support for thermal zoneskettenis3-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@
2019-04-30We are allowed to enable regulators with the "regulator-always-on"patrick1-3/+3
property. The definition is that a regulator with this property should never be disabled. ok kettenis@
2019-02-20Add support for current limit regulators in addition to the voltagepatrick2-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@
2019-02-18In the voltage regulator getter we need to actually check the GPIOpatrick1-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@
2019-01-02Setting a fixed voltage regulator to the voltage it is fixed topatrick1-1/+5
should not throw an error. ok kettenis@
2019-01-02A fixed regulator's minimum voltage attribute is called regulator-min-microvoltpatrick1-2/+2
instead of regulator-min-voltage. ok kettenis@
2018-10-23Fix OFW GPIO regulator by breaking out of the loop once the correctpatrick1-2/+4
match has been found. Otherwise the error condition will always be true. ok kettenis@
2018-08-28avoid uninitialised variable usejsg1-1/+2
ok patrick@ kettenis@
2018-08-13Support GPIO-based voltage regulators.patrick1-2/+118
ok kettenis@