Page MenuHomeFreeBSD

Add support for unspecified ranges on ARM64 ThunderX system
ClosedPublic

Authored by wma_semihalf.com on Oct 1 2015, 6:09 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Dec 15, 3:59 PM
Unknown Object (File)
Sun, Dec 8, 2:07 AM
Unknown Object (File)
Thu, Dec 5, 8:02 AM
Unknown Object (File)
Sun, Nov 24, 5:52 AM
Unknown Object (File)
Nov 20 2024, 11:36 PM
Unknown Object (File)
Nov 5 2024, 3:08 PM
Unknown Object (File)
Oct 19 2024, 5:21 AM
Unknown Object (File)
Oct 19 2024, 2:42 AM
Subscribers

Details

Summary
When one is trying to allocate a resource with unspecified range,
read already configured BAR values (by UEFI or whatever).
This is necessary to make VFs working and to allow them to be
properly allocated.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wma_semihalf.com retitled this revision from to Add support for unspecified ranges on ARM64 ThunderX system.
wma_semihalf.com updated this object.
wma_semihalf.com edited the test plan for this revision. (Show Details)
wma_semihalf.com added a reviewer: arm64.
wma_semihalf.com set the repository for this revision to rS FreeBSD src repository - subversion.
zbb added a reviewer: zbb.
This revision is now accepted and ready to land.Oct 1 2015, 7:38 PM
sys/arm64/cavium/thunder_pcie.c
102 ↗(On Diff #8994)

Why 4?

465 ↗(On Diff #8994)

What is happening here? I don't understand how this works, a comment would be useful to help explain it.

472 ↗(On Diff #8994)

You talk about 3 64-bit bars, then use 5 here. Why?

I think this is OK, but I don't know much about VF

sys/arm64/cavium/thunder_pcie.c
465 ↗(On Diff #8994)

You're supposed to write all f's to the BAR to size it. The bits for the decode lines will be 0's, the address range it occupies are 1's. So this flips the upper bits that are set and adds 1 to get the size. The masking above masks out the low-order bits that contain attributes for the mapping.

472 ↗(On Diff #8994)

0, 2 and 4 are valid valid values for 3 64-bit BARs. 5 is the first invalid one.

sys/arm64/cavium/thunder_pcie.c
472 ↗(On Diff #8994)

Alternatively, 6 is the 4th 64-bit BAR?

sys/arm64/cavium/thunder_pcie.c
472 ↗(On Diff #8994)

PCI supports up to 6 BAR registers. They can be used either as 6x 32-bit regs, or 3x 64-bit. Anyway, PCIR_BAR(5) is the last valid entry inside configuration header, so anything above means we're accessing VFs.

This revision now requires review to proceed.Oct 23 2015, 10:54 AM
This revision was automatically updated to reflect the committed changes.