Skip to content

Commit

Permalink
Integrate Rust HID driver (#738)
Browse files Browse the repository at this point in the history
## Description

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.

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

- Verified QemuQ35Pkg and QemuSbsaPkg build and boot to EFI shell

## Integration Instructions

N/A

Signed-off-by: Michael Kubacki <[email protected]>
  • Loading branch information
makubacki committed Oct 19, 2023
1 parent bfb167d commit a14c24e
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 a14c24e

Please sign in to comment.