SlideShare a Scribd company logo
1 of 15
Download to read offline
ACRN USB Mediator Introduction
LIU Long
Liu, Long <Long.Liu@intel.com>
05/06/2020
Agenda
• USB architecture overview
• xHCI virtualization
• DRD virtualization
• Questions
USB native architecture
Android OS
Intel APL hardware
User
Kernel
xHCI controller xDCI
Controller
native xDCI Driver
native xHCI
Driver
DRD driver
usb subsystemsys I/F
PHY MUX control
USB2 PHY USB3 PHY
PHY MUX
Intel ApolloLake platform
integrated one xHCI controller and
one xDCI controller. One of xHCI
controller port shares same
couple USB Phys with xDCI
controller.
Inside of xHCI controller, there
has two vender extended
registers to support this couple
USB Phys switching.
The Apple Carplay feature require
the OTG functionality, its control
protocol implement base on USB
host mode, and batch data
transfer will over USB peripheral
mode. So it will trigger USB role
switch at appropriate time.
gadget
subsystem
role switch
CarPlay
application
USB device model architecture
Service OS
ACRN Hypervisor
User OS
User OS
APL hardware
User OS
User
Kernel
xHCI controller xDCI
Controller
native xDCI Driver
native Intel DRD
Driver
native xHCI
Driver
SW Role Switch
sys I/F
CarPlay
Application
xHCI DM
User
Kernel
native xHCI
Driver
native DRD
Driver
usbfssys I/F
PHY MUX control
USB2 PHY USB3 PHY
PHY MUX
VT-D
DRD DM
acrn-dm
xHCI emulator provides multiple
instances of virtual xHCI controller
to share among multiple User Oss,
each USB port can be dedicatedly
assigned to a VM.
xDCI controller can be passed
through to the specific user OS
with I/O MMU assistance.
DRD device model emulate the
APL PHY MUX control logic. The
frontend re-use the native Intel
USB role driver directly which
provides sysfs interface to user
space of user OS to switch
DCI/HCI role in CarPlay SW.
usb subsystemgadget
subsystem
Agenda
• USB architecture overview
• xHCI virtualization
• DRD virtualization
• Questions
APL MRB Board
Intel APL xHCI hardware design
APL SOC
USB1-mouse USB3-disk USB1-keyboard
Physical xHCI controller
USB2-roothub
1-1 1-2 1-3
USB3-roothub
2-1 2-2 2-3
hs phy ss phy hs phyhs phy ss phy
USB device naming format:
bus-port:config.intf
USB port naming format:
bus-port
The xHCI controller in Intel APL platform
includes 6 usb ports
3 * USB2 ports: 1-1, 1-2, 1-3
3 * USB3 ports: 2-1, 2-2, 2-3
There have 3 USB receptacles on APL
MRB board
One USB 3.0 OTG receptacle:
“1-1”+“2-1”
One USB 3.0 standard A receptacle:
“1-2”+ “2-2”
One USB 2.0 standard A receptacle:
“1-3”
ACRN Hypervisor
User OS
User OS
Service OS
APL hardware
User OS
User
Kernel
acrn-dm
xHCI controller
native Intel DRD
Driver
native xHCI
Driver
SW Role Switch
sys I/F
CarPlay
Application
xHCI DM
User
Kernel
native xHCI Drivernative DRD Driver
usbfs
sys I/F
PHY MUX control
DRD DM
USB Core
USB Port Mapper
libusb
xHCI virtualization architecture
'xHCI DM' emulates the xHCI
controller logic followed xHCI
spec;
'USB core' is a middle abstract
layer to isolate the USB controller
emulators and USB device
emulators.
‘USB Port Mapper’ is used to
mapping the native physical
specific USB ports to virtual USB
ports. It communicates with native
USB ports by libusb.
All the USB data buffer from UOS
(User OS) are in the form of TRB
(Transfer Request Block)
according to xHCI spec. And xHCI
DM will fetch these data buffers
once related xHCI doorbell
registers be set. Then these data
will convert to struct
usb_data_xfer and through USB
core forward to USB port mapper
module which will communicate
with native USB stack over libusb,
vice versa.
xHCI DM usage
The device model configuration command syntax for xHCI is as follows:
-s <slot>,xhci,[bus1-port1:bus2-port2]
slot: virtual PCI slot number in DM;
bus-port: this parameter used to specific which physical USB ports need to map to UOS.
For example:
-s 7,xhci,1-2:2-2
This parameter will expose one virtual PCI xHCI controller with 00:07:0 BDF.
This virtual xHCI controller integrated 10 virtual usb2 ports and 10 virtual usb3 ports. Its virtual 1-1 port will map to
physical 1-2 port, and virtual 2-1 port map to physical 2-2 port. Other virtual ports are reserved for physical HUB port
support.
Agenda
• USB architecture overview
• xHCI virtualization
• DRD virtualization
• Questions
Traditional OTG solution
• Tradition USB OTG solution uses one single
USB OTG controller for support
OTG/Device/Host mode.
• All USB2&USB3&ID signals will connect one
pair USB2&USB3 PHY which connect to OTG
controller directly.
• The OTG mode inside of OTG controller will
monitor ID/VBUS change and report to the
OTG driver.
• OTG driver should configure a set of registers
to switch Host mode and Device mode
followed ID/VBUS state.
Intel Dual Role Device solution
APL MRB Board
APL SOC
USB1-mouse USB3-disk USB1-keyboard
Physical xHCI controller
USB2-roothub
1-1 1-2 1-3
USB3-roothub
2-1 2-2 2-3
hs phy ss phy hs phy
Physical xDCI controller
usb2 port usb3 port
hs phy ss phy
phy mux
phy mux
control
• Dual Role implementation on Intel
APL platform uses separated xDCI
and xHCI controller to support the
OTG port.
• There has one pair USB2&USB3
PHY shared between xDCI and one
port of xHCI. And ID/VBUS signals
be monitored by other
component(like PMIC/Charger IC)
• Inside of xHCI controller, there has
one “phy mux control” logic to
support switch shared phy route
path.
Simplified DRD/OTG state-machine
• Disconnect State
• State Entry: No cable plugged in the OTG port.
• State Exit: Connect USB host or USB micro A cable.
• Device State:
• State Entry: Plug in USB micro B cable with USB host connection which trigger VBUS valid.
• State Exit: Disconnect USB host cause VBUS drop then transit to Disconnect State.
• Host State:
• State Entry: Plug in USB micro A cable make the ID ground.
• State Exit: Plug out USB micro A cable cause ID float then transit to Disconnect State.
Disconnect State Host StateDevice State
VBUS
Valid
VBUS
Drop
ID Ground
ID Float
DRD virtualization architecture
ACRN emulates the DRD
hardware logic of Intel Apollo
Lake platform to support the dual
role device requirement.
DRD feature implemented as
xHCI vendor extended capability
on Intel Apollo Lake platform,
ACRN emulates in the same way,
so the native driver can be re-
used in UOS.
Once UOS DRD driver
reads/writes the related xHCI
extended registers, these access
will be captured by xHCI DM. And
xHCI DM will do the Host/Device
mode switch operations through
native DRD related sysfs
interface.
ACRN Hypervisor
User OS
User OS
Service OS
APL hardware
User OS
User
Kernel
acrn-dm
xHCI controller
Native Intel DRD
Driver
Native xDCI
Driver
SW Role Switch
Sys I/F
CarPlay
Application
xHCI DM
User
Kernel
Native DRD Driver
Sys I/F
PHY MUX control
DRD DM
Native xDCI
Driver
DRD DM usage
The device model configuration command syntax for xHCI DRD is as follows:
-s <slot>,xhci,[bus1-port1:bus2-port2]:cap=platform
cap: cap means virtual xHCI capability, this parameter uses to indicate virtual xHCI should emulate which platform’s
xHCI capabilities.
For example:
-s 7,xhci,1-2:2-2:cap=apl
This parameter will expose one virtual PCI xHCI controller with 00:07:0 BDF.
This virtual xHCI controller integrated 10 usb2 ports and 10 usb3 ports. Its virtual 1-1 port will map to physical 1-2 port,
and virtual 2-1 port map to physical 2-2 port. Other ports are reserved for physical HUB port support.
This virtual xHCI controller support Intel APL extend xHCI capability(i.e. DRD)
Questions?

