Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shinyquagsire23/ab6f7c0f9b6514b6b54d69b9a57646be to your computer and use it in GitHub Desktop.
Save shinyquagsire23/ab6f7c0f9b6514b6b54d69b9a57646be to your computer and use it in GitHub Desktop.
Enabling USB device mode on Intel devices (Tweet archive)
https://twitter.com/ShinyQuagsire/status/1536432635643211777 12:37 PM · Jun 13, 2022
-----
I figured out how to enable USB device mode on my XPS 13 (9350) 🎉
Though for some ungodly reason, it uses the right-side full USB port. So a crossover cable is required.
-----
https://twitter.com/ShinyQuagsire/status/1536434057671716864 12:43 PM · Jun 13, 2022
-----
Rough process: Same as https://casualhacking.io/blog/2019/6/2/debug-uefi-code-by-single-stepping-your-coffee-lake-s-hardware-cpu, but looking for "xDCI Support" instead.
Dump the system SPI, get Setup from UEFI, run IFRExtractor.
Used https://github.com/datasone/grub-mod-setup_var/releases/ to do
setup_var_3 0x56B 1
-----
https://twitter.com/44670_/status/1536497209528971264 4:54 PM · Jun 13, 2022
-----
Is xDCI for DCI debug purpose only, or capable for emulating arbitrary usb devices?
-----
https://twitter.com/ShinyQuagsire/status/1536516075130478592 6:09 PM · Jun 13, 2022
-----
Arbitrary devices, `modprobe g_ether` pops up as an ethernet device. Also have to do
`echo device > /sys/bus/platform/devices/intel_xhci_usb_sw/usb_role/intel_xhci_usb_sw-role-switch/role` to switch modes.
Still working on porting on adding FunctionFS to libusbd though.
-----
https://twitter.com/ShinyQuagsire/status/1536478140473651200 3:38 PM · Jun 13, 2022
-----
I also figured it out for my Surface Go 1,
setup_var_cv PchSetup 0x40 1 1
which is super exciting bc that unblocks a project I've had in mind for a while: using it as a plug-in drawing tablet, just present as a HID touchscreen.
-----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment