SlideShare a Scribd company logo
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 introduction
Project 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 enabling
Project ACRN
 
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
 
Project ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN CSE Virtualization
Project ACRN CSE Virtualization
Project 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 tutorial
Project 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 plan
Project 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 Optimization
Project ACRN
 
Project ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN GPIO mediator introduction
Project ACRN GPIO mediator introduction
Project 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 Introduction
Project 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™ Processors
The 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 Drivers
Anne Nicolas
 
Spi drivers
Spi driversSpi drivers
Spi drivers
pradeep_tewani
 
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
Anne 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 Development
GlobalLogic 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 kernel
Anne Nicolas
 
Linux I2C
Linux I2CLinux I2C
Linux I2C
KaidenYu
 
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
The 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

Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
Tavish Naruka
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
Michael Hallak-Stamler
 
Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2Multipilot pres-ufficiale last 2
Multipilot pres-ufficiale last 2
Roberto Navoni
 
Multipilot pres-ufficiale def
Multipilot pres-ufficiale defMultipilot pres-ufficiale def
Multipilot pres-ufficiale def
Roberto Navoni
 
An1003 usb
An1003 usbAn1003 usb
An1003 usb
Eng Seng Lim
 
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
Integrated Circuit Design Research & Education Center (ICDREC)
 
Redteaming HID attacks
Redteaming HID attacksRedteaming HID attacks
Redteaming HID attacks
Juan 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 Workshop
Antonio Mondragon
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
Anil Kumar Pugalia
 
Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011Multipilot pres-ufficiale alpago 2011
Multipilot pres-ufficiale alpago 2011
Roberto Navoni
 
microprocessor
   microprocessor   microprocessor
microprocessor
ATTO RATHORE
 
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
Vishnu 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.1
Sunil Sam
 
The Advent of Automotive Linux
The Advent of Automotive LinuxThe Advent of Automotive Linux
The Advent of Automotive Linux
Alison Chaiken
 
DRIVE PX 2
DRIVE PX 2DRIVE PX 2
DRIVE PX 2
Shri Sundaram
 
Agnostic Device Drivers
Agnostic Device DriversAgnostic Device Drivers
Agnostic Device Drivers
Heiko Joerg Schick
 
Robot controlled car using Wireless Module
 Robot controlled car using Wireless Module Robot controlled car using Wireless Module
Robot controlled car using Wireless Module
shreyaseksambe
 
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
Intel® 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 sample
Mirco Vanini
 
Usb Overview
Usb OverviewUsb Overview
Usb Overview
Pradeep Patel
 

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 Boot
Project 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 model
Project ACRN
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
Project 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
 
Project ACRN system debug
Project ACRN system debugProject ACRN system debug
Project ACRN system debug
Project ACRN
 
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
 
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
 
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
 
Project ACRN EtherCAT 101
Project ACRN EtherCAT 101Project ACRN EtherCAT 101
Project ACRN EtherCAT 101
Project ACRN
 
Project ACRN schedule framework introduction
Project ACRN schedule framework introductionProject ACRN schedule framework introduction
Project ACRN schedule framework introduction
Project 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

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 

Recently uploaded (20)

GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 

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)