More Related Content

What's hot

ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionProject ACRN
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingProject ACRN
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN
 
Project ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN
 
Project ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorialProject ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorialProject ACRN
 
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
ACRN vMeet-Up EU 2021 -  functional safety design and certification planACRN vMeet-Up EU 2021 -  functional safety design and certification plan
ACRN vMeet-Up EU 2021 - functional safety design and certification planProject ACRN
 
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance OptimizationACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance OptimizationProject ACRN
 
Project ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN
 
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...Project ACRN
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN
 
Hardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsHardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsThe Linux Foundation
 
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...The Linux Foundation
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversAnne Nicolas
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilAnne Nicolas
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)Linaro
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentGlobalLogic Ukraine
 
Kernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelKernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelAnne Nicolas
 
Fosdem 17 - Towards a HVM-like Dom0 for Xen
Fosdem 17 - Towards a HVM-like Dom0 for XenFosdem 17 - Towards a HVM-like Dom0 for Xen
Fosdem 17 - Towards a HVM-like Dom0 for XenThe Linux Foundation
 

What's hot (20)

ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
Project ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN CSE Virtualization
Project ACRN CSE Virtualization
 
Project ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorialProject ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorial
 
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
ACRN vMeet-Up EU 2021 -  functional safety design and certification planACRN vMeet-Up EU 2021 -  functional safety design and certification plan
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
 
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance OptimizationACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
 
