Commit Graph

16 Commits

Author SHA1 Message Date
Emmanuel Vadot
e3637e41e3 arm: allwinner: aw_sid: Fix thermal calibration size for A64
This fixes the aw_thermal driver on A64 SoC.

MFC after:	1 month
X-MFC-With:	r359935
2020-04-15 13:35:28 +00:00
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
Emmanuel Vadot
cfc8861b06 allwinner: Rework the BUS_PASS on drivers
- Put all clock and control unit driver in BUS_PASS_RESOURCE except
  for the DE2 CCU as it needs the main CCU to be available.
- Use BUS_PASS_CPU for a20_cpu_cfg as it makes more sense.
- For aw_syscon use SCHEDULER pass as we need it early for drivers
  that attach in BUS_PASS_SUPPORTDEV
- For the rest we can use BUS_PASS_SUPPORTDEV
2019-08-10 17:58:30 +00:00
Emmanuel Vadot
db0e5bf390 arm: allwinner: Add pnpinfo for aw_sid and add module Makefile
MFC after:	1 month
2019-04-25 18:38:38 +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
Kyle Evans
4a432d6fa5 aw_sid(4): Use prctl read for all reads when it's required
It was later found that some operation on the OrangePi one will cause
direct accesses to the eeprom to return wrong data again, so reading it all
once via prctl at attach time is no longer sufficient.
2018-04-06 15:17:09 +00:00
Kyle Evans
6dd381416b aw_sid(4): Release resources and destroy mutex on failure
Submitted by:	Eugene Sevastyanov <eval@iptk.ru>
2018-03-26 14:03:39 +00:00
Kyle Evans
92e80162f3 aw_sid(4): Add support for Allwinner H3
The sid controller on the H3 is generally identical in location, size, and
efuse offset to the a64 and the a83t. The main difference is that the H3 has
a silicon bug that sometimes causes the rootkey (at least) to be garbled
unless first read by the prctl registers.

This device is currently not in our DTS and, as of now, is not yet present
in mainline Linux DTS.

Tested on:	OrangePi One
2018-01-07 04:59:28 +00:00
Kyle Evans
86c6868161 aw_sid: Add method for reading keys via prctl registers
Technically supported on the later SoCs, this will only really be used to
add support for the H3 sid. The H3 has a silicon bug that manifests itself
by returning garbled rootkeys unless first read via the prctl registers.
2018-01-07 03:31:55 +00:00
Kyle Evans
07bd38576d aw_sid: Add support for a64
Newer Allwinner SoCs have nearly identical SID controllers with efuse space
starting at 0x200 into their register space and thermal data available at
0x234, making all of these fairly trivial additions.

The h3 will be added at a later time after some testing, due to a silicon
bug that causes the rootkey (at least) to be read incorrectly unless first
read via the control register.
2017-12-31 22:35:32 +00:00
Kyle Evans
1ccce047f5 aw_sid: rewrite compat-string configuration to be more flexible
This will allow easiser support in the future for boards that have thermal
data and different offsets for root key/efuse data.
2017-12-31 06:44:15 +00:00
Jared McNeill
0503b90dde Add support for reading root key on A83T/A64. 2016-09-03 15:22:50 +00:00
Emmanuel Vadot
280ab2edb1 Add support for the SID (Security ID Module) on Allwinner A10 and A20.
The rootkey is burnt at production and can't be changed, thus is can be used
as a device unique ID or to generate a MAC address (This is was u-boot does).
The rootkey is exposed as a sysctl (dev.aw_sid.<unit>.rootkey).

Reviewed by:	jmcneill
Differential Revision:	https://reviews.freebsd.org/D6383
2016-07-20 11:23:06 +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