History log of /freebsd-current/sys/riscv/riscv/nexus.c
Revision Date Author Comments
# 2baed46e 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'rid' and 'type' arguments from BUS_*ACTIVATE_RESOURCE

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


# d77f2092 13-Mar-2024 John Baldwin <jhb@FreeBSD.org>

new-bus: Remove the 'type' argument from BUS_MAP/UNMAP_RESOURCE

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


# 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


# 7bf9223c 11-Sep-2019 John Baldwin <jhb@FreeBSD.org>

riscv nexus: Sort bus_set_resource in DEVMETHOD table


# f8709c82 24-Nov-2023 John Baldwin <jhb@FreeBSD.org>

riscv nexus: Use bus_generic_rman_*_resource

Custom activate/deactivate_resource methods are still needed to handle
IRQ resources.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42742


# 71cfd330 23-Nov-2023 John Baldwin <jhb@FreeBSD.org>

arm64/riscv nexus: Implement bus_unmap_resource

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42725


# b887b665 23-Nov-2023 John Baldwin <jhb@FreeBSD.org>

nexus: Use resource_validate_map_request

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D42724


# ecf2106c 22-Nov-2023 John Baldwin <jhb@FreeBSD.org>

arm64/amd64/riscv nexus: Use bus_generic_rl_*

Reviewed by: mhorne, imp
Differential Revision: https://reviews.freebsd.org/D42716


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

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

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


# ff13b924 23-Apr-2023 Mark Johnston <markj@FreeBSD.org>

riscv: Implement bus_describe_intr() for nexus

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39750


# abe3309e 06-Feb-2023 Mitchell Horne <mhorne@FreeBSD.org>

riscv: nexus code tidy-up

Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
- Using generated method typedefs
- Grouping methods roughly by category, and then alphabetically.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D38495


# 53d5e65e 13-Feb-2023 Mitchell Horne <mhorne@FreeBSD.org>

ofwbus: remove arm64 ifdefs

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


# f9bdaab9 08-Feb-2023 Elliott Mitchell <ehem+freebsd@m5p.com>

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


# 2663ef1b 10-May-2022 John Baldwin <jhb@FreeBSD.org>

riscv: Remove unused devclass arguments to DRIVER_MODULE.


# 17f790f4 07-Oct-2021 Mitchell Horne <mhorne@FreeBSD.org>

arm, arm64, riscv: adjust top-level nexus comment

These platforms don't manage resources for DMA request lines or I/O
ports, this is specific to x86. Remove the references from the comments.

Reviewed by: imp, jhb
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D32358


# d9e85f2c 20-Jul-2021 Jessica Clarke <jrtc27@FreeBSD.org>

riscv: Implement missing nexus methods

This is required for the SiFive FU740's PCIe controller. Copied from
arm64 with the only difference being changing pmap_mapdev_attr to
pmap_mapdev as riscv only has the latter.

Reviewed by: mhorne
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31032


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

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


# adf208e7 01-May-2019 Ruslan Bukin <br@FreeBSD.org>

Deactivate IRQ resource by calling to intr_deactivate_irq().
This is the part of INTRNG support that was missed.

Sponsored by: DARPA, AFRL


# 2d53a67c 12-Jun-2018 Ruslan Bukin <br@FreeBSD.org>

o Add driver for PLIC (Platform-Level Interrupt Controller) device.
o Convert interrupt machdep support to use INTRNG code.

Sponsored by: DARPA, AFRL


# af19cc59 10-Aug-2017 Ruslan Bukin <br@FreeBSD.org>

Support for v1.10 (latest) of RISC-V privilege specification.

New version is not compatible on supervisor mode with v1.9.1
(previous version).

Highlights:
o BBL (Berkeley Boot Loader) provides no initial page tables
anymore allowing us to choose VM, to build page tables manually
and enable MMU in S-mode.
o SBI interface changed.
o GENERIC kernel.
FDT is now chosen standard for RISC-V hardware description.
DTB is now provided by Spike (golden model simulator). This
allows us to introduce GENERIC kernel. However, description
for console and timer devices is not provided in DTB, so move
these devices temporary to nexus bus.
o Supervisor can't access userspace by default. Solution is to
set SUM (permit Supervisor User Memory access) bit in sstatus
register.
o Compressed extension is now turned on by default.
o External GCC 7.1 compiler used.
o _gp renamed to __global_pointer$
o Compiler -march= string is now in use allowing us to choose
required extensions (compressed, FPU, atomic, etc).

Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11800


# b93c97c1 14-Apr-2016 Pedro F. Giffuni <pfg@FreeBSD.org>

risc-v: for pointers replace 0 with NULL.

These are mostly cosmetical, no functional change.

Found with devel/coccinelle.


# e665eafb 29-Feb-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Correct the memory rman ranges to be to BUS_SPACE_MAXADDR

Summary:
As part of the migration of rman_res_t to be typed to uintmax_t, memory ranges
must be clamped appropriately for the bus, to prevent completely bogus addresses
from being used.

This is extracted from D4544.

Reviewed By: cem
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5134


# 7915adb5 19-Feb-2016 Justin Hibbits <jhibbits@FreeBSD.org>

Introduce a RMAN_IS_DEFAULT_RANGE() macro, and use it.

This simplifies checking for default resource range for bus_alloc_resource(),
and improves readability.

This is part of, and related to, the migration of rman_res_t from u_long to
uintmax_t.

Discussed with: jhb
Suggested by: marcel


# 28029b68 29-Jan-2016 Ruslan Bukin <br@FreeBSD.org>

Welcome the RISC-V 64-bit kernel.

This is the final step required allowing to compile and to run RISC-V
kernel and userland from HEAD.

RISC-V is a completely open ISA that is freely available to academia
and industry.

Thanks to all the people involved! Special thanks to Andrew Turner,
David Chisnall, Ed Maste, Konstantin Belousov, John Baldwin and
Arun Thomas for their help.
Thanks to Robert Watson for organizing this project.

This project sponsored by UK Higher Education Innovation Fund (HEIF5) and
DARPA CTSRD project at the University of Cambridge Computer Laboratory.

FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv

Reviewed by: andrew, emaste, kib
Relnotes: Yes
Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
Differential Revision: https://reviews.freebsd.org/D4982