Skip to content

Commit

Permalink
riscv nexus: Remove support for I/O port resources
Browse files Browse the repository at this point in the history
RISC-V doesn't natively support I/O port resources.  PCI I/O port BARs
are remapped to memory resources by PCI bridge drivers before the
request is passed up to the nexus layer.

Reviewed by:	jrtc27, imp
Differential Revision:	https://reviews.freebsd.org/D48582
  • Loading branch information
bsdjhb committed Jan 23, 2025
1 parent bf6c4ee commit 2f51074
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions sys/riscv/riscv/nexus.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ nexus_get_rman(device_t bus, int type, u_int flags)
case SYS_RES_IRQ:
return (&irq_rman);
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
return (&mem_rman);
default:
return (NULL);
Expand Down Expand Up @@ -308,7 +307,6 @@ nexus_activate_resource(device_t bus, device_t child, struct resource *r)
int error;

switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
error = bus_generic_rman_activate_resource(bus, child, r);
break;
Expand Down Expand Up @@ -343,7 +341,6 @@ nexus_deactivate_resource(device_t bus, device_t child, struct resource *r)
int error;

switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
error = bus_generic_rman_deactivate_resource(bus, child, r);
break;
Expand Down Expand Up @@ -372,9 +369,8 @@ nexus_map_resource(device_t bus, device_t child, struct resource *r,
if ((rman_get_flags(r) & RF_ACTIVE) == 0)
return (ENXIO);

/* Mappings are only supported on I/O and memory resources. */
/* Mappings are only supported on memory resources. */
switch (rman_get_type(r)) {
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
break;
default:
Expand Down Expand Up @@ -403,7 +399,6 @@ nexus_unmap_resource(device_t bus, device_t child, struct resource *r,
{
switch (rman_get_type(r)) {
case SYS_RES_MEMORY:
case SYS_RES_IOPORT:
pmap_unmapdev(map->r_vaddr, map->r_size);
return (0);
default:
Expand Down

0 comments on commit 2f51074

Please sign in to comment.