Add support for Armada 3700 EHCI
ClosedPublic

Authored by mw on Wed, Sep 6, 7:31 PM.

Details

Summary

This patch reuses ehci_mv driver by adding a support for the new
compatible string and adding ehci_mv.c to list of available options
for arm64 platforms.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mw created this revision.Wed, Sep 6, 7:31 PM
Closed by commit rS323357: Add support for Armada 3700 EHCI (authored by mw, committed by ). · Explain WhySat, Sep 9, 11:07 AM
This revision was automatically updated to reflect the committed changes.
emaste added inline comments.Sat, Sep 9, 1:29 PM
head/sys/dev/usb/controller/ehci_mv.c
180–181

can we use ofw_bus_search_compatible here, as in D12258?

mw added inline comments.Sat, Sep 9, 3:43 PM
head/sys/dev/usb/controller/ehci_mv.c
180–181

Actually this code should be executed only for legacy devices using "mrvl,usb-ehci" compatible string, so ofw_bus_search_compatible is imo not sufficient.

Would you like to invert the condition to:

if ((ofw_bus_is_compatible(self, "mrvl,usb-ehci")) {

or can we leave it as-is now?

ian added inline comments.Sat, Sep 9, 4:14 PM
head/sys/dev/usb/controller/ehci_mv.c
180–181

The ocd_data field returned by ofw_bus_is_compatible() doesn't have to be just true/false. When you've got hardware that has a few small variations, you can use an enum with each compat string (see dev/sdhci/fsl_sdhci.c for an example). You could also do something like a set of bitmapped flags where different flag bits indicate different quirks.