History log of /freebsd-current/sys/dev/ofw/ofw_cpu.c
Revision Date Author Comments
# be82b3a0 26-Dec-2023 Emmanuel Vadot <manu@FreeBSD.org>

clk: Move clock code in dev/clk

We've removed kernel option EXT_RESOURCES almost two years ago.
While it was ok to have some code under a common 'extres' subdirectory
at first, we now have a lot of consumer of it and we made it mandatory
so no need to have it under a cryptic name.

Reviewed by: mhorne
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D43191


# 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/


# 08637d5d 24-May-2023 Mitchell Horne <mhorne@FreeBSD.org>

ofw_cpu: quiet secondary CPU devices

We already do plenty to announce the different CPUs in dmesg. Follow the
ACPI CPU strategy of reporting the first CPU device, but quieting the
rest for non-verbose boot. This cuts down slightly on dmesg output.

Reviewed by: manu, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40243


# 5edffecc 24-May-2023 Mitchell Horne <mhorne@FreeBSD.org>

ofw_cpu: whitespace cleanup

Reviewed by: jhb, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40242


# 7b5d62bb 18-Oct-2022 Takanori Watanabe <takawata@FreeBSD.org>

ofw: add BUS_GET_DEVICE_PATH interface to openfirm/fdt, somewhat incomplete.

This add BUS_GET_DEVICE_PATH interface,
which shows device tree of openfirm/fdt.

In qemu-system-arm64 with "virt" machine with device-tree firmware,
% devctl getpath OFW cpu0

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D37031


# 03f6459c 09-May-2022 John Baldwin <jhb@FreeBSD.org>

ofw drivers: Remove unused devclass arguments to DRIVER_MODULE.


# 02398e58 11-Jan-2022 Emmanuel Vadot <manu@FreeBSD.org>

ofw_cpu: Make ext_resources non-optional for arm* and riscv

EXT_RESOURCES have been introduced in 12-CURRENT and all supported
releases have it enabled in their kernel config.
For RISC-V it was always enabled.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D33835


# ddfc9c4c 22-Jun-2021 Warner Losh <imp@FreeBSD.org>

newbus: Move from bus_child_{pnpinfo,location}_src to bus_child_{pnpinfo,location} with sbuf

Now that the upper layers all go through a layer to tie into these
information functions that translates an sbuf into char * and len. The
current interface suffers issues of what to do in cases of truncation,
etc. Instead, migrate all these functions to using struct sbuf and these
issues go away. The caller is also in charge of any memory allocation
and/or expansion that's needed during this process.

Create a bus_generic_child_{pnpinfo,location} and make it default. It
just returns success. This is for those busses that have no information
for these items. Migrate the now-empty routines to using this as
appropriate.

Document these new interfaces with man pages, and oversight from before.

Reviewed by: jhb, bcr
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29937


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

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


# bc9ba24f 31-Jul-2018 Emmanuel Vadot <manu@FreeBSD.org>

ofw_cpu: Add support for getting cpu clock via clock property

Nominal Mhz is either expressed via the clock-frequency property
or can be get via the clock property that holds the cpu clock.
Add support for the later.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D16346


# d23d5d73 20-Jun-2018 Justin Hibbits <jhibbits@FreeBSD.org>

Attach dev.cpu nodes on powerpc SMT cores, using only the first found thread

Summary: In order to use cpufreq(4), a dev.cpu attachment must be created. If
the IBM property is found denoting SMT, attach only to the first thread setup,
so that a cpufreq device can bind.

Reviewed by: nwhitehorn
Differential Revision: https://reviews.freebsd.org/D15921


# 763864aa 25-Nov-2017 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Do not bind to CPUs with SMT, which use a different CPU numbering convention
that does not play well with this driver.

MFC after: 2 weeks


# 5d840968 20-Apr-2017 Olivier Houchard <cognet@FreeBSD.org>

Update comment ot reflect realilty, we know also take care of CPUs that
provide a enable-method.

Suggested by: jhibbits


# 21ce594e 20-Apr-2017 Olivier Houchard <cognet@FreeBSD.org>

ePAPR states that any non-boot CPU will come in "disabled" state. So we should
not consider a "disabled" cpu as a CPU we have to ignore, and we should use
them if they provide a "enable-method".
While I'm there, support "ok" as well as "okay", while ePAPR only accepts
"okay", linux accepts "ok" too so we can expect it to be used.

Reviewed by: andrew (partially)


# 8b21d6ae 28-Jul-2015 Zbigniew Bodek <zbb@FreeBSD.org>

Limit ofw_cpu_early_foreach() to CPUs only

On some platforms, the /cpus node contains cpu-to-cluster
map which deffinitely is not a CPU node. Its presence was
causing incrementing of "id" variable and reporting more
CPUs available than it should.
To make "id" valid, increment it only when an entry really
is a CPU device.

Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3216


# 16a1c0a8 19-Feb-2015 Andrew Turner <andrew@FreeBSD.org>

Adda function to iterate over the cpu nodes in the OFW or FDT data. This
will be used with arm64 to find which cpus to enable, and could also be
used with 32-bit arm and mips for the same purpose.

Differential Revision: https://reviews.freebsd.org/D1825
Sponsored by: The FreeBSD Foundation


# deb77283 18-Feb-2015 Andrew Turner <andrew@FreeBSD.org>

Add support to get the cpu ID from its device driver in a generic way.
This will be needed by arm64 to find the value to pass to the psci (Power
State Coordination Interface) driver, among other things, used to enable
cores.

Differential Revision: https://reviews.freebsd.org/D1824
Reviewed by: imp
Sponsored by: The FreeBSD Foundation


# 5b86b0ea 21-Jan-2015 Andrew Turner <andrew@FreeBSD.org>

Update the parsing of the cpu node. We are unable to use the reg property
as the cpu id on arm64 as it may use two cells. In it's place we can use
the device id.

It is expected we will use the reg data on arm64 to enable cores so we
still need to read and store it even if it is not yet used.

Differential Revision: https://reviews.freebsd.org/D1555
Reviewed by: nwhitehorn
Sponsored by: The FreeBSD Foundation


# 09eb425a 19-Jan-2015 Andrew Turner <andrew@FreeBSD.org>

Make the clock-frequency property optional as it may not be present on FDT
systems.

Sponsored by: The FreeBSD Foundation


# cbe686f7 23-Dec-2014 Ian Lepore <ian@FreeBSD.org>

Don't assume required FDT properties are present.


# 55629a87 15-Dec-2014 Ed Maste <emaste@FreeBSD.org>

Use standard BSD license disclaimer text

Approved by: benno, nwhitehorn


# 5cead939 14-Dec-2014 Rui Paulo <rpaulo@FreeBSD.org>

Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
architectures.

Differential Revision: https://reviews.freebsd.org/D1307
Reviewed by: jhibbits