summaryrefslogtreecommitdiff
path: root/sys/dev/ofw
AgeCommit message (Collapse)Author
2024-07-01Don't crash if we can't read the temperature for a zone while polling it.Mark Kettenis
ok dv@
2024-06-27Implement an optional callback function for thermal sensors to set a tripMark Kettenis
limit to support thermal zones that don't do polling. Thermal sensor drivers should implement this callback if they can generate an interrupt when the trop limit is reached and should call thermal_senser_update() when that happens. ok dlg@
2024-06-14Disallow setting the voltage of coupled regulators for now. Some RK3588Mark Kettenis
boards use different regulators for CPU core voltage and memory interface voltage. But the two have to be kept synchronized. So the devicetree for these boards marks these regulators as coupled. We have no support for coupled regulators yet and letting the DVFS code set just the CPU core voltage would probably lead to strange crashes. ok mlarkin@
2024-05-13remove prototypes with no matching functionJonathan Gray
ok mpi@
2024-03-27Fix fdt_find_node(). We should make sure we match the full name whenMark Kettenis
matching path components (but we do allow matches with the @unit bit). This fixes a problem on the Milk-V Pioneer where /soc/serial@123456 accidentally match a /socket0-clocks node and we would fail to find the serial console. ok miod@
2023-11-23expose the state of thermal zones as kstats.David Gwynne
this makes it a bit more obvious how much head room you have for things like cpu performance scaling. the information provided at the moment is more useful for developers working on cpu scaling, but it should improve as i get my head around more of these things. patrick@ and kettenis@ like the idea.
2023-09-21Properly set up the IOMMU stream ID mapping. Needed for upcoming changesMark Kettenis
to apldart(4). ok patrick@
2023-05-17Add a framework for hardware locks.Patrick Wildt
ok kettenis@ drahn@
2023-04-26Fix phy_enable_prop_idx() to retrieve the property length with the passedPatrick Wildt
property name instead of "phys". ok dlg@
2023-04-26Fix my email address.Mark Kettenis
2023-04-15fixed regulators might rely on other regulators specified by "vin-supply"David Gwynne
when turning a fixed regulator on, turn on the regulator specified in vin-supply too. kettenis agrees we should do this.
2023-04-07fixed regulators could have a "gpios" or "gpio" property.David Gwynne
we only handled "gpio" before. figuring this out has wasted many days of my life recently. ok patrick@ kettenis@
2023-04-03add phy_enable_prop_idx() to work with phys under props other than "phy".David Gwynne
eg, the snps,dwc3 device tree bindings say that it uses a usb2 and usb3 phy, and they can be listed either "usb2-phy" and "usb3-phy" under the standard "phys" and "phy-names" properties supported by phy_enable(), or as slots 0 and 1 under a "usb-phy" properties. the latter would be supported by phy_enable_idx(), but it hardcodes "phys" as the property it looks at. phy_enable_prop_idx() is the same as phy_enable_prop_idx, but it lets you specify which property you're indexing into. ok kettenis@
2023-04-03special case phandle 0 and return NULL when looking up network interfaces.David Gwynne
not all interfaces will have a phandle (ie, it will be 0), so don't let phandle 0 be used to find any of these. discussed with miod@
2023-04-03add glue for network interfaces to be found by fdt/ofw node or phandle.David Gwynne
if we're going to support switch chips (eg, marvell link street switches as found on a3700 boards like the espressobin), then the device tree for switch ports identifies which network interface they're connected by by a reference (phandle) across the device tree. this lets network drivers register the ifnet struct with the associated node and phandle so the switch can find it and configure it for use with the switch. ok kettenis@
2023-04-01Implement regulator notifiers which get called when the voltage/currentMark Kettenis
for a regulator is changed or when the regulator gets initialized when it attaches for the first time. The latter makes it possible to register a notifier for a regulator that hasn't attached yet. ok dlg@
2022-12-17Make nvmem_read_cell() and nvmem_write_cell() work for hardware thatMark Kettenis
requires word-sized access. ok patrick@
2022-12-12Fix USB hotplug on type-C connectors of Apple Silicon hardware. The USBMark Kettenis
controller on these machines does not see connection events. Instead we need to rely on the USB PD controllers to notify us of a new connection and reset the USB controller. This diff implements this by adding a new tipd(4) driver and infrastructure to notify xhci(4) of new connections. ok patrick@
2022-11-09Implement wakeup interrupt support. For now this is only implemented forMark Kettenis
aplintc(4); other arm64 interrupt controllers will follow. ok patrick@
2022-11-07The ARM SMMUv2 does actually support #iommu-cells = <2>, where the secondPatrick Wildt
cell is used as a mask for SMR to match a number of IDs. So far we have asserted that it's always 1, so loosen the restriction and pass both cells instead of only the sid. ok kettenis@
2022-09-19Change OF_getnodebyname() such that looking up a node using just the namePatrick Wildt
without a unit number (so without the @1234 bit) works as well. This is a re-commit of the backed out change with the endless loop fixed.
2022-09-18Revert previous it prevents the PinebookPro and the Rockpro64 to reach userland.Martin Pieuchot
Found by kn@ and myself, ok deraadt@
2022-09-11Change OF_getnodebyname() such that lokking up a node using just the nameMark Kettenis
without a unit number (so without the @1234 bit) works as well. ok patrick@, gkoehler@
2022-09-02Add a callback for setting the TDM slot used by an audio codec.Mark Kettenis
Implement this callback in tascodec(4) such that we can pick the audio channel that it outputs. This will override the default which is to downmix stereo input from TDM channels 0 and 1 to mono output. ok ratchov@
2022-08-21prevent buffer overflow in OF_getpropint64array()Jasper Lievisse Adriaanse
just like -r1.28 did for OF_getpropintarray() ok kettenis@
2022-08-06Prevent buffer overflow in OF_getpropintarray().Mark Kettenis
ok jsg@
2022-03-25Implement support for the "bits" property for nvmem cells.Mark Kettenis
ok patrick@
2022-03-21Constify struct {audio,midi,radio,video}_hw_if. No functional change.Miod Vallat
ok mpi@ ratchov@ "More const is good" deraadt@
2022-03-02Add an interface to write to an nvmem cell.Mark Kettenis
ok patrick@
2022-02-14OF_getproplen() returns -1 on error, so don't store result in size_tJonathan Gray
spotted by and ok tb@, ok tobhe@
2022-02-04Add prototype for clock_set_frequency_idx().Mark Kettenis
2022-01-09spellingJonathan Gray
feedback and ok tb@ jmc@ ok ratchov@
2021-12-18Add a mailbox "framework" to handle mailboxes referenced in device treesMark Kettenis
in a generic way. ok visa@
2021-11-26Add interfaces to enable all power domains for a node.Mark Kettenis
ok patrick@, visa@
2021-06-25While it seems like we can choose any I/O virtual address for peripheralPatrick Wildt
devices, this isn't really the case. It depends on the bus topology of how devices are connected. In the case of PCIe, devices are assigned addresses (in PCI BARs) from the PCI address spaces. Now if we take an address from one of these address spaces for our IOVA, transfers from from a PCI device to that address will terminate inside of the PCI bus. This is because from the PCI buses' point-of-view, the address we chose is part of its address space. To make sure we don't allocate addresses from there, reserve the PCI addresses in the IOVA. Note that smmu(4) currently gives each device its own IOVA. So the PCI addresses will be reserved only in IOVA from PCI devices, and only the addresses concerning the PCI bus it is connected to will be reserved. All other devices behind an smmu(4) will not have any changes to their IOVA. ok kettenis@
2021-05-06Add OF_getpropbool(9).Mark Kettenis
ok visa@
2021-04-07Add graphaudio(4), a driver to support linking together audio componentsMark Kettenis
based on the audio graph description that uses ports and endpoints in the device tree. ok patrick@
2021-03-14msi-map-mask is a pasto and should be iommu-map-mask.Patrick Wildt
From Jared McNeill at NetBSD ok kettenis@
2021-02-28Implement IOMMU OFW API for on-SoC/non-PCI devices.Patrick Wildt
ok kettenis@
2021-02-26Only support #iommu-cells = <1> for now to make sure the correct stream IDMark Kettenis
is passed to the IOMMU device driver. ok patrick@
2021-02-25Add a framework for IOMMUs.Mark Kettenis
ok patrick@
2020-12-31Keep polling if a temperature sensor reading fails. This is neededMark Kettenis
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)gkoehler
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 nowMark Kettenis
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.Mark Kettenis
ok patrick@
2020-11-30Implement mii_byname().Mark Kettenis
2020-11-14Add SFP+ support, including support for direct attach cables.Mark Kettenis
ok patrick@
2020-11-12Add 1000baseT media support and set active media to the appropriate value.Mark Kettenis
ok patrick@
2020-11-10Add interfaces to control optical output of an SFP.Mark Kettenis
ok claudio@, patrick@
2020-11-08Add code to determine the supported media types from the SFP EEPROM.Mark Kettenis
ok patrick@