Page MenuHomeFreeBSD

Add generic ohci acpi driver
Needs RevisionPublic

Authored by s199p.wa1k9r_gmail.com on Jun 7 2023, 9:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 7, 2:40 AM
Unknown Object (File)
Sat, Apr 6, 10:42 PM
Unknown Object (File)
Sat, Apr 6, 5:48 PM
Unknown Object (File)
Mar 21 2024, 4:44 AM
Unknown Object (File)
Feb 11 2024, 7:38 AM
Unknown Object (File)
Dec 25 2023, 5:15 PM
Unknown Object (File)
Dec 24 2023, 5:14 PM
Unknown Object (File)
Dec 20 2023, 3:06 AM
Subscribers

Details

Summary

This driver is for RK3566/68 SoC devices using TianoCore EDK2 UEFI from this project
https://github.com/jaredmcneill/quartz64_uefi.git

and for devices based on SoC RK3588/88S from this project
https://github.com/edk2-porting/edk2-rk35xx.git

It allows USB 2.0 ports to be used for connecting
a keyboard and mouse when running FreeBSD in ACPI mode.

Test Plan

Tested on

TianoCore EDK2 UEFI from Jared McNeill
https://github.com/jaredmcneill/quartz64_uefi/releases
on Firefly Station-P2 (ROC-RK3568-PC RK3568)

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Looks good. Did you remember the appropriate entries in sys/conf/files and sys/modules/usb/xxx ?

This revision is now accepted and ready to land.Jun 16 2023, 3:58 PM
ganbold requested changes to this revision.Jun 16 2023, 4:04 PM
ganbold added inline comments.
sys/dev/usb/controller/generic_ohci_acpi.c
32

maybe these lines are not needed.

This revision now requires changes to proceed.Jun 16 2023, 4:04 PM
sys/dev/usb/controller/generic_ohci.h
7

You likely don't need / want this. It's obsolete language invoking a treaty that's been defunct for 2 decades.

29

You can now omit boilerplate for standard licenses. That's preferred since it reduces the proliferation on minor variation due to copying from different sources and minor 'tweaks' made with the best of intentions, but that have lead to a morass...

30

You don't need $FreeBSD$ anymore. We're phasing it out. Since this will never be merged to stable/12, it's not needed (and even if it is going there, since we're not doing any further releases in stable/12, that's likely OK).

sys/dev/usb/controller/generic_ohci_acpi.c
29

Same comments.

32

They can be omitted, but maybe sys/cdefs.h needs to be included below.

41

These should be sorted alphabetically after sys/param.h (which should remain first).

71

It would be better to use a table for these, ala acpi_dock.c:

static char *acpi_dock_pnp_ids[] = {"PNP0C15", NULL};
...
DRIVER_MODULE(acpi_dock, acpi, acpi_dock_driver, 0, 0);
MODULE_DEPEND(acpi_dock, acpi, 1, 1, 1);
ACPI_PNP_INFO(acpi_dock_pnp_ids);

Note ACPI_PNP_INFO must follow DRIVER_MODULE

andrew added inline comments.
sys/dev/usb/controller/generic_ohci.h
38–39

Are these needed? I don't see any other use to generic_ohci_attach and generic_ohci_detach in this change.

sys/dev/usb/controller/generic_ohci_acpi.c
71

I'm not sure this is useful as PRP0001 is for devices that use Device Tree compatible device identifiers.

sys/dev/usb/controller/generic_ohci_acpi.c
71

If the number of drivers we have in the tree is small, it's harmless and possiblely useful... it does highlight a shortfall in devmatch.

At the very least we need a comment or better a wrapper function since prp0001 isn't memorable as the redirection device.

sys/dev/usb/controller/generic_ohci_acpi.c
71

I have been wondering if we want a PRP0001 pseudo-bus, but is out of scope for this review.

74

Where is acpi_dsd_search_compatible defined? I don't see it in a recent checkout of main.

sys/dev/usb/controller/generic_ohci_acpi.c
71

OK. Fair enough. Let's drop the devmatch objections/suggestions I have.
I like the pseudo-bus idea because lots of nodes in the ACPI tree have FDT data on a boardI just looked at...