History log of /freebsd-current/sys/arm/broadcom/bcm2835/bcm2835_cpufreq.c
Revision Date Author Comments
# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 82d4dc06 09-May-2022 John Baldwin <jhb@FreeBSD.org>

arm/arm64 broadcom: Remove unused devclass arguments to DRIVER_MODULE.


# 65454883 01-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

arm: clean up empty lines in .c and .h files


# 7413ae0e 28-Jul-2020 Andrew Turner <andrew@FreeBSD.org>

Switch the bcm2835 cpufreq driver to use the firmware interface

Use the new Raspberry Pi firmware driver in the cpufreq driver. It is
intended all drivers that need to interact with the firmware will move to
use the firmware driver, this is the first.

Reviewed by: manu
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D25609


# e245e555 19-Jun-2020 Kyle Evans <kevans@FreeBSD.org>

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


# 7029da5c 26-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

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


# e446dd5d 16-Apr-2019 Peter Jeremy <peterj@FreeBSD.org>

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


# adcd9597 24-Jun-2018 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

[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


# 151ba793 24-Dec-2017 Alexander Kabaev <kan@FreeBSD.org>

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


# f362a398 13-Nov-2017 Emmanuel Vadot <manu@FreeBSD.org>

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@


# f1f425ae 04-Mar-2017 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

[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


# df767535 14-Nov-2016 Andrew Turner <andrew@FreeBSD.org>

Stop including fdt_common.h from the arm code when it's unneeded.

Sponsored by: ABT Systems Ltd


# 87acb7f8 11-Nov-2016 Andrew Turner <andrew@FreeBSD.org>

Use the modern spelling of ofw_bus_node_is_compatible in sys/arm.

Sponsored by: ABT Systems Ltd


# e374c335 30-Sep-2016 Emmanuel Vadot <manu@FreeBSD.org>

bcm2835_cpufreq: Only attach driver if we correcly match on the machine
compatible string.


# 9d6672e1 22-May-2016 Luiz Otavio O Souza <loos@FreeBSD.org>

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)


# cd3903c6 10-Nov-2015 Oleksandr Tymoshenko <gonzo@FreeBSD.org>

Refactor bcm2835_cpufreq to use bcm2835_mbox_property API


# 962940ce 07-May-2015 Luiz Otavio O Souza <loos@FreeBSD.org>

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>


# 11cede48 03-May-2015 Luiz Otavio O Souza <loos@FreeBSD.org>

Fix the voltage and clock levels for cpufreq on RPi 2.

Submitted by: Daisuke Aoyama <aoyama@peach.ne.jp>


# e4b6eaf7 14-Jan-2015 Luiz Otavio O Souza <loos@FreeBSD.org>

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.


# e9faba9d 27-Dec-2014 Luiz Otavio O Souza <loos@FreeBSD.org>

Make consistent use of the correct debug macros across the file.


# b9450e43 20-Dec-2014 Rui Paulo <rpaulo@FreeBSD.org>

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