git: bf2166bd72ad - main - Revert "powernv: Add RF_BIGENDIAN resource flag"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 14 May 2025 13:50:12 UTC
The branch main has been updated by jhibbits:
URL: https://cgit.FreeBSD.org/src/commit/?id=bf2166bd72ad691765ff5e081f00cbba6b12da61
commit bf2166bd72ad691765ff5e081f00cbba6b12da61
Author: Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2025-05-14 13:48:07 +0000
Commit: Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2025-05-14 13:50:12 +0000
Revert "powernv: Add RF_BIGENDIAN resource flag"
After further thinking, the nexus bus mappings are for the immediate
peripherals, not downstream. Given this, and that historically PowerPC
platforms have been big-endian by default, it makes sense to default
mappings to BE always. If this changes in the future, the platform
devices can explicitly mark their mappings with the RF_LITTLEENDIAN flag
instead.
This reverts commit 86d20eaadfd1a03e19d8bc8333c689b820299d52.
---
sys/powerpc/include/resource.h | 1 -
sys/powerpc/powernv/opal_pci.c | 2 +-
sys/powerpc/powernv/xive.c | 2 +-
sys/powerpc/powerpc/nexus.c | 4 +---
4 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/sys/powerpc/include/resource.h b/sys/powerpc/include/resource.h
index 6726104403d0..e7e9493569cc 100644
--- a/sys/powerpc/include/resource.h
+++ b/sys/powerpc/include/resource.h
@@ -47,6 +47,5 @@
*/
#define RF_LITTLEENDIAN RF_SPARE1
-#define RF_BIGENDIAN RF_SPARE2
#endif /* !_MACHINE_RESOURCE_H_ */
diff --git a/sys/powerpc/powernv/opal_pci.c b/sys/powerpc/powernv/opal_pci.c
index 622c8c2cc09b..8dee2c45c089 100644
--- a/sys/powerpc/powernv/opal_pci.c
+++ b/sys/powerpc/powernv/opal_pci.c
@@ -270,7 +270,7 @@ opalpci_attach(device_t dev)
rid = 0;
sc->r_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &rid, RF_ACTIVE | RF_SHAREABLE | RF_BIGENDIAN);
+ &rid, RF_ACTIVE | RF_SHAREABLE);
if (sc->r_reg == NULL) {
device_printf(dev, "Failed to allocate PHB[%jd] registers\n",
(uintmax_t)sc->phb_id);
diff --git a/sys/powerpc/powernv/xive.c b/sys/powerpc/powernv/xive.c
index aaf4953ba8a5..384ff4ef20d2 100644
--- a/sys/powerpc/powernv/xive.c
+++ b/sys/powerpc/powernv/xive.c
@@ -327,7 +327,7 @@ xive_attach(device_t dev)
rid = 1; /* Get the Hypervisor-level register set. */
sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
- &rid, RF_ACTIVE | RF_BIGENDIAN);
+ &rid, RF_ACTIVE);
sc->sc_offset = XIVE_TM_QW3_HV;
mtx_init(&sc->sc_mtx, "XIVE", NULL, MTX_DEF);
diff --git a/sys/powerpc/powerpc/nexus.c b/sys/powerpc/powerpc/nexus.c
index 1dac56a84cf9..029b6ef8a479 100644
--- a/sys/powerpc/powerpc/nexus.c
+++ b/sys/powerpc/powerpc/nexus.c
@@ -287,10 +287,8 @@ nexus_map_resource(device_t bus, device_t child, struct resource *r,
map->r_vaddr = pmap_mapdev_attr(start, length, args.memattr);
if ((rman_get_flags(r) & RF_LITTLEENDIAN) != 0)
map->r_bustag = &bs_le_tag;
- else if ((rman_get_flags(r) & RF_BIGENDIAN) != 0)
- map->r_bustag = &bs_be_tag;
else
- map->r_bustag = nexus_get_bus_tag(NULL, NULL);
+ map->r_bustag = &bs_be_tag;
map->r_size = length;
map->r_bushandle = (bus_space_handle_t)map->r_vaddr;
break;