SlideShare a Scribd company logo
1 of 12
Download to read offline
ACRN I2C Mediator Introduction
CHEN Conghui
Chen, Conghui <conghui,chen@intel.com>
04/29/2020
Agenda
❑ Background
❑ Architecture
❑ Topology
❑ Brief introduction for virtio-i2c FE
❑ What is put in virtqueue by virtio-i2c FE?
❑ Brief introduction for virtio-i2c BE
❑ Add description in ACPI
❑ virtio-i2c usage
Background
In previous code, when the Guest OS wants to access to a slave I2C device, it
should pass through the whole I2C adapter. But if the adapter has two or more
slave devices, and need to be used by different Guests, pass through cannot
meet the requirement.
Architecture
• Work as an I2C adapter.
• Slave devices under same
physical adapter can be
assigned to different virtio-i2c
adapters.
• Support >= 1 slave devices.
• I2C slave devices driver
needn't change.
• Slave devices under different
physical adapter can be
assigned to one virtio-i2c
adapter.
• One virtio-i2c has only 1
virtqueue. For FE, it is
synchronize mode. For BE, it
work in asynchronize mode.
I2c-x
virtio-pci …
Vendor id:
0x1af4/0x8086
virtio-blk virtio-audio
Device Id:
0x1000
Virtio bus
PCI bus
Device Id:
0x860a
…
virto-i2c adapter
xxx yyy
Topology
In our implementation, the virtio-i2c is an I2C adapter, which is detected by virtio bus. But the
peripherals that are connected to the I2C bus are enumerated via the ACPI.
Device Id:
0x8603
i2c_register_adapter
i2c_acpi_register_devices
acpi_walk_namespace(xx,
i2c_acpi_add_device)
i2c_new_device
virtio_i2c_probe
virtio
native
tdf8532_i2c_probe
tdf8532_get_state
i2c_master_send
i2c_transfer
virtio-i2c .master_xfer
ACPI match
virtio
i2cdev_write
/dev/i2c-x
i2c_dev_init
a device use i2c interface
Brief introduction for virtio-i2c FE
*Use tdf8532 as example for
client driver
virtio_xfer
kick
notify
device_register
adapter device
slave device
Add msg to virtqueue
This block diagram only picks few components from I2C
subsystem to show the possible access to virtio-i2c.
What is put in virtqueue by virtio-i2c FE?
virtio-i2c use one virtqueue to transfer the message, the queue size is 64.
As it is an adapter, it receive i2c_msg from I2C core layer. But in this design, the i2c_msg is not
directly added to virtqueue, instead, it was split to 3 parts:
n
Out header
n+1 n+2
addr flags len
data buffer status
in/read out/write
virtqueue
struct i2c_msg {
__u16 addr; /* slave address */
__u16 flags;
__u16 len; /* msg length */
__u8 *buf; /* pointer to msg data */
};
Brief introduction for virtio-i2c BE
Worker
thread
Kick handler
Dispatch
i2c_msg
/dev/i2c-x
get msg
In BE kick handler, a worker thread is created during the initiate phase, and it will wait for a
signal. In the kick handler, when there is new msg in the virtqueue, it will wakeup worker thread
to process the request.
As mentioned above, the data is not i2c_msg. So, in the worker thread, it will reformated to
i2c_msg, then call i2c API to send to kernel space. After that, it will update the result to status in
virtqueue. At last, it notifies the FE driver.
Notify
virtqueue
Shared ring/queue
/dev/i2c-x
signal
1
2
3 4
Add description in ACPI
In native environment, i2c slave device can be probed through ACPI table. In virtio-i2c, it will add
the description for the slave devices under the virtual i2c adapter.
virtual ACPI in acrn-dm
static struct acpi_node acpi_node_table[] = {
{"cam1", acpi_add_cam1},
{"cam2", acpi_add_cam2},
{"hdac", acpi_add_hdac},
{"default", acpi_add_default},
};
virtio-i2c usage
acrn-dm cmdline
acrn-dm
cmdline
-s 19,virtio-i2c,0:70@cam1:71@cam2,4:1C “4” is the i2c adapter on sos side, means”/dev/i2c-4”
“1C” is the address for slave device
connected to /dev/i2c-4.
different native adapters is split by ‘,’
Guest
OS
gordon_peak_acrn:/sys/bus/i2c/devices/i2c-6 # ls
6-a0e0 device i2c-ADV7481B:00 new_device uevent
6-a0e1 firmware_node i2c-dev power
delete_device i2c-ADV7481A:00 name subsystem
“/dev/i2c-6” is the virtio-i2c adapter.
“i2c-ADV7481A:00” is the slave device configured to
ACPI table.
Q & A
Project ACRN I2C mediator introduction

