Commit Graph

14 Commits

Author SHA1 Message Date
Emmanuel Vadot
d6b4447496 allwinner: aw_thermal: Cope with DTS changes
The upstream DTS now include the thermal device node and the SID
calibration entry.
Update our driver to cope with this change and remove the DTB
overlays that aren't needed anymore.

MFC after:	2 months
X-MFC-With:	r359934
2020-04-14 19:05:17 +00:00
Pawel Biernacki
8eea36ae5b Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (13 of many)
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Approved by:	kib (mentor, blanket)
Differential Revision:	https://reviews.freebsd.org/D23635
2020-02-24 10:45:22 +00:00
Emmanuel Vadot
357145a0ce Remove "all rights reserved" from copyright for the file that Jared McNeill
own. He gave me permission to do this.
2019-12-03 21:05:33 +00:00
Conrad Meyer
e2e050c8ef Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h"
in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header
pollution substantially.

EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c
files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).

As a side effect of reduced header pollution, many .c files and headers no
longer contain needed definitions.  The remainder of the patch addresses
adding appropriate includes to fix those files.

LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by
sys/mutex.h since r326106 (but silently protected by header pollution prior
to this change).

No functional change (intended).  Of course, any out of tree modules that
relied on header pollution for sys/eventhandler.h, sys/lock.h, or
sys/mutex.h inclusion need to be fixed.  __FreeBSD_version has been bumped.
2019-05-20 00:38:23 +00:00
Emmanuel Vadot
f9b1c6a029 arm: allwinner: Add pnp info to aw_thermal and compile it as module too
MFC after:	1 month
2019-04-25 18:39:41 +00:00
Emmanuel Vadot
d19afc9abf aw_thermal: Add nvmem and H5 support
Now that aw_sid expose nvmem interface, use that to read the calibration
data.
Add support for H5 SoC.
Fix the bindings, we used to have non-upstreamed bindings. Switch to the
one that have been sent upstream. They are not stable yet, so we switch
from custom, wrong, bindings to correct, proposed bindings
2018-08-06 05:36:00 +00:00
Emmanuel Vadot
97eb836f8b aw_sid: Add nvmem interface
Rework aw_sid so it can work with the nvmem interface.
Each SoC expose a set of fuses (for now rootkey/boardid and, if available,
the thermal calibration data). A fuse can be private or public, reading private
fuse needs to be done via some registers instead of reading directly.
Each fuse is exposed as a sysctl.
For now leave the possibility for a driver to read any fuse without using
the nvmem interface as the awg and emac driver use this to generate a mac
address.
2018-08-06 05:35:24 +00:00
Jared McNeill
0a30b4b2a5 On H3, initialize alarm and shutdown trip points and do temperature
conversion as it is done in the BSP.
2016-11-19 14:56:22 +00:00
Jared McNeill
bd95d8610a Fix H3 temperature reporting. The formula in for V1.0 of the H3 datasheet
seems to be incorrect, so use the same method of conversion as the H3 BSP
instead.
2016-10-30 14:39:33 +00:00
Jared McNeill
2e4f934752 Defer cpufreq updates from intr handler to the taskqueue_thread queue. 2016-10-24 22:35:12 +00:00
Jared McNeill
3c2b90f1d1 Throttle CPU frequency when hot temperature threshold has been reached to
prevent overheating.

When sensor 0's alarm interrupt is fired, set a throttle flag. Further
requests to set CPU frequency will be rejected until sensor 0's temperature
returns to a level below the hot temperature threshold.

Relnotes:	yes
2016-10-23 17:48:34 +00:00
Jared McNeill
4e7f43bab6 Add support for the Allwinner H3 Thermal Sensor Controller. The H3 embeds
a single thermal sensor located in the CPU.
2016-09-05 11:05:14 +00:00
Jared McNeill
d69d5ab04f Add support for Allwinner A64 thermal sensors. 2016-09-03 15:26:00 +00:00
Jared McNeill
343044c43b Add Allwinner A83T thermal sensor controller support.
The A83T thermal sensor controller has three sensors. Sensor 0 corresponds
to CPU cluster 0, sensor 1 to CPU cluster 1, and sensor 2 to the GPU. This
driver exports the temperature sensor readings via sysctl.

Calibration data is obtained from SRAM found in the Secure ID module.

Reviewed by:		manu
Differential Revision:	https://reviews.freebsd.org/D6378
2016-05-15 22:36:55 +00:00