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)
Fri, Nov 22, 8:20 PM
Unknown Object (File)
Oct 17 2024, 5:10 PM
Unknown Object (File)
Oct 17 2024, 5:10 PM
Unknown Object (File)
Oct 17 2024, 5:10 PM
Unknown Object (File)
Oct 17 2024, 5:10 PM
Unknown Object (File)
Oct 17 2024, 4:51 PM
Unknown Object (File)
Oct 3 2024, 2:00 PM
Unknown Object (File)
Oct 3 2024, 11:54 AM
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/powerpc/powernv/opal_pci.c
200 ↗(On Diff #42968)

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

276 ↗(On Diff #42968)

Is this intentional?

352 ↗(On Diff #42968)

Likewise.

sys/powerpc/powernv/opal_pci.c
200 ↗(On Diff #42968)

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 ↗(On Diff #42968)

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 ↗(On Diff #42968)

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 ↗(On Diff #42968)

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.

358 ↗(On Diff #42968)

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
358 ↗(On Diff #42968)

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 ↗(On Diff #42970)

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 ↗(On Diff #42970)

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.