| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Never used since import and probably just ported over from NetBSD as-is;
"design-capacity" does not exist in the device tree binding.
"monitor-interval-ms" defaults to 250ms as per binding and could be used
in the sensor_task_register() call, but our framework only supports whole
seconds and there's no advantage over our current fixed poll interval of 5s.
OK patrick
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current code looks for the nonexistent "cellwise,alert-level" property
and falls back to zero as threshold (like the original NetBSD code).
It also updates the CONFIG register with that very threshold to let the
hardware set a bit and thus alert us when it has been reached.
Since our sensor framework is designed to poll every N seconds and this
driver does not actually look at whether the hardware alerted, neither
using a default threshold of zero nor updating the hardware with it makes
sense.
Remove the alert level code and simply map >50%, >25% and <=25% of
remaining battery life to apm(4)'s "high", "low" and "critical" battery
state respectively; this matches exactly what acpibat(4) does and provides
more meaningful sensor readings without relying on nonexistent device tree
bindings.
Feedback OK patrick
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up to the previous commit:
This driver continues to report stale hw.sensors values when reading
them fails, which can easily be observed on a Pinebook Pro after
plugging in the AC cable, causing the hw.sensors.cwfg0.raw0 (battery
remaining minutes) value to jump considerably one or two times before
stalling and becoming incoherent with the rest.
Flag sensors invalid upfront in apm's fashion and mark them OK iff they
yield valid values; this is what other drivers such as rktemp(4) do,
but the consequence/intention of SENSOR_FINVALID is sysctl(8) and systat(8)
skipping such sensors (until AC gets plugged off again).
OK patrick
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
apm merely provides an all zero/unknown stub for those values, e.g. apm(8)
output is useless.
Hardware sensors however provide this information:
hw.sensors.cwfg0.volt0=3.76 VDC (battery voltage)
hw.sensors.cwfg0.raw0=259 (battery remaining minutes)
hw.sensors.cwfg0.percent0=58.00% (battery percent)
Make cwfg(4) copy those over using apm_setinfohook() for apm to show it:
Battery state: high, 58% remaining, 259 minutes life estimate
A/C adapter state: not known
Performance adjustment mode: auto (408 MHz)
In cwfg's update routine, to keep values coherent, always reset them to
zero/unknown and only set those that came from a valid reading.
Input OK jca
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
typically pass the physical address, however retrieved, to our PCIe
controller code. This physical address can in practise be directly
given to the PCIe, but it is not a given that the CPU and the PCIe
controller are able to use the same physical addresses.
This is even more obvious with an smmu(4) inbetween, which can change
the world view by introducing I/O virtual addresses. Hence for this
it is indeed necessary to map those pages, which thanks to integration
with bus_dma(9) works easily.
For this we remember the PCI devices' DMA tag in the interrupt handle
during the MSI map, so that we can use the smmu(4)-hooked DMA tag to
load the physical address.
While some systems might prefer to implement "trapping" pages for MSIs,
to make sure devices cannot trigger other devices' interrupts, we only
make sure the whole page is mapped.
Having the IOMMU create a mapping for each MSI is a bit wasteful, but
for now it's the simplest way to implement it.
Discussed with and ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Using the DTB from our dtb package this driver no longer attaches
(on a Pinebook Pro)due to renamed bindings:
https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/power/supply/cw2015_battery.yaml
Thanks to kettenis and patrick for pointing this out.
Follow upstream's rename and acccount for the monitor interval now being
milliseconds not seconds anymore.
This makes cwfg(4) export values under hw.sensors as expected when using
/usr/local/share/dtb/arm64/rockchip/rk3399-pinebook-pro.dtb .
Input patrick kettenis
OK kettenis
|
|
|
|
| |
ok matthieu@, jsg@
|
|
|
|
|
|
| |
hardware which include a common parent block in their device trees and
only enable the components that were actually implemented, as seen on
e.g. the NanoPi R4S.
|
|
|
|
|
|
|
|
| |
hardware which include a common parent block in their device trees and
only enable the components that were actually implemented, as seen on
e.g. the NanoPi R4S.
ok kettenis@
|
| |
|
|
|
|
|
|
|
| |
support for multiple linear ranges for voltage regulators and use for all
rkpmic ICs.
ok kettenis@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
based on Stream IDs. On the Armada 8040 these Stream IDs can
be configured in different registers. The PCIe controller has
a register which maps root port, bus, dev and func number to
the Stream ID. This should be set up by TF-A firmware, but on
the 8040 the current images don't do this. For chips with more
than one PCIe controller this register must be setup correctly
depending on the implementation, but on the 8040 there only is
one controller, so we can configure a fixed value to match what
is defined in the device tree. This allows the SMMU to properly
track the PCIe controller's transactions.
ok kettenis@
|
|
|
|
|
|
|
|
| |
While there, enable the different voltage regulators and set the
PHY's assigned clocks. This makes PCIe work on the NanoPi R4S.
Tested by kurt@ on Rock Pi N10 and ROCKPro64
ok kurt@ kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
| |
so that we can provide IOMMU-hooked bus DMA tags for each PCI device.
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
|
|
| |
This mostly adjust the interrupt masking and status support since this
variant lacks the UINTM and UINTP registers.
ok patrick@
|
|
|
|
| |
ok patrick@
|
|
|
|
|
|
|
|
|
| |
register. Use 32-bit reads and writes to access the URXH and UTXH
registers. They're documented as 32-bit registers in the Exynos 4 and
Exynos 5 User Manuals and accessing URXH with an 8-bit read triggers a
fault on Apple's M1 SoC.
ok patrick@
|
|
|
|
| |
ok kettenis@
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
&armv7_bs_tag with fdt_cons_bs_tag, which is our early console bus tag
for both arm64 and armv7. On armv7, it points to &armv7_bs_tag. With
this we can get rid of the armv7var.h include. Reduce a bit of diff to
imxuart(4).
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
|
|
|
|
| |
needed for >= linux 5.9 dtbs on bbb
ok kettenis@
|
|
|
|
|
|
|
| |
the EDK2-based UEFI firmware sets it to its own hardcoded values.
Makes device-tree mode work with newer versions of the Raspberry Pi firmware.
ok patrick@
|
|
|
|
| |
ok patrick@
|
| |
|
| |
|
|
|
|
| |
ok patrick@
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
a chance to attach. Needed for future support of PCIe on Amlogic SoCs.
ok patrick@
|
| |
|
| |
|
|
|
|
|
| |
usual fec(4), but also a variant of dwge(4). Unfortunately it seems to be
a newer version, which isn't compatible to the one currently in our tree.
|
|
|
|
| |
ok patrick@
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
the i.MX8MQ as well, but while upstreaming they were told to shove it. Now
for the i.MX8MP this glue is making a comeback. Apparently there's some
divergence in low power handling to the regular DWC3 IP with special IRQs.
Now the question remains if this driver will be obsolete soon again, or if
this time it's here to stay. The fun part is that while this driver was
written independent from the previous version, the diff is basically zero.
ok kettenis@
|
|
|
|
| |
ok kettenis@
|
| |
|
| |
|
| |
|
|
|
|
| |
bug in the Odroid C4/HC4 boards.
|
|
|
|
| |
device trees.
|