Page MenuHomeFreeBSD

Add support for USB 3.0 XHCI via ACPI
ClosedPublic

Authored by val_packett.cool on Apr 20 2019, 2:05 PM.
Referenced Files
F80221501: D19986.id56915.diff
Fri, Mar 29, 8:34 AM
F80155392: D19986.id56427.diff
Thu, Mar 28, 3:57 PM
Unknown Object (File)
Tue, Mar 19, 7:55 PM
Unknown Object (File)
Tue, Mar 5, 11:19 AM
Unknown Object (File)
Tue, Mar 5, 11:19 AM
Unknown Object (File)
Tue, Mar 5, 11:19 AM
Unknown Object (File)
Tue, Mar 5, 11:19 AM
Unknown Object (File)
Tue, Mar 5, 11:19 AM
Subscribers

Details

Summary

Ampere eMAG systems have XHCI just descibed in ACPI, not on PCI.

Test Plan

Original version tested on Ampere eMAG by Tuan Phan <tphan@amperecomputing.com>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Patch looks plausible to me, @manu or @andrew can you review and commit?
PR 237055

Something like D19389 would be better.

In D19986#430466, @manu wrote:

Something like D19389 would be better.

Ah, yes. GregV would you rework it using that approach?

In D19986#430466, @manu wrote:

Something like D19389 would be better.

Ah, yes. GregV would you rework it using that approach?

yeah, sure. I forgot about that one (even though I wrote a comment there) and I was looking at sys/dev/ahci/ahci_generic.c instead :)

val_packett.cool edited the test plan for this revision. (Show Details)

Done. btw, the original version was confirmed working on the Ampere system.

sys/dev/usb/controller/generic_xhci_fdt.c
34–51

Do we need all these headers in the attachment code?

98

This should be
return (generic_xhci_attach(dev));

As with GregV's report in PR237055 dsdt has for USB:

Method (_STA, 0, NotSerialized)  // _STA: Status
{
    Return (0x00)
}

regardless of BIOS settings; I wasn't able to test this here.

manu requested changes to this revision.Apr 27 2019, 3:43 PM

The fdt needs it's own detach function where we disable the phy (like it's done in D19389 for ehci).

This revision now requires changes to proceed.Apr 27 2019, 3:43 PM
In D19986#431905, @manu wrote:

The fdt needs it's own detach function where we disable the phy (like it's done in D19389 for ehci).

I know that it wasn't done before (my bad ...) but since we are changing since might as well do it correctly :)

val_packett.cool added inline comments.
sys/dev/usb/controller/generic_xhci_fdt.c
34–51

We don't actually need xhcireg (I think I've seen an error related to that earlier, but removing it is fine now). We need xhci for the softc and all other USB stuff for xhci

val_packett.cool marked an inline comment as done.

Added fdt detach corresponding to the current attach code (usb-phy)

This revision is now accepted and ready to land.May 7 2019, 7:40 AM
andrew added inline comments.
sys/dev/usb/controller/generic_xhci_acpi.c
3–5

I doubt Semihalf and Stormshield own the copyright on this file.

This revision now requires review to proceed.May 8 2019, 11:47 AM
val_packett.cool added inline comments.
sys/dev/usb/controller/generic_xhci_acpi.c
3–5

okay, I can put myself here I guess

(also added SPDX)

This revision is now accepted and ready to land.May 8 2019, 1:59 PM

Tinh Nguyen from Ampere tested and it doesn't seems to make usb working (xhci controller is discovered but nothing more), I've tried on my overdrive in FDT mode and it works.
In acpi mode this doesn't but it doesn't without this patch too, looks like the acpi table is missing info about interrupts, I'll do one more test on the macchiatobin and then commit this.

This revision was automatically updated to reflect the committed changes.