Commit Graph

17 Commits

Author SHA1 Message Date
Kyle Evans
e245e555fa raspberry pi 4: cpufreq support
The submitter notes that the bcm2835_cpufreq driver really just needs the
rpi4 compat string added to it; powerd subsequently works and the dev.cpu.0
sysctl values look sane and can be successfully manipulated.

Submitted by:	James Mintram <me@jamesrm.com>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D25349
2020-06-20 04:07:58 +00:00
Pawel Biernacki
7029da5c36 Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 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.

Mark all obvious cases as MPSAFE.  All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by:	kib (mentor, blanket)
Commented by:	kib, gallatin, melifaro
Differential Revision:	https://reviews.freebsd.org/D23718
2020-02-26 14:26:36 +00:00
Peter Jeremy
e446dd5d7d Fix cpufreq(4) on RPI-B
Since r324184 the root node compatible for the original Raspberry Pi
is "brcm,bcm2835", add it to the compatible list of bcm2835_cpufreq.

Tested On: RPi1 Model B

Note that the default Das U-Boot FDT does not include a cpus clause
so actually adding a bcm2835_cpufreq device requires adding a FDT
overlay defining the cpu.

Approved by:	grog, jhb (mentors)
MFC after:	3 days
2019-04-16 09:42:42 +00:00
Oleksandr Tymoshenko
adcd95974d [rpi] Fix compatiblity with upstream DTB for RPi 3B and 3B+
Upstream dtb switched to using brcm,bcm2837 for platform
compatibility string. Patch platfrom and cpufreq compatiblity
data accordingly.

Submitted by:	Sylvain Garrigues <sylgar@gmail.com>
Tested by:	db@
Differential Revision:	https://reviews.freebsd.org/D15998
2018-06-24 23:19:31 +00:00
Alexander Kabaev
151ba7933a Do pass removing some write-only variables from the kernel.
This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
2017-12-25 04:48:39 +00:00
Emmanuel Vadot
f362a3985c arm: rpi2: Fix cpufreq(4)
Since r324184 the root node compatible for rpi2 is "brcm,bcm2836", add
it to the compatible list of bcm2835_cpufreq.

Tested On: RPI2 v1.1 RPI2 v1.2

Reported by:	many on freebsd-arm@
2017-11-13 18:53:41 +00:00
Oleksandr Tymoshenko
f1f425aea0 [rpi] rpi3 should use the same cpufreq logic as rpi2, not rpi-b
RPi3 cpufreq is more like that on RPi2. Setting arm frequency
above min (say, "sysctl hw.cpufreq.arm_freq=600000001") turns on
turbo mode, and the firmware automatically raises voltage, sets
frequency to max 1200MHz, and throttle when overheat, etc.

Swap if/else parts and use SOC_BCM2835 def so RPi3 can share the
same cpufreq logic as RPi2, instead of falling to that for RPi.

Submitted by:	Jia-Shiun Li <jiashiun@gmail.com>
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9640
2017-03-04 17:34:36 +00:00
Andrew Turner
df7675353e Stop including fdt_common.h from the arm code when it's unneeded.
Sponsored by:	ABT Systems Ltd
2016-11-14 11:41:22 +00:00
Andrew Turner
87acb7f815 Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.
Sponsored by:	ABT Systems Ltd
2016-11-11 15:13:30 +00:00
Emmanuel Vadot
e374c33592 bcm2835_cpufreq: Only attach driver if we correcly match on the machine
compatible string.
2016-09-30 10:00:57 +00:00
Luiz Otavio O Souza
9d6672e13b Fix the deciKelvin to Celsius conversion in kernel.
After r285994, sysctl(8) was fixed to use 273.15 instead of 273.20 as 0C
reference and as result, the temperature read in sysctl(8) now exibits a
+0.1C difference.

This commit fix the kernel references to match the reference value used in
sysctl(8) after r285994.

Sponsored by:	Rubicon Communications (Netgate)
2016-05-22 13:58:32 +00:00
Oleksandr Tymoshenko
cd3903c620 Refactor bcm2835_cpufreq to use bcm2835_mbox_property API 2015-11-11 00:45:41 +00:00
Luiz Otavio O Souza
962940ce6c Add the SMP support for Raspberry Pi 2 (BCM2836).
Tested with the build of some ports and a buildworld.

Submitted by:	Daisuke Aoyama <aoyama@peach.ne.jp>
2015-05-07 22:11:44 +00:00
Luiz Otavio O Souza
11cede4873 Fix the voltage and clock levels for cpufreq on RPi 2.
Submitted by:	Daisuke Aoyama <aoyama@peach.ne.jp>
2015-05-04 00:01:35 +00:00
Luiz Otavio O Souza
e4b6eaf73a Fix the C -> K temperature conversion for the dev.cpu.0.temperature sysctl.
Previous code was discarding the last digit.

Remove the unused temperature conversion macros.
2015-01-15 01:05:05 +00:00
Luiz Otavio O Souza
e9faba9d70 Make consistent use of the correct debug macros across the file. 2014-12-27 13:17:27 +00:00
Rui Paulo
b9450e431d Driver for CPU frequency/voltage control on the Raspberry Pi.
Differential Revision:	https://reviews.freebsd.org/D1025
Submitted by:	Daisuke Aoyama aoyama@peach.ne.jp
Reviewed by:	ian (earlier version), rpaulo
MFC after:	1 month
Relnotes:	yes
2014-12-20 19:15:10 +00:00