Skip to content

Commit

Permalink
Integrate Rust HID driver
Browse files Browse the repository at this point in the history
Per integration instructions in microsoft/mu_plus#324,
`UsbMouseAbsolutePointerDxe` is removed and `UsbHidDxe` and `UefiHidDxe` are
added to the build.

The absolute pointer protocol will now be installed by the `AbsolutePointer`
crate in `HidPkg` linked against the `UefiHidDxe` module.

r-efi is updated to v4.3.0 to pick up the absolute pointer protocol definition
added in that release.

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki committed Oct 18, 2023
1 parent bfb167d commit cf0becb
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 46 deletions.
126 changes: 86 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

# Add packages that generate binaries here
members = [
"Common/MU/HidPkg/UefiHidDxe",
"Common/MU/MsCorePkg/HelloWorldRustDxe"
]

# Add packages that generate libraries here
[workspace.dependencies]
HidIo = {path = "Common/MU/HidPkg/Crates/HidIo"}
RustAdvancedLoggerDxe = {path = "Common/MU/AdvLoggerPkg/Crates/RustAdvancedLoggerDxe"}
RustBootServicesAllocatorDxe = {path = "Common/MU/MsCorePkg/Crates/RustBootServicesAllocatorDxe"}

r-efi = "4.0.0"
hidparser = {git = "https://github.com/microsoft/mu_rust_hid.git", branch = "main"}
memoffset = "0.9.0"
r-efi = "4.3.0"
rustversion = "1.0.14"
spin = "0.5.2"
11 changes: 10 additions & 1 deletion Platforms/QemuQ35Pkg/QemuQ35Pkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,12 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf
<LibraryClasses>
NULL|QemuQ35Pkg/Library/PxeBcPcdProducerLib/PxeBcPcdProducerLib.inf
}

#
# HID Support
#
HidPkg/UefiHidDxe/UefiHidDxe.inf

#
# Usb Support
#
Expand All @@ -1273,6 +1279,10 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
HidPkg/UsbHidDxe/UsbHidDxe.inf {
<LibraryClasses>
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
}

ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf {
<PcdsFixedAtBuild>
Expand Down Expand Up @@ -1356,7 +1366,6 @@ QemuQ35Pkg/Library/ResetSystemLib/StandaloneMmResetSystemLib.inf
gDfciPkgTokenSpaceGuid.PcdSettingsManagerInstallProvider|TRUE
}
MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmpDxe.inf
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
MsCorePkg/AcpiRGRT/AcpiRgrt.inf
MsCorePkg/HelloWorldRustDxe/HelloWorldRustDxe.inf
DfciPkg/Application/DfciMenu/DfciMenu.inf
Expand Down
3 changes: 2 additions & 1 deletion Platforms/QemuQ35Pkg/QemuQ35Pkg.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,8 @@ INF MmSupervisorPkg/Drivers/StandaloneMmUnblockMem/StandaloneMmUnblockMem.inf
# COMMENTED OUT DUE TO LACK OF TPM
# INF SecurityPkg/Tcg/MemoryOverwriteControl/TcgMor.inf
INF MdeModulePkg/Universal/EsrtFmpDxe/EsrtFmpDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
INF HidPkg/UsbHidDxe/UsbHidDxe.inf
INF HidPkg/UefiHidDxe/UefiHidDxe.inf
INF DfciPkg/Application/DfciMenu/DfciMenu.inf
INF MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf
INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
Expand Down
10 changes: 9 additions & 1 deletion Platforms/QemuSbsaPkg/QemuSbsaPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,11 @@
QemuPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
QemuPkg/Virtio10Dxe/Virtio10.inf

#
# HID Support
#
HidPkg/UefiHidDxe/UefiHidDxe.inf

#
# USB Support
#
Expand All @@ -1163,7 +1168,10 @@
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
HidPkg/UsbHidDxe/UsbHidDxe.inf {
<LibraryClasses>
UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
}

#
# TPM2 support
Expand Down
3 changes: 2 additions & 1 deletion Platforms/QemuSbsaPkg/QemuSbsaPkg.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ READ_LOCK_STATUS = TRUE
INF MsWheaPkg/MsWheaReport/Dxe/MsWheaReportDxe.inf
INF MsCorePkg/MuVarPolicyFoundationDxe/MuVarPolicyFoundationDxe.inf
INF MsCorePkg/LoadOptionVariablePolicyDxe/LoadOptionVariablePolicyDxe.inf
INF MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
INF HidPkg/UsbHidDxe/UsbHidDxe.inf
INF HidPkg/UefiHidDxe/UefiHidDxe.inf
INF MsGraphicsPkg/PrintScreenLogger/PrintScreenLogger.inf
INF MsCorePkg/AcpiRGRT/AcpiRgrt.inf
INF SecurityPkg/Hash2DxeCrypto/Hash2DxeCrypto.inf
Expand Down

0 comments on commit cf0becb

Please sign in to comment.