Project ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN GPIO mediator introduction
Project ACRN GPIO mediator introduction
 
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough Introduction
 
Hardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsHardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ Processors
 
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
 
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and DriversKernel Recipes 2014 - Testing Video4Linux Applications and Drivers
Kernel Recipes 2014 - Testing Video4Linux Applications and Drivers
 
Spi drivers
Spi driversSpi drivers
Spi drivers
 
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans VerkuilKernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
Kernel Recipes 2017 - HDMI CEC: Status Report - Hans Verkuil
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
 
Kernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernelKernel Recipes 2013 - Overview display in the Linux kernel
Kernel Recipes 2013 - Overview display in the Linux kernel
 
Linux I2C
Linux I2CLinux I2C
Linux I2C
 
Fosdem 17 - Towards a HVM-like Dom0 for Xen
Fosdem 17 - Towards a HVM-like Dom0 for XenFosdem 17 - Towards a HVM-like Dom0 for Xen
Fosdem 17 - Towards a HVM-like Dom0 for Xen
 

Similar to Project ACRN USB mediator introduction

Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Roberto Navoni
 
Multipilot pres-ufficiale def
Multipilot pres-ufficiale defMultipilot pres-ufficiale def
Multipilot pres-ufficiale defRoberto Navoni
 
Redteaming HID attacks
Redteaming HID attacksRedteaming HID attacks
Redteaming HID attacksJuan Espin
 
2nd ARM Developer Day - NXP USB Workshop
2nd ARM Developer Day - NXP USB Workshop2nd ARM Developer Day - NXP USB Workshop
2nd ARM Developer Day - NXP USB WorkshopAntonio Mondragon
 
Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011Roberto Navoni
 
Pendrive to pendrive data transfer without pc
Pendrive to pendrive data transfer without pcPendrive to pendrive data transfer without pc
Pendrive to pendrive data transfer without pcVishnu Kudumula
 
