Page MenuHomeFreeBSD

xhci: Add support for 64-bit DMA in generic XHCI controller driver
ClosedPublic

Authored by stevek on Aug 11 2023, 4:10 PM.
Tags
None
Referenced Files
F103003589: D41429.id126047.diff
Tue, Nov 19, 5:20 PM
F102998959: D41429.id125881.diff
Tue, Nov 19, 4:01 PM
Unknown Object (File)
Oct 2 2024, 2:40 AM
Unknown Object (File)
Oct 2 2024, 2:34 AM
Unknown Object (File)
Oct 2 2024, 12:37 AM
Unknown Object (File)
Sep 24 2024, 2:53 AM
Unknown Object (File)
Sep 23 2024, 8:41 PM
Unknown Object (File)
Sep 23 2024, 5:32 AM
Subscribers

Details

Reviewers
manu
andrew
Summary

xhci: Add support for 64-bit DMA in generic XHCI controller driver

The XHCI controller on 64-bit SoCs need to use 64-bit DMA.
Add a quirk to tell the generic XHCI driver that 32-bit DMA needs
to be used, if there are any that may need to use 32-bit DMA only.

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 53171
Build 50062: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 11 2023, 4:44 PM

How does Linux handle this? I see the brcm,generic-xchi compat string in u-boot, but not Linux.

How does Linux handle this? I see the brcm,generic-xchi compat string in u-boot, but not Linux.

There are some other Broadcom-specific SoC entries, but they only have suspend and resume quirks.

The FDT that Broadcom provided only had "generic-xhci" in it for the compatible string, but the U-Boot sources used "brcm,generic-xhci".

As far as I know, the XHCI block is not specific to the one SoC being used in this case.

Fix typo in the compatible string

This revision now requires review to proceed.Aug 15 2023, 6:31 PM

It looks like IS_DMA_32B came from when the generic_xhci.c was added as a Marvell specific driver. It looks like it should only be 1 on 32-bit platforms.

It looks like IS_DMA_32B came from when the generic_xhci.c was added as a Marvell specific driver. It looks like it should only be 1 on 32-bit platforms.

Currently it's 1 always.

Are you suggesting to make it 1 only when using 32-bit architecture and 0 on 64-bit architecture and avoid this quirk?

-Steve

It looks like IS_DMA_32B came from when the generic_xhci.c was added as a Marvell specific driver. It looks like it should only be 1 on 32-bit platforms.

Yes. On arm64 (and other 64-bit architectures) we don't know if there is any memory below the 32-bit boundary. A quirk should be for a controller that needs a 32-bit limit on a 64-bit architecture.

Updated according to suggestions by Andrew

andrew added inline comments.
sys/dev/usb/controller/generic_xhci.c
64

I think the preferred spelling is #if __SIZEOF_LONG__ == 8

This revision is now accepted and ready to land.Aug 18 2023, 3:48 PM
sys/dev/usb/controller/generic_xhci.c
64

Probably worth doing a mass edit of the tree where LP64 has traditionally been used, perhaps?

Updated to use SIZEOF_LONG check instead of LP64

This revision now requires review to proceed.Aug 18 2023, 7:14 PM
stevek retitled this revision from xhci: Add support for Broadcom SoC XHCI controller to xhci: Add support for 64-bit DMA in generic XHCI controller driver.Aug 18 2023, 7:16 PM
stevek edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Aug 18 2023, 8:04 PM