| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Accept the assigned clock on the CPU node.
Don't report a missing "clock-frequency" property if the CPU node has
a "clocks" property.
MFC after: 3 weeks
|
| |
|
|
|
|
|
|
|
| |
The wrapper functions such as bus_alloc_resource_any() still support
passing the rid by value or pointer, but the underlying implementation
now passes by value.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D53402
|
| |
|
|
|
|
|
|
|
| |
We need a quick way to identify a given machine (SoC), mainly when
implementing quirks for a given SoC.
MFC after: 2 weeks
Reviwed by: imp
Differential Revision: https://reviews.freebsd.org/D53992
|
| |
|
|
|
|
|
| |
Use the midr value to ensure we find the correct PCPU pointer on arm64.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D53327
|
| |
|
|
|
|
|
|
| |
This allows it to be referenced by other devices.
Reviewed by: jhibbits
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D53329
|
| |
|
|
|
|
|
|
|
| |
Move ofw_cpu to BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE so it can be used
by other devices.
Reviewed by: jhibbits
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D53328
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Follow interrupt-map properties until either an interrupt controller or
invalid node is found. In the former case return the translated details
for the interrupt controller driver to decode. In the latter case return
0 as an error.
Tested on the Arm DTS files that use interrupt-maps and with a
userspace test.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D51257
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Switch to using sys/stdarg.h for va_list type and va_* builtins.
Make an attempt to insert the include in a sensible place. Where
style(9) was followed this is easy, where it was ignored, aim for the
first block of sys/*.h headers and don't get too fussy or try to fix
other style bugs.
Reviewed by: imp
Exp-run by: antoine (PR 286274)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
When a device fails to attach, or a module is unloaded, we want to be
able to unregister the xref as the device goes away. While the device_t
may still be valid, it won't be providing whatever functionality the
consumer that follows the xref wants it for and thus, we should not
keep it discoverable.
[Commit message re-worded by kevans@]
Reviewed by: ian, imp
Differential Revision: https://reviews.freebsd.org/D22945
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some RISC-V CPUs contain a "monitor core" with limited functionality (no
MMU). These cores appear in some device trees, but we don't run the
kernel on them; in early CPU start-up code we skip them, and they have
no impact on mp_ncpu. It seems the new trend is to mark these monitor
cores with a 'status' property of 'disabled'.
However, we still instantiate an ofw_cpu pseudo device for the disabled
core. This is generally harmless, but there is an impact when attempting
to attach the cpufreq_dt driver. It counts more OFW CPU devices (unit
number) than logical CPUs (mp_ncpus), and therefore fails to attach for
the last logical CPU.
The solution is to check the status property in ofw_cpu_probe(), and
fail if the core is marked "disabled". This is subject to the same
exception already in ofw_cpu_early_foreach(); that is, if a disabled CPU
has an 'enable-method' property, it can be used by the kernel.
Reviewed by: andrew, jrtc27
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48123
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly, to avoid repeating the list of architectures, #define HAS_CLK.
Further, split the clk code into a helper function, which is a stub in
the !HAS_CLK case. This aids in overall legibility.
While here, add one separating whitespace, again for legibility.
Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48149
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The canonical name is __riscv, not __riscv__. Newer compilers no longer
emit the latter.
This re-enables finding the nominal frequency from the CPU's clock.
I checked, and there are no remaining mistakes like this in the tree.
Reviewed by: jrtc27, imp, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48122
|
| |
|
|
|
|
|
| |
Otherwise this matches any two-character status except for ok.
Fixes: e5e94d2de987 ("Expand OpenFirmware API with ofw_bus_node_status_okay method")
MFC after: 1 week
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47675
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D47674
|
| |
|
|
| |
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
| |
All architectures define PCI_RES_BUS unconditionally now that only
NEW_PCIB is supported, so we no longer need the legacy code.
Reviewed by: jhb, andrew
Differential Revision: https://reviews.freebsd.org/D32955
|
| |
|
|
|
|
|
|
|
|
|
| |
All architectures enable NEW_PCIB in DEFAULTS (arm being the most recent
to do so in 121be555997b (arm: Set NEW_PCIB in DEFAULTS rather than a
subset of kernel configs")), so it's time we removed the legacy code
that no longer sees much testing and has a significant maintenance
burden.
Reviewed by: jhb, andrew, emaste
Differential Revision: https://reviews.freebsd.org/D32954
|
| |
|
|
|
|
|
|
|
|
|
| |
Most of these already treat it as a proper bool, i.e. using true/false.
Also fix-up callers of OF_install().
No functional change intended.
Reviewed by: andrew, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45733
|
| |
|
|
|
|
|
|
|
|
| |
The public bus_release_resource() API still accepts both forms, but
the internal kobj method no longer passes the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44131
|
| |
|
|
|
|
|
|
|
|
| |
The public bus_activate/deactivate_resource() API still accepts both
forms, but the internal kobj methods no longer pass the arguments.
Implementations which need the rid or type now use rman_get_rid() or
rman_get_type() to fetch the value from the allocated resource.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44130
|
| |
|
|
|
|
|
|
|
|
| |
The public bus_map/unmap_resource() API still accepts both forms, but
the internal kobj methods no longer pass the argument.
Implementations which need the type now use rman_get_type() to fetch
the value from the allocated resource.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44129
|
| |
|
|
|
|
|
|
|
|
| |
The public bus_adjust_resource() API still accepts both forms, but the
internal kobj method no longer passes the argument. Implementations
which need the type now use rman_get_type() to fetch the value from
the allocated resource.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44128
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Implement bus_map/unmap_resource pulling bits from the previous
ofw_pcib_activate/deactivate_resource. One difference here is that
the bus_unmap_resource implementation uses bus_space_unmap instead
of pmap_unmapdev as a complement to the existing use of bus_space_map.
- Use bus_generic_rman_* in various routines for memory and I/O port
resources.
- Use pci_domain_* for PCI_RES_BUS in
ofw_pcib_activate/deactivate_resource.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D43441
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.
Sponsored by: Netflix
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
| |
|
|
| |
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
| |
|
|
|
|
|
|
|
| |
While here make it only probe if the node is directly under the root
one. If it's not it's likely a device node named 'firmware' and not the
firmware group we're interested in.
Suggested by: jhb
Sponsored by: Beckhoff Automation GmbH & Co. KG
|
| |
|
|
|
|
|
|
|
|
| |
If there is a compatible string it likely means that the firmware needs
a dedicated driver (like on RPI*).
PR: 273087
Tested-by: Mark Millard <marklmi26-fbsd@yahoo.com>
Sponsored by: Beckhoff Automation GmbH & Co. KG
Fixes: fdfd3a90b6ce ("ofw: Add a ofw_firmware driver")
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some SoCs have an external firmware doing power management, clock
and other stuffs. (Xilinx, ARM Juno etc ...)
The way it is represent in the DTB is usually having a 'firmware' node
under the root node and have some nodes under it with the correct
compatible strings.
The firmware node itself doesn't have any compatible strings.
This driver is simple subclassed from simplebus and attaches at
BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE so early drivers (like clock drivers)
can still have a change to attach early.
Reviewed by: andrew
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D37612
|
| |
|
|
|
|
|
| |
The ofw_reg_to_paddr() in this file is the powerpc OF_decode_addr()
formerly added in 812403402e0bc2165c03e37c6f657c7405f95c15. However,
the latter function in turn was based on the sparc64 counterpart I
previously added in 2b2250b149706f492dd615a518aa669e39b78d0a.
|
| |
|
|
|
|
|
|
|
|
| |
Since commit ecaecbc7d8bc212d8e854088106b3b21e631bb52, calling
ofw_bus_gen_setup_devinfo() is redundant, as the call to
device_set_ivars() now happens inside simplebus_add_device().
Reviewed by: markj
Approved by: markj (mentor)
Differential Revision: https://reviews.freebsd.org/D40271
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Reviewed by: jhb, emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40242
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| |
|
|
|
| |
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D39926
|
| |
|
|
|
|
|
|
| |
PR: 269509
Reported by: Jaroslaw Pelczar <jarek@jpelczar.com>
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38903
|
| |
|
|
|
|
|
|
|
|
|
| |
ofwbus has always been the root of attachment for OFW/FDT platforms. It
may have simplebus children, but we expect only one instance of the
ofwbus driver, added directly by nexus. We may as well ensure this
remains the case.
Reviewed by: jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38493
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than using the DEVICE_IDENTIFY method, let's have other
ofwbus-using platforms add ofwbus0 explicitly in nexus, like arm64. This
gives them the same flexibility, e.g. if riscv starts supporting ACPI,
and cleans up the #ifdefs.
We were doing this already on riscv, but adjust the 'order' parameters.
Reviewed by: andrew, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D38492
|
| |
|
|
|
|
|
| |
Nothing in the file today relies on these.
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38491
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The architecture nexus should handle allocation and release of memory and
interrupts. This is to ensure that system-wide resources such as these
are available to all devices, not just children of ofwbus0.
On powerpc this moves the ownership of these resources up one level,
from ofwbus0 to nexus0. Other architectures already have the required
logic in their nexus implementation, so this eliminates the duplication
of resources. An implementation of nexus_adjust_resource() is added for
arm, arm64, and riscv.
As noted by ian@ in the review, resource handling was the main bit of
logic distinguishing ofwbus from simplebus. With some attention to
detail, it should be possible to merge the two in the future.
Co-authored by: mhorne
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D30554
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
This matches the return type of pmap_mapdev/bios.
Reviewed by: kib, markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D36548
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With clang 15, the following -Werror warning is produced:
sys/dev/ofw/openfirm.c:826:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
OF_enter()
^
void
This is because OF_enter() and OF_exit are declared with a (void)
argument list, but defined with an empty argument list. Make the
definition match the declaration.
Sponsored by: The FreeBSD Foundation
|
| |
|
|
|
|
|
|
|
|
|
|
| |
rman_fini assumes rman_init has been called successfully. Clean up
init faulure by only calling rman_fini when rman_init has succeeded.
While here add ofw_pcib_fini that can be used by a sub-class to clean
up.
Reviewed by: bz, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35681
|
| | |
|