Ami device driver_services ver. 1.1
Ami device driver_services ver.  1.1Ami device driver_services ver.  1.1
Ami device driver_services ver. 1.1Sunil Sam
 
The Advent of Automotive Linux
The Advent of Automotive LinuxThe Advent of Automotive Linux
The Advent of Automotive LinuxAlison Chaiken
 
Robot controlled car using Wireless Module
 Robot controlled car using Wireless Module Robot controlled car using Wireless Module
Robot controlled car using Wireless Moduleshreyaseksambe
 
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-Resolution
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-ResolutionUltra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-Resolution
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-ResolutionIntel® Software
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleMirco Vanini
 

Similar to Project ACRN USB mediator introduction (20)

Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
 
Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2
 
Multipilot pres-ufficiale def
Multipilot pres-ufficiale defMultipilot pres-ufficiale def
Multipilot pres-ufficiale def
 
An1003 usb
An1003 usbAn1003 usb
An1003 usb
 
Programming guide for linux usb device drivers
Programming guide for linux usb device driversProgramming guide for linux usb device drivers
Programming guide for linux usb device drivers
 
Redteaming HID attacks
Redteaming HID attacksRedteaming HID attacks
Redteaming HID attacks
 
2nd ARM Developer Day - NXP USB Workshop
2nd ARM Developer Day - NXP USB Workshop2nd ARM Developer Day - NXP USB Workshop
2nd ARM Developer Day - NXP USB Workshop
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011
 
microprocessor
   microprocessor   microprocessor
microprocessor
 
Pendrive to pendrive data transfer without pc
Pendrive to pendrive data transfer without pcPendrive to pendrive data transfer without pc
Pendrive to pendrive data transfer without pc
 
Ami device driver_services ver. 1.1
Ami device driver_services ver.  1.1Ami device driver_services ver.  1.1
Ami device driver_services ver. 1.1
 
The Advent of Automotive Linux
The Advent of Automotive LinuxThe Advent of Automotive Linux
The Advent of Automotive Linux
 
DRIVE PX 2
DRIVE PX 2DRIVE PX 2
DRIVE PX 2
 
Agnostic Device Drivers
Agnostic Device DriversAgnostic Device Drivers
Agnostic Device Drivers
 
Robot controlled car using Wireless Module
 Robot controlled car using Wireless Module Robot controlled car using Wireless Module
Robot controlled car using Wireless Module
 
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-Resolution
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-ResolutionUltra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-Resolution
Ultra HD Video Scaling: Low-Power HW FF vs. CNN-based Super-Resolution
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
 
Usb Overview
Usb OverviewUsb Overview
Usb Overview
 

More from Project ACRN

ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootProject ACRN
 
ACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development modelACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development modelProject ACRN
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRNProject ACRN
 
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN
 
Project ACRN system debug
Project ACRN system debugProject ACRN system debug
Project ACRN system debugProject ACRN
 
Project ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRNProject ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRNProject ACRN
 
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisorProject ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisorProject ACRN
 
Project ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOSProject ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOSProject ACRN
 
Project ACRN EtherCAT 101
Project ACRN EtherCAT 101Project ACRN EtherCAT 101
Project ACRN EtherCAT 101Project ACRN
 
Project ACRN schedule framework introduction
Project ACRN schedule framework introductionProject ACRN schedule framework introduction
Project ACRN schedule framework introductionProject ACRN
 

More from Project ACRN (10)

ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
 
ACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development modelACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development model
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
 
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introduction
 
Project ACRN system debug
Project ACRN system debugProject ACRN system debug
Project ACRN system debug
 
Project ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRNProject ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRN
 
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisorProject ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
 
Project ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOSProject ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOS
 
Project ACRN EtherCAT 101
Project ACRN EtherCAT 101Project ACRN EtherCAT 101
Project ACRN EtherCAT 101
 
Project ACRN schedule framework introduction
Project ACRN schedule framework introductionProject ACRN schedule framework introduction
Project ACRN schedule framework introduction
 

Recently uploaded

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 

