Page MenuHomeFreeBSD

Make opal_pci driver work with POWER9
ClosedPublic

Authored by jhibbits on May 25 2018, 3:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 6:39 AM
Unknown Object (File)
Dec 12 2023, 5:55 AM
Unknown Object (File)
Oct 23 2023, 10:28 PM
Unknown Object (File)
Sep 6 2023, 5:21 AM
Unknown Object (File)
Jul 12 2023, 2:52 AM
Unknown Object (File)
Jun 23 2023, 4:07 PM
Unknown Object (File)
Jun 3 2023, 9:51 PM
Unknown Object (File)
May 4 2023, 4:18 PM
Subscribers

Details

Summary

Coupled with D15461, this makes PCI work on POWER9. There is still
more to do to fully exploit the hardware capabilities, but this is sufficient to
enable USB and ethernet controllers on a Talos system.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 16837
Build 16718: arc lint + arc unit

Event Timeline

sys/powerpc/powernv/opal_pci.c
200

sys/param.h defines roundup2 and rounddown2 for this purpose.

276

Is this intentional?

352

Likewise.

sys/powerpc/powernv/opal_pci.c
200

Not quite. roundup2/rounddown2 take a power of 2 as 'y', and rounds 'x' to a multiple of 'y'. In this case, I'm trying to round up to the nearest power of 2.

276

Kind of. It's work in progress. I don't want to throw it away, because this is part of the "proper" initialization, which Linux does. It's blocked out for now, because it doesn't fully work, and I haven't yet found the missing pieces for it.

352

This might be a casualty of my testing. I'll have to retest it to be sure.

No need to comment out the OPAL_PCI_MAP_PE_MMIO_WINDOW. It likely was already
mapped as such by Opal.

sys/powerpc/powernv/opal_pci.c
276

I think it didn't work on P8 either, at least with the newest OPAL. However, on P8 it only produces a warning during boot and does not influence anything further.

356

This might be worth testing on P8 also. If I recall correctly, there were sth messed up with using splitted windows...

jhibbits added inline comments.
sys/powerpc/powernv/opal_pci.c
356

Yeah, it didn't work on POWER9 either, and I was pretty sure I had reverted it before submitting for review. I tested both cases, including post-revert. With split windows bge couldn't find its phy, after reverting to non-split windows, bge could initialize correctly.

This looks good to me, though I haven't tested on P8.

This revision is now accepted and ready to land.May 26 2018, 3:21 AM
breno.leitao_gmail.com added inline comments.
sys/powerpc/powernv/opal_pci.c
414

Can't you just call OF_getencprop() and checking if the return > 0, if so proceeding to branch other than calling OF_getproplen() and OF_getencprop()?

jhibbits added inline comments.
sys/powerpc/powernv/opal_pci.c
414

Yeah, that would be saner.

This change, and most of the OF_* changes, are just a rename of ofw_bus_get_node(dev) -> node. I'll commit that change separately though, since it't a non-functional change. I plan to make further changes to this file after I get the initial working skeleton in, for performance and stability.

This revision was automatically updated to reflect the committed changes.