History log of /freebsd/sys/powerpc/powernv/opal_pci.c (Results 1 – 25 of 33)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# bf2166bd 14-May-2025 Justin Hibbits <jhibbits@FreeBSD.org>

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
platform

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.

show more ...


# 86d20eaa 14-May-2025 Justin Hibbits <jhibbits@FreeBSD.org>

powernv: Add RF_BIGENDIAN resource flag

The big-endian analogue to the RF_LITTLEENDIAN flag, if this flag is set
on a memory resource it's always mapped big endian.

This is needed by the PowerNV OP

powernv: Add RF_BIGENDIAN resource flag

The big-endian analogue to the RF_LITTLEENDIAN flag, if this flag is set
on a memory resource it's always mapped big endian.

This is needed by the PowerNV OPAL resources (XIVE and PCI), as these
top-level peripherals are always big-endian.

Tested by: pkubaj
Fixes: c4921a0f("powerpc: Always use BE tag in nexus_map_resource")
MFC after: 1 day
X-MFC-with: c4921a0f

show more ...


Revision tags: release/13.4.0-p5, release/13.5.0-p1, release/14.2.0-p3, release/13.5.0, release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3, release/14.2.0, release/13.4.0, release/14.1.0, release/13.3.0
# 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.

Remov

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

show more ...


Revision tags: release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

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

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


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0
# 5edf159f 10-May-2022 John Baldwin <jhb@FreeBSD.org>

powerpc powernv: Remove unused devclass arguments to DRIVER_MODULE.


Revision tags: release/12.3.0
# 24042910 19-May-2021 Marcin Wojtas <mw@FreeBSD.org>

Rename ofwpci.c to ofw_pcib.c

It's a class0 driver that implements some pcib methods and creates
a pci bus as its children.
The "ofw_pci" name will be used by a new driver that will be a subclass
of

Rename ofwpci.c to ofw_pcib.c

It's a class0 driver that implements some pcib methods and creates
a pci bus as its children.
The "ofw_pci" name will be used by a new driver that will be a subclass
of the pci bus.
No functional changes intended.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: andrew
Obtained from: Semihalf
Sponsored by: Alstom Group
Differential Revision: https://reviews.freebsd.org/D30226

show more ...


Revision tags: release/13.0.0, release/12.2.0
# f9acb7a8 23-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Get XIVE up and running.

More endian conversion.

* Install TCEs correctly (i.e. in big endian)

* Convert to big endian and back when setting up queue pages and IRQs.

Sponsored by: T

[PowerPC64LE] Get XIVE up and running.

More endian conversion.

* Install TCEs correctly (i.e. in big endian)

* Convert to big endian and back when setting up queue pages and IRQs.

Sponsored by: Tag1 Consulting, Inc.

show more ...


# 9cbcb6ff 23-Sep-2020 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC64LE] Endian fixes for opal_pci.c.

Since OPAL runs in big endian, any data being passed back and forth
via memory instead of registers needs to be byteswapped.

From my notes during developm

[PowerPC64LE] Endian fixes for opal_pci.c.

Since OPAL runs in big endian, any data being passed back and forth
via memory instead of registers needs to be byteswapped.

From my notes during development:

"A good way to find candidates is to look for vtophys() in opal_call()
parameters. The memory being passed will be written into in BE."

Sponsored by: Tag1 Consulting, Inc.

show more ...


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

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


Revision tags: release/11.4.0
# 46e8ab5a 10-Jun-2020 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc/powernv: Don't use the vmem quantum cache for OPAL PCI MSI allocations

vmem quantum cache is only needed when doing a lot of concurrent allocations,
which doesn't happen when allocating MSIs

powerpc/powernv: Don't use the vmem quantum cache for OPAL PCI MSI allocations

vmem quantum cache is only needed when doing a lot of concurrent allocations,
which doesn't happen when allocating MSIs. This wastes memory for the cache
zones. Avoid this waste and don't use the quantum cache.

Reported by: markj

show more ...


# 0b475340 10-Nov-2019 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc64/powernv: Use OPAL call for non-POWER8 PCI TCE reset

According to the OPAL documentation, only the POWER8 (PHB3) should use
the register write TCE reset method. All others should use the O

powerpc64/powernv: Use OPAL call for non-POWER8 PCI TCE reset

According to the OPAL documentation, only the POWER8 (PHB3) should use
the register write TCE reset method. All others should use the OPAL
call.

On POWER9 the call is semantically identical to the register write, with
a wait for completion.

show more ...


Revision tags: release/12.1.0
# 84ce4f03 03-Aug-2019 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc/powernv: Fix OPAL cfgread/cfgwrite error handling

Freeze clearing needs to heppen any time OPAL reads return either an error
(except OPAL_HARDWARE), AND any time it returns 0xff for all byte

powerpc/powernv: Fix OPAL cfgread/cfgwrite error handling

Freeze clearing needs to heppen any time OPAL reads return either an error
(except OPAL_HARDWARE), AND any time it returns 0xff for all bytes.

For cfgwrite, any error that's not OPAL_HARDWARE should be cleaned up.

show more ...


# 0effb2cc 01-Aug-2019 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc/powernv: Only clear EEH freeze for some errors

Only clear an EEH freeze if an error occurs. However, if an OPAL_HARDWARE
error is returned, this indicates a hardware failure which cannot be

powerpc/powernv: Only clear EEH freeze for some errors

Only clear an EEH freeze if an error occurs. However, if an OPAL_HARDWARE
error is returned, this indicates a hardware failure which cannot be
unfrozen, and instead needs a hardware reset. Attempting to unfreeze a
broken PCH will result in console spam for each attempt. To avoid the spam,
just don't do it.

show more ...


Revision tags: release/11.3.0
# 7648bc9f 13-May-2019 Alan Somers <asomers@FreeBSD.org>

MFHead @347527

Sponsored by: The FreeBSD Foundation


# 49d9a597 13-Apr-2019 Justin Hibbits <jhibbits@FreeBSD.org>

Add NUMA support to powerpc

Summary:
Initial NUMA support:
- associate CPU with domain
- associate memory ranges with domain
- identify domain for devices
- limit device interrupt bi

Add NUMA support to powerpc

Summary:
Initial NUMA support:
- associate CPU with domain
- associate memory ranges with domain
- identify domain for devices
- limit device interrupt binding to appropriate domain

- Additionally fixes a bug in the setting of Maxmem which led to
only memory attached to the first socket being enabled for DMA

A pmap variant can opt in to numa support by by calling `numa_mem_regions`
at the end of pmap_bootstrap - registering the corresponding ranges with the
VM.

This yields a ~20% improvement in build times of llvm on dual socket POWER9
over non-NUMA.

Original patch by mmacy.

Differential Revision: https://reviews.freebsd.org/D17933

show more ...


# 56505ec0 12-Jan-2019 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc: Add opaque 'private data' to interrupt vectors

The XICS and XIVE need extra data beyond irq and vector. Rather than
performing a separate search, it's better for the general interrupt faci

powerpc: Add opaque 'private data' to interrupt vectors

The XICS and XIVE need extra data beyond irq and vector. Rather than
performing a separate search, it's better for the general interrupt facility
to hold a private pointer, since the search already must be done anyway at
that level.

show more ...


Revision tags: release/12.0.0
# 9b5cb2f6 12-Nov-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r340235 through r340367.


# ad39591a 08-Nov-2018 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc/powernv: Restrict the busdma tag to only POWER8

It seems this tag is causing problems on POWER9 systems. Since no POWER9 user
has encountered the problem fixed by r339589 just restrict it t

powerpc/powernv: Restrict the busdma tag to only POWER8

It seems this tag is causing problems on POWER9 systems. Since no POWER9 user
has encountered the problem fixed by r339589 just restrict it to POWER8 for now.
A better fix will likely be to update powerpc/busdma_machdep.c to handle the
window correctly.

Reported by: mmacy, others

show more ...


# c6879c6c 23-Oct-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r339015 through r339669.


# d93e635a 22-Oct-2018 Leandro Lupori <luporl@FreeBSD.org>

ppc64: limited 32-bit DMA address range

Further investigation of issues with 32-bit DMA on PowerNV revealed that
its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and
cannot be cha

ppc64: limited 32-bit DMA address range

Further investigation of issues with 32-bit DMA on PowerNV revealed that
its window is hardcoded by OPAL (at least in skiboot version 5.4.9) and
cannot be changed by the OS.
Thus, now jhb suggestion of limiting the range in PCI DMA tag seems
the best way to deal with it.

Reviewed by: jhibbits, nwhitehorn, sbruno
Approved by: jhibbits(mentor)
Differential Revision: https://reviews.freebsd.org/D17601

show more ...


# 2756851a 21-Oct-2018 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc64/powernv:opal_pci: Fix the alignment of the TCE table

The TCE table need only be aligned to the size of the table, not the size of
the TCE segment.


# fc3f42d8 08-Oct-2018 Glen Barber <gjb@FreeBSD.org>

MFH r339206-r339212, r339215-r339239

Sponsored by: The FreeBSD Foundation


# 013cc176 06-Oct-2018 Justin Hibbits <jhibbits@FreeBSD.org>

powerpc64/powernv: Don't mask MSIs in OPAL

Summary:
Discussing with Benjamin Herrenschmidt, MSIs, and edge-triggered
interrupts in general, must not be masked in XICS and XIVE, else
subsequent inter

powerpc64/powernv: Don't mask MSIs in OPAL

Summary:
Discussing with Benjamin Herrenschmidt, MSIs, and edge-triggered
interrupts in general, must not be masked in XICS and XIVE, else
subsequent interrupts may be ignored.

Testing locally on my Talos II (single CPU, 18-core POWER9), NVMe now
works with MSI, improving read throughput by ~70% (900MB/s -> 1.67GB/s,
with 64MB block size) over INTx interrupts, and snd_hda(4) now will
actually play music with MSI. Previously, snd_hda(4) would not receive
interrupts, timing out, and declaring the channels dead.

This has also been tested by Kevin Bowling, and others, with great
success. Kevin reported NVMe unusable on his Talos II prior to this
patch.

Reviewed by: nwhitehorn, kbowling
Approved by: re(rgrimes)
Differential Revision: https://reviews.freebsd.org/D17356

show more ...


Revision tags: release/11.2.0
# 5ecc8c20 12-Jun-2018 Breno Leitao <leitao@FreeBSD.org>

powerpc64/powernv: Avoid type promotion

There is a type promotion that transform count = -1 into a unsigned int causing
the default TCE SEG SIZE not being returned on a Boston POWER9 machine.

This

powerpc64/powernv: Avoid type promotion

There is a type promotion that transform count = -1 into a unsigned int causing
the default TCE SEG SIZE not being returned on a Boston POWER9 machine.

This machine does not have the 'ibm,supported-tce-sizes' entries, thus, count
is set to -1, and the function continue to execute instead of returning.

Reviewed by: jhibbits, wma
Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D15763

show more ...


# e69b55ea 31-May-2018 Justin Hibbits <jhibbits@FreeBSD.org>

Remove a debug printf from opal_pci driver


12