Recently uploaded (20)

ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 

Project ACRN USB mediator introduction

  • 1. ACRN USB Mediator Introduction LIU Long Liu, Long <Long.Liu@intel.com> 05/06/2020
  • 2. Agenda • USB architecture overview • xHCI virtualization • DRD virtualization • Questions
  • 3. USB native architecture Android OS Intel APL hardware User Kernel xHCI controller xDCI Controller native xDCI Driver native xHCI Driver DRD driver usb subsystemsys I/F PHY MUX control USB2 PHY USB3 PHY PHY MUX Intel ApolloLake platform integrated one xHCI controller and one xDCI controller. One of xHCI controller port shares same couple USB Phys with xDCI controller. Inside of xHCI controller, there has two vender extended registers to support this couple USB Phys switching. The Apple Carplay feature require the OTG functionality, its control protocol implement base on USB host mode, and batch data transfer will over USB peripheral mode. So it will trigger USB role switch at appropriate time. gadget subsystem role switch CarPlay application
  • 4. USB device model architecture Service OS ACRN Hypervisor User OS User OS APL hardware User OS User Kernel xHCI controller xDCI Controller native xDCI Driver native Intel DRD Driver native xHCI Driver SW Role Switch sys I/F CarPlay Application xHCI DM User Kernel native xHCI Driver native DRD Driver usbfssys I/F PHY MUX control USB2 PHY USB3 PHY PHY MUX VT-D DRD DM acrn-dm xHCI emulator provides multiple instances of virtual xHCI controller to share among multiple User Oss, each USB port can be dedicatedly assigned to a VM. xDCI controller can be passed through to the specific user OS with I/O MMU assistance. DRD device model emulate the APL PHY MUX control logic. The frontend re-use the native Intel USB role driver directly which provides sysfs interface to user space of user OS to switch DCI/HCI role in CarPlay SW. usb subsystemgadget subsystem
  • 5. Agenda • USB architecture overview • xHCI virtualization • DRD virtualization • Questions
  • 6. APL MRB Board Intel APL xHCI hardware design APL SOC USB1-mouse USB3-disk USB1-keyboard Physical xHCI controller USB2-roothub 1-1 1-2 1-3 USB3-roothub 2-1 2-2 2-3 hs phy ss phy hs phyhs phy ss phy USB device naming format: bus-port:config.intf USB port naming format: bus-port The xHCI controller in Intel APL platform includes 6 usb ports 3 * USB2 ports: 1-1, 1-2, 1-3 3 * USB3 ports: 2-1, 2-2, 2-3 There have 3 USB receptacles on APL MRB board One USB 3.0 OTG receptacle: “1-1”+“2-1” One USB 3.0 standard A receptacle: “1-2”+ “2-2” One USB 2.0 standard A receptacle: “1-3”
  • 7. ACRN Hypervisor User OS User OS Service OS APL hardware User OS User Kernel acrn-dm xHCI controller native Intel DRD Driver native xHCI Driver SW Role Switch sys I/F CarPlay Application xHCI DM User Kernel native xHCI Drivernative DRD Driver usbfs sys I/F PHY MUX control DRD DM USB Core USB Port Mapper libusb xHCI virtualization architecture 'xHCI DM' emulates the xHCI controller logic followed xHCI spec; 'USB core' is a middle abstract layer to isolate the USB controller emulators and USB device emulators. ‘USB Port Mapper’ is used to mapping the native physical specific USB ports to virtual USB ports. It communicates with native USB ports by libusb. All the USB data buffer from UOS (User OS) are in the form of TRB (Transfer Request Block) according to xHCI spec. And xHCI DM will fetch these data buffers once related xHCI doorbell registers be set. Then these data will convert to struct usb_data_xfer and through USB core forward to USB port mapper module which will communicate with native USB stack over libusb, vice versa.
  • 8. xHCI DM usage The device model configuration command syntax for xHCI is as follows: -s <slot>,xhci,[bus1-port1:bus2-port2] slot: virtual PCI slot number in DM; bus-port: this parameter used to specific which physical USB ports need to map to UOS. For example: -s 7,xhci,1-2:2-2 This parameter will expose one virtual PCI xHCI controller with 00:07:0 BDF. This virtual xHCI controller integrated 10 virtual usb2 ports and 10 virtual usb3 ports. Its virtual 1-1 port will map to physical 1-2 port, and virtual 2-1 port map to physical 2-2 port. Other virtual ports are reserved for physical HUB port support.
  • 9. Agenda • USB architecture overview • xHCI virtualization • DRD virtualization • Questions
  • 10. Traditional OTG solution • Tradition USB OTG solution uses one single USB OTG controller for support OTG/Device/Host mode. • All USB2&USB3&ID signals will connect one pair USB2&USB3 PHY which connect to OTG controller directly. • The OTG mode inside of OTG controller will monitor ID/VBUS change and report to the OTG driver. • OTG driver should configure a set of registers to switch Host mode and Device mode followed ID/VBUS state.
  • 11. Intel Dual Role Device solution APL MRB Board APL SOC USB1-mouse USB3-disk USB1-keyboard Physical xHCI controller USB2-roothub 1-1 1-2 1-3 USB3-roothub 2-1 2-2 2-3 hs phy ss phy hs phy Physical xDCI controller usb2 port usb3 port hs phy ss phy phy mux phy mux control • Dual Role implementation on Intel APL platform uses separated xDCI and xHCI controller to support the OTG port. • There has one pair USB2&USB3 PHY shared between xDCI and one port of xHCI. And ID/VBUS signals be monitored by other component(like PMIC/Charger IC) • Inside of xHCI controller, there has one “phy mux control” logic to support switch shared phy route path.
  • 12. Simplified DRD/OTG state-machine • Disconnect State • State Entry: No cable plugged in the OTG port. • State Exit: Connect USB host or USB micro A cable. • Device State: • State Entry: Plug in USB micro B cable with USB host connection which trigger VBUS valid. • State Exit: Disconnect USB host cause VBUS drop then transit to Disconnect State. • Host State: • State Entry: Plug in USB micro A cable make the ID ground. • State Exit: Plug out USB micro A cable cause ID float then transit to Disconnect State. Disconnect State Host StateDevice State VBUS Valid VBUS Drop ID Ground ID Float
  • 13. DRD virtualization architecture ACRN emulates the DRD hardware logic of Intel Apollo Lake platform to support the dual role device requirement. DRD feature implemented as xHCI vendor extended capability on Intel Apollo Lake platform, ACRN emulates in the same way, so the native driver can be re- used in UOS. Once UOS DRD driver reads/writes the related xHCI extended registers, these access will be captured by xHCI DM. And xHCI DM will do the Host/Device mode switch operations through native DRD related sysfs interface. ACRN Hypervisor User OS User OS Service OS APL hardware User OS User Kernel acrn-dm xHCI controller Native Intel DRD Driver Native xDCI Driver SW Role Switch Sys I/F CarPlay Application xHCI DM User Kernel Native DRD Driver Sys I/F PHY MUX control DRD DM Native xDCI Driver
  • 14. DRD DM usage The device model configuration command syntax for xHCI DRD is as follows: -s <slot>,xhci,[bus1-port1:bus2-port2]:cap=platform cap: cap means virtual xHCI capability, this parameter uses to indicate virtual xHCI should emulate which platform’s xHCI capabilities. For example: -s 7,xhci,1-2:2-2:cap=apl This parameter will expose one virtual PCI xHCI controller with 00:07:0 BDF. This virtual xHCI controller integrated 10 usb2 ports and 10 usb3 ports. Its virtual 1-1 port will map to physical 1-2 port, and virtual 2-1 port map to physical 2-2 port. Other ports are reserved for physical HUB port support. This virtual xHCI controller support Intel APL extend xHCI capability(i.e. DRD)