More Related Content

What's hot

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
 
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
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject 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 - 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 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
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRNProject ACRN
 
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
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN
 
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look ForwardACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look ForwardProject 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
 
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
 
Project ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN
 
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...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
 
KVM/ARM Nested Virtualization Support and Performance - SFO17-410
KVM/ARM Nested Virtualization Support and Performance - SFO17-410KVM/ARM Nested Virtualization Support and Performance - SFO17-410
KVM/ARM Nested Virtualization Support and Performance - SFO17-410Linaro
 
Project ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN
 
Project ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN
 

What's hot (20)

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
 
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 configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config tool
 
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 - 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 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
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
 
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 Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look ForwardACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
 
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
 
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 Device Passthrough Introduction
Project ACRN Device Passthrough IntroductionProject ACRN Device Passthrough Introduction
Project ACRN Device Passthrough Introduction
 
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...
XPDDS18: Design Session - SGX deep dive and SGX Virtualization Discussion, Ka...
 
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...
 
KVM/ARM Nested Virtualization Support and Performance - SFO17-410
KVM/ARM Nested Virtualization Support and Performance - SFO17-410KVM/ARM Nested Virtualization Support and Performance - SFO17-410
KVM/ARM Nested Virtualization Support and Performance - SFO17-410
 
Project ACRN CSE Virtualization
Project ACRN CSE VirtualizationProject ACRN CSE Virtualization
Project ACRN CSE Virtualization
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
 
Project ACRN GPIO mediator introduction
Project ACRN GPIO mediator introductionProject ACRN GPIO mediator introduction
Project ACRN GPIO mediator introduction
 
SR-IOV Introduce
SR-IOV IntroduceSR-IOV Introduce
SR-IOV Introduce
 

Similar to Project ACRN I2C mediator introduction

用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver艾鍗科技
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfDaniel Donatelli
 
Republic of IoT 2018 - ESPectro32 and NB-IoT Workshop
Republic of IoT 2018 - ESPectro32 and NB-IoT WorkshopRepublic of IoT 2018 - ESPectro32 and NB-IoT Workshop
Republic of IoT 2018 - ESPectro32 and NB-IoT WorkshopAlwin Arrasyid
 
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...📡 Sebastien Dudek
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdfDaniel Donatelli
 
I2c interfacing raspberry pi to arduino
I2c interfacing raspberry pi to arduinoI2c interfacing raspberry pi to arduino
I2c interfacing raspberry pi to arduinoMike Ochtman
 
C231723
C231723C231723
C231723irjes
 
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...idsecconf
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturersKeatonParker2
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementLF Events
 
LF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OpenvSwitch
 

Similar to Project ACRN I2C mediator introduction (20)

用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
I2c drivers
I2c driversI2c drivers
I2c drivers
 
An hemmanur
An hemmanurAn hemmanur
An hemmanur
 
esp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdfesp32-complex-waveform-generator-v2.pdf
esp32-complex-waveform-generator-v2.pdf
 
Republic of IoT 2018 - ESPectro32 and NB-IoT Workshop
Republic of IoT 2018 - ESPectro32 and NB-IoT WorkshopRepublic of IoT 2018 - ESPectro32 and NB-IoT Workshop
Republic of IoT 2018 - ESPectro32 and NB-IoT Workshop
 
Ik
IkIk
Ik
 
Day 13.1 startingaswitch
Day 13.1 startingaswitchDay 13.1 startingaswitch
Day 13.1 startingaswitch
 
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...
SSTIC 2019 - V2G injector: Whispering to cars and charging units through the ...
 
arduino-esp32-projects.pdf
arduino-esp32-projects.pdfarduino-esp32-projects.pdf
arduino-esp32-projects.pdf
 
I2c interfacing raspberry pi to arduino
I2c interfacing raspberry pi to arduinoI2c interfacing raspberry pi to arduino
I2c interfacing raspberry pi to arduino
 
C231723
C231723C231723
C231723
 
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
 
ijseas20150367
ijseas20150367ijseas20150367
ijseas20150367
 
Tft touch screen manufacturers
Tft touch screen manufacturersTft touch screen manufacturers
Tft touch screen manufacturers
 
SR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and ImprovementSR-IOV ixgbe Driver Limitations and Improvement
SR-IOV ixgbe Driver Limitations and Improvement
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 
Plc operation part 2
Plc operation part 2Plc operation part 2
Plc operation part 2
 
project 3 full report
project 3 full reportproject 3 full report
project 3 full report
 
LF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and Gotchas
 

