]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ofwbus: remove handling of resources from ofwbus
authorElliott Mitchell <ehem+freebsd@m5p.com>
Wed, 8 Feb 2023 20:17:03 +0000 (16:17 -0400)
committerMitchell Horne <mhorne@FreeBSD.org>
Wed, 8 Feb 2023 20:50:46 +0000 (16:50 -0400)
commitf9bdaab95ec469738fbfc1f0edd3e8c744b7f71f
treee1a6c7425f2630a5beb3a925fe29c951f158fc0d
parent1d03c3578d05b011dc714ec0735a5783c421530b
ofwbus: remove handling of resources from ofwbus

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
sys/arm/arm/nexus.c
sys/arm64/arm64/nexus.c
sys/dev/ofw/ofwbus.c
sys/powerpc/powerpc/nexus.c
sys/riscv/riscv/nexus.c