Recently uploaded

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
 
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
 
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.
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
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
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
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
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

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
 
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
 
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...
 
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...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
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)
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
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...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
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...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

Project ACRN I2C mediator introduction

  • 1. ACRN I2C Mediator Introduction CHEN Conghui Chen, Conghui <conghui,chen@intel.com> 04/29/2020
  • 2. Agenda ❑ Background ❑ Architecture ❑ Topology ❑ Brief introduction for virtio-i2c FE ❑ What is put in virtqueue by virtio-i2c FE? ❑ Brief introduction for virtio-i2c BE ❑ Add description in ACPI ❑ virtio-i2c usage
  • 3. Background In previous code, when the Guest OS wants to access to a slave I2C device, it should pass through the whole I2C adapter. But if the adapter has two or more slave devices, and need to be used by different Guests, pass through cannot meet the requirement.
  • 4. Architecture • Work as an I2C adapter. • Slave devices under same physical adapter can be assigned to different virtio-i2c adapters. • Support >= 1 slave devices. • I2C slave devices driver needn't change. • Slave devices under different physical adapter can be assigned to one virtio-i2c adapter. • One virtio-i2c has only 1 virtqueue. For FE, it is synchronize mode. For BE, it work in asynchronize mode.
  • 5. I2c-x virtio-pci … Vendor id: 0x1af4/0x8086 virtio-blk virtio-audio Device Id: 0x1000 Virtio bus PCI bus Device Id: 0x860a … virto-i2c adapter xxx yyy Topology In our implementation, the virtio-i2c is an I2C adapter, which is detected by virtio bus. But the peripherals that are connected to the I2C bus are enumerated via the ACPI. Device Id: 0x8603
  • 6. i2c_register_adapter i2c_acpi_register_devices acpi_walk_namespace(xx, i2c_acpi_add_device) i2c_new_device virtio_i2c_probe virtio native tdf8532_i2c_probe tdf8532_get_state i2c_master_send i2c_transfer virtio-i2c .master_xfer ACPI match virtio i2cdev_write /dev/i2c-x i2c_dev_init a device use i2c interface Brief introduction for virtio-i2c FE *Use tdf8532 as example for client driver virtio_xfer kick notify device_register adapter device slave device Add msg to virtqueue This block diagram only picks few components from I2C subsystem to show the possible access to virtio-i2c.
  • 7. What is put in virtqueue by virtio-i2c FE? virtio-i2c use one virtqueue to transfer the message, the queue size is 64. As it is an adapter, it receive i2c_msg from I2C core layer. But in this design, the i2c_msg is not directly added to virtqueue, instead, it was split to 3 parts: n Out header n+1 n+2 addr flags len data buffer status in/read out/write virtqueue struct i2c_msg { __u16 addr; /* slave address */ __u16 flags; __u16 len; /* msg length */ __u8 *buf; /* pointer to msg data */ };
  • 8. Brief introduction for virtio-i2c BE Worker thread Kick handler Dispatch i2c_msg /dev/i2c-x get msg In BE kick handler, a worker thread is created during the initiate phase, and it will wait for a signal. In the kick handler, when there is new msg in the virtqueue, it will wakeup worker thread to process the request. As mentioned above, the data is not i2c_msg. So, in the worker thread, it will reformated to i2c_msg, then call i2c API to send to kernel space. After that, it will update the result to status in virtqueue. At last, it notifies the FE driver. Notify virtqueue Shared ring/queue /dev/i2c-x signal 1 2 3 4
  • 9. Add description in ACPI In native environment, i2c slave device can be probed through ACPI table. In virtio-i2c, it will add the description for the slave devices under the virtual i2c adapter. virtual ACPI in acrn-dm static struct acpi_node acpi_node_table[] = { {"cam1", acpi_add_cam1}, {"cam2", acpi_add_cam2}, {"hdac", acpi_add_hdac}, {"default", acpi_add_default}, };
  • 10. virtio-i2c usage acrn-dm cmdline acrn-dm cmdline -s 19,virtio-i2c,0:70@cam1:71@cam2,4:1C “4” is the i2c adapter on sos side, means”/dev/i2c-4” “1C” is the address for slave device connected to /dev/i2c-4. different native adapters is split by ‘,’ Guest OS gordon_peak_acrn:/sys/bus/i2c/devices/i2c-6 # ls 6-a0e0 device i2c-ADV7481B:00 new_device uevent 6-a0e1 firmware_node i2c-dev power delete_device i2c-ADV7481A:00 name subsystem “/dev/i2c-6” is the virtio-i2c adapter. “i2c-ADV7481A:00” is the slave device configured to ACPI table.
  • 11. Q & A