SlideShare a Scribd company logo
1 |
Lopper
Bruce Ashfield & Stefano Stabellini
ELC NA 2022
2 |
System Device Tree & Heterogeneous computing
• Heterogeneous System with multiple HW components
• A72s,R5s,PMC, MicroBlaze clusters
• Multiple Execution Domains with its own address map
• Each domain with its own operating system
• Multiple execution levels (EL)
• Multiple Security Environments
• E.g.: U-Boot, TF-A, Xen, Linux, OPTEE,Zephyr, baremetal
• The system is divided into domains
• Each domain is an independentoperating environment with
CPUs, memory,and devices allocated to it
• System Device Tree: extending DT to describe the full system
• Including multiple heterogeneous CPU clusters
• Including multiple domains
Secure State
Trusted Firmware (TF)
App App
Trusted Execution
Environment(TEE)
Non-secure State
Hypervisor
App App
Linux
App
RTOS
FPGA
MicroBlaze
App App
RTOS
MicroBlaze
App
Bare Metal
A72
Core 0
A72
Core 1
RPU
R5 Core 0
App App
RTOS
R5 Core 1
App
Bare Metal
Container
App
EL0
EL1
EL2
EL3
App App
Platform ManagementController (PMC)
PLM
Devices
Memory
3 |
System Device Tree
• Device Tree expresses HW information relevant to an operating environment
• Used by U-Boot, Linux, Xen, TF-A and others
• System Device Tree is an extension to Device Tree to describe the full system
• It describes multiple CPU clusters with different address maps
• Both A72s and R5s
• It describes multiple domains and the resources allocated to each
• A domain could be:
• an heterogenous computing unit, e.g. Zephyr on R5s
• an operating environment at a specific execution level, e.g. OPTEE
• a virtual machine, e.g. a Xen domain
4 |
Lopper: an introduction
• Lopper
• Is a framework for manipulating System Device Trees and transforming information
• Original goal / concept was to produce standard devices trees to support existing platforms/OSs
• Produces any number of outputs: device trees, generated code, custom, etc
• Flexible development / runtime workflow integration
• Data driven
• A few details:
• OpenSource, BSD-3 License
• https://github.com/devicetree-org/lopper, https://pypi.org/project/lopper/
• Written in python, using pluggable backends (libfdt,dtlib) for device tree manipulations
• Additional logic components in the future
• Works with dts, dtb and yaml inputs
• Supports unit operations (lops) and more complex python assist modules
• Depending on the task, both can be used
• Flexible output / input is provided via python assists
• Performs validation and consistency checking
5 |
Lopper: a framework
• Common base for tooling inquiring or manipulating device trees​
• Built-in:
• Core tree manipulation, merging
• Input and output: dts / dtb / yaml
• Parsing: libfdt or dtlib
• Assist / lop management
• Device tree sanity and consistency checking
• Tree manipulation library / routines
6 |
Lopper: a framework
• Optional / plugin:
• Assists provide Logic / semantics / context awareness
• Front ends
• domains / protection, yaml expansion
• Backends / Assists
• System Device tree pruning
• RTOS/Bare Metal backend creates #defines into #include files (early availability)
• OpenAMP plugin that generates device specific DT for shared pages/IRQs
• Security / partitioning backend for subsystem and firewall information (TBD)
• Default Domain specification plugin creates a YAML file that can later be edited (under development)
• Verification assist that compares DTs from different domains to make sure they are compatible (TBD)
• Sub device tree / overlay extraction
• Detailed tree analysis / modification
• Source validation and expansion
• ReST API: an HTTP server to support GUIs and other tooling
7 |
Lopper: components
Lopper Core
YAML
dts
other
YAML
dts
dtb
other
ruamel
or
pyyaml
libfdt
or
dtlib
Lopper
Lopper:
Tree,
Fdt/Dt,Sdt
..
importer
yaml / xlate
Device /
domain
lops
exporter
ruamel
or
pyyaml
libfdt
or
dtlib
custom custom
lops
inputs outputs
Front ends Back ends
assists
Linux
RTOS
Bare Metal
devicetree.org
• bindings
• schemas
• ….
• Systemdevicetree
• Boarddts
• overlays
• ‘Standard’device tree
• C-devicedrivers
• Configuration
• ….
dtc cpp
8 |
Xen Partial Device Trees
• Similar to device tree overlays but older
• Everything under the top-level passthrough
node is copied to the guest device tree
• Xen reads partial device trees today to:
• configure guest device assignment
• describe passthrough hardware to the guest
• Starting from a copy of the host device tree
node and editing it
• Removing unwanted properties
• Adding Xen specific properties
passthrough {
compatible = "simple-bus";
ranges;
#address-cells = <0x2>;
#size-cells = <0x2>;
timer@ff110000 {
compatible = "cdns,ttc";
status = "okay";
interrupt-parent = <0xfde8>;
interrupts = <0x0 0x24 0x4 0x0 0x25 0x4 0x0 0x26 0x4>;
reg = <0x0 0xff110000 0x0 0x1000>;
timer-width = <0x20>;
xen,force-assign-without-iommu = <1>;
xen,reg = <0x0 0xff110000 0x0 0x1000 0x0 0xff110000>;
xen,path = "/axi/timer@ff110000";
};
};
9 |
Xen Partial Device Trees
• Xen specific properties and quirks:
• xen,reg to specify memory mappings
• xen,path points to the corresponding host device tree node (used for IOMMU configurations)
• xen,force-assign-without-iommu when IOMMU configuration is not necessary
• interrupt-parents = <0xfde8> to point to the virtual interrupt controller of the guest
• no iommus, because the IOMMU is used by Xen and not exposed to the guest
• xen,passthrough; in the corresponding host device tree node to mark it for assignment
timer@ff110000 {
compatible = "cdns,ttc";
status = "okay";
interrupt-parent = <0xfde8>;
interrupts = <0x0 0x24 0x4 0x0 0x25 0x4 0x0 0x26 0x4>;
reg = <0x0 0xff110000 0x0 0x1000>;
timer-width = <0x20>;
xen,force-assign-without-iommu = <1>;
xen,reg = <0x0 0xff110000 0x0 0x1000 0x0 0xff110000>;
xen,path = "/axi/timer@ff110000";
};
10 |
Xen Partial Device Trees: the problems
• Xen specific changes are not simple, but they could be automated more easily
• Xen properties aside, how to generate the partial device tree?
• Which properties to remove compared to the host device tree node?
• How to solve clock dependencies? Do we need to include the clock controller too?
• What about power domains and reset lines?
• Generic problem: affects device assignment on any hypervisor and heterogeneous domains too
11 |
Xen Partial Device Trees: a more complex example
zynqmp-firmware {
compatible = "xlnx,zynqmp-firmware", "xlnx,zynqmp";
method = "smc";
#power-domain-cells = <0x1>;
phandle = <0x1>;
clock-controller {
u-boot,dm-pre-reloc;
#clock-cells = <0x1>;
compatible = "xlnx,zynqmp-clk";
clocks = <0x6 0x7 0x8 0x9 0xa>;
clock-names = "pss_ref_clk", "video_clk",
"pss_alt_ref_clk",
"aux_ref_clk", "gt_crx_ref_clk";
phandle = <0x3>;
};
};
pss_ref_clk {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <0x1fc9350>;
phandle = <0x6>;
};
video_clk {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <0x1fc9f08>;
phandle = <0x7>;
};
pss_alt_ref_clk {
compatible = "fixed-clock";
#clock-cells = <0x0>;
clock-frequency = <0x0>;
phandle = <0x8>;
};
[…]
mmc@ff170000 {
compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a";
status = "okay";
interrupt-parent = <0xfde8>;
interrupts = <0x0 0x31 0x4>;
reg = <0x0 0xff170000 0x0 0x1000>;
xlnx,device_id = <0x1>;
clock-names = "clk_xin", "clk_ahb";
#clock-cells = <0x1>;
clock-output-names = "clk_out_sd1", "clk_in_sd1";
clocks = <0x3 0x37 0x3 0x1f>;
phandle = <0x37>;
xen,reg = <0x0 0xff170000 0x0 0x1000 0x0 0xff170000>;
xen,path = "/axi/mmc@ff170000";
};
12 |
The Solution with Lopper
• Leverage core Lopper functionality + assists
• Read the device tree -> LopperTree
• Analyze the devices
• Manipulate the tree
• Output dts/dtbs for passthrough devices
• Trigger image generation (optional)
• Requirements:
• No hardcoded Xen knowledge
• Inputs + devicetree properties as triggers
• Split functionality into generic / resuable components
• Use Lopper Library routines where possible
• Data driven + command line options for flexibility
• Works for any device that can be passed through
13 |
Implementation
• A pipeline of assists to extract device tree nodes and their dependencies
• extract: Generates a partial / extracted device tree starting from a target node
• extract-xen: Converts generic extracted tree to a Xen understood format
• Imagebuilder: Takes extracted dtbs and generates boot artifacts
extract
board
devicetree
Lopper
extract-xen
imagebuilder
14 |
Implementation: Assists
Usage: extract-xen -t <target node> [OPTION]
-t target node (full path)
-p permissive matching on target node (regex)
-v enable verbose debug/processing
-o output file for extracted device tree
Usage: extract -t <target node> [OPTION]
-t target node (full path)
-i include node if found in extracted node paths
-p permissive matching on target node (regex)
-v enable verbose debug/processing
-x exclude nodes or properties matching regex
-o output file for extracted device tree
Usage: image-builder [--uboot] -o <output dir> --imagebuilder <path to imagebuilder>
wrapper around imagebuilder (https://gitlab.com/xen-project/imagebuilder)
--uboot execute imagebuilder's "uboot-script-gen", with the
options: -t tftp -c ./config, and the supplied output directory
-i path to imagebuilder clone
-v enable verbose debug/processing
-o output directory for files
Demo
16 |
Lopper and Yocto
• Recipe is part of the meta-virtualization layer
• Current use cases:
• Configuration generation from device tree
• Modification of qemu device trees for Xen boot support
• See: qemuboot-xen-dtb.bbclass
• Future:
• Map devices to kernel configuration
• Boot artifacts generation
• …
17 |
Future Work
• Runtime dynamic device tree extraction -> overlay
• Containers
• Partitioning
• Validation and smart comparisions
• Common library / routines:
• Code / driver generation
• Device analysis and export
• Replace scripts / custom tools and solutions
• Generic image configuration and generation wrapper
• Improved schema integration
• Extend Yocto Project integration
Questions?
System Device Tree and Lopper: Concrete Examples - ELC NA 2022

More Related Content

What's hot

Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022
Stefano Stabellini
 
Xen on ARM for embedded and IoT: from secure containers to dom0less systems
Xen on ARM for embedded and IoT: from secure containers to dom0less systemsXen on ARM for embedded and IoT: from secure containers to dom0less systems
Xen on ARM for embedded and IoT: from secure containers to dom0less systems
Stefano Stabellini
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
ShapeBlue
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
艾鍗科技
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
Yi-Hsiu Hsu
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
The Linux Foundation
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
libfetion
 
Anatomy of the loadable kernel module (lkm)
Anatomy of the loadable kernel module (lkm)Anatomy of the loadable kernel module (lkm)
Anatomy of the loadable kernel module (lkm)
Adrian Huang
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
The Linux Foundation
 
Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project Virtualisation
The Linux Foundation
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
Buland Singh
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Adrian Huang
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
Macpaul Lin
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
Brendan Gregg
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
Thomas Petazzoni
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
The Linux Foundation
 
Xen Debugging
Xen DebuggingXen Debugging
Xen Debugging
The Linux Foundation
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
Brendan Gregg
 
Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
Adrien Mahieux
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
Samsung Open Source Group
 

What's hot (20)

Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022Xen in Safety-Critical Systems - Critical Summit 2022
Xen in Safety-Critical Systems - Critical Summit 2022
 
Xen on ARM for embedded and IoT: from secure containers to dom0less systems
Xen on ARM for embedded and IoT: from secure containers to dom0less systemsXen on ARM for embedded and IoT: from secure containers to dom0less systems
Xen on ARM for embedded and IoT: from secure containers to dom0less systems
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Anatomy of the loadable kernel module (lkm)
Anatomy of the loadable kernel module (lkm)Anatomy of the loadable kernel module (lkm)
Anatomy of the loadable kernel module (lkm)
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
 
Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project Virtualisation
 
Kernel_Crash_Dump_Analysis
Kernel_Crash_Dump_AnalysisKernel_Crash_Dump_Analysis
Kernel_Crash_Dump_Analysis
 
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is bootedVmlinux: anatomy of bzimage and how x86 64 processor is booted
Vmlinux: anatomy of bzimage and how x86 64 processor is booted
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
XPDS13: Xen in OSS based In–Vehicle Infotainment Systems - Artem Mygaiev, Glo...
 
Xen Debugging
Xen DebuggingXen Debugging
Xen Debugging
 
LISA2019 Linux Systems Performance
LISA2019 Linux Systems PerformanceLISA2019 Linux Systems Performance
LISA2019 Linux Systems Performance
 
Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
 
Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?Reconnaissance of Virtio: What’s new and how it’s all connected?
Reconnaissance of Virtio: What’s new and how it’s all connected?
 

Similar to System Device Tree and Lopper: Concrete Examples - ELC NA 2022

Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
Susant Sahani
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmf
hik_lhz
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
The Linux Foundation
 
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community) [발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
동현 김
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
abinaya m
 
My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)
Gustavo Rene Antunez
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
Kushal Modi
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloud
Brendan Gregg
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
Kellyn Pot'Vin-Gorman
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
Antony Messerl
 
How to Build a Compute Cluster
How to Build a Compute ClusterHow to Build a Compute Cluster
How to Build a Compute Cluster
Ramsay Key
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetes
Ted Jung
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Puppet
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device Driver
Gary Yeh
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinci
Akash Sahoo
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Jan Kalcic
 
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Continuent
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
Alison Chaiken
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
Neeraj Shrimali
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
敬倫 林
 

Similar to System Device Tree and Lopper: Concrete Examples - ELC NA 2022 (20)

Summit demystifying systemd1
Summit demystifying systemd1Summit demystifying systemd1
Summit demystifying systemd1
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmf
 
Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018Platform Security Summit 18: Xen Security Weather Report 2018
Platform Security Summit 18: Xen Security Weather Report 2018
 
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community) [발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
[발표자료] 오픈소스 Pacemaker 활용한 zabbix 이중화 방안(w/ Zabbix Korea Community)
 
Lec 10-linux-review
Lec 10-linux-reviewLec 10-linux-review
Lec 10-linux-review
 
My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)My First 100 days with an Exadata (PPT)
My First 100 days with an Exadata (PPT)
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Performance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloudPerformance Analysis: new tools and concepts from the cloud
Performance Analysis: new tools and concepts from the cloud
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
 
Stateless Hypervisors at Scale
Stateless Hypervisors at ScaleStateless Hypervisors at Scale
Stateless Hypervisors at Scale
 
How to Build a Compute Cluster
How to Build a Compute ClusterHow to Build a Compute Cluster
How to Build a Compute Cluster
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetes
 
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
Exploring the Final Frontier of Data Center Orchestration: Network Elements -...
 
Linux Char Device Driver
Linux Char Device DriverLinux Char Device Driver
Linux Char Device Driver
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinci
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
 
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
Training Slides: Basics 107: Simple Tungsten Replicator Installation to Extra...
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup. Linux container, namespaces & CGroup.
Linux container, namespaces & CGroup.
 
Week1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC BeginWeek1 Electronic System-level ESL Design and SystemC Begin
Week1 Electronic System-level ESL Design and SystemC Begin
 

More from Stefano Stabellini

Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Stefano Stabellini
 
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen HypervisorSafety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
Stefano Stabellini
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
Stefano Stabellini
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edge
Stefano Stabellini
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and Lopper
Stefano Stabellini
 
Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020
Stefano Stabellini
 
Xen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time SystemXen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time System
Stefano Stabellini
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
Stefano Stabellini
 
Xen Project for ARM Servers
Xen Project for ARM ServersXen Project for ARM Servers
Xen Project for ARM Servers
Stefano Stabellini
 
Xen and OpenStack
Xen and OpenStackXen and OpenStack
Xen and OpenStack
Stefano Stabellini
 
XDS15: Project Raisin
XDS15: Project RaisinXDS15: Project Raisin
XDS15: Project Raisin
Stefano Stabellini
 
OpenStack and Xen
OpenStack and XenOpenStack and Xen
OpenStack and Xen
Stefano Stabellini
 

More from Stefano Stabellini (12)

Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen HypervisorSafety-Certifying Open Source Software: The Case of the Xen Hypervisor
Safety-Certifying Open Source Software: The Case of the Xen Hypervisor
 
RunX ELCE 2020
RunX ELCE 2020RunX ELCE 2020
RunX ELCE 2020
 
RunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edgeRunX: deploy real-time OSes as containers at the edge
RunX: deploy real-time OSes as containers at the edge
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and Lopper
 
Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020Cache coloring Xen Summit 2020
Cache coloring Xen Summit 2020
 
Xen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time SystemXen Cache Coloring: Interference-Free Real-Time System
Xen Cache Coloring: Interference-Free Real-Time System
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
 
Xen Project for ARM Servers
Xen Project for ARM ServersXen Project for ARM Servers
Xen Project for ARM Servers
 
Xen and OpenStack
Xen and OpenStackXen and OpenStack
Xen and OpenStack
 
XDS15: Project Raisin
XDS15: Project RaisinXDS15: Project Raisin
XDS15: Project Raisin
 
OpenStack and Xen
OpenStack and XenOpenStack and Xen
OpenStack and Xen
 

Recently uploaded

J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
ShulagnaSarkar2
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
XfilesPro
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
kalichargn70th171
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
mz5nrf0n
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
NishanthaBulumulla1
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
Massimo Artizzu
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 

Recently uploaded (20)

J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision14 th Edition of International conference on computer vision
14 th Edition of International conference on computer vision
 
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
Everything You Need to Know About X-Sign: The eSign Functionality of XfilesPr...
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
The Key to Digital Success_ A Comprehensive Guide to Continuous Testing Integ...
 
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
在线购买加拿大英属哥伦比亚大学毕业证本科学位证书原版一模一样
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
YAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring detailsYAML crash COURSE how to write yaml file for adding configuring details
YAML crash COURSE how to write yaml file for adding configuring details
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Liberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptxLiberarsi dai framework con i Web Component.pptx
Liberarsi dai framework con i Web Component.pptx
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 

System Device Tree and Lopper: Concrete Examples - ELC NA 2022

  • 1. 1 | Lopper Bruce Ashfield & Stefano Stabellini ELC NA 2022
  • 2. 2 | System Device Tree & Heterogeneous computing • Heterogeneous System with multiple HW components • A72s,R5s,PMC, MicroBlaze clusters • Multiple Execution Domains with its own address map • Each domain with its own operating system • Multiple execution levels (EL) • Multiple Security Environments • E.g.: U-Boot, TF-A, Xen, Linux, OPTEE,Zephyr, baremetal • The system is divided into domains • Each domain is an independentoperating environment with CPUs, memory,and devices allocated to it • System Device Tree: extending DT to describe the full system • Including multiple heterogeneous CPU clusters • Including multiple domains Secure State Trusted Firmware (TF) App App Trusted Execution Environment(TEE) Non-secure State Hypervisor App App Linux App RTOS FPGA MicroBlaze App App RTOS MicroBlaze App Bare Metal A72 Core 0 A72 Core 1 RPU R5 Core 0 App App RTOS R5 Core 1 App Bare Metal Container App EL0 EL1 EL2 EL3 App App Platform ManagementController (PMC) PLM Devices Memory
  • 3. 3 | System Device Tree • Device Tree expresses HW information relevant to an operating environment • Used by U-Boot, Linux, Xen, TF-A and others • System Device Tree is an extension to Device Tree to describe the full system • It describes multiple CPU clusters with different address maps • Both A72s and R5s • It describes multiple domains and the resources allocated to each • A domain could be: • an heterogenous computing unit, e.g. Zephyr on R5s • an operating environment at a specific execution level, e.g. OPTEE • a virtual machine, e.g. a Xen domain
  • 4. 4 | Lopper: an introduction • Lopper • Is a framework for manipulating System Device Trees and transforming information • Original goal / concept was to produce standard devices trees to support existing platforms/OSs • Produces any number of outputs: device trees, generated code, custom, etc • Flexible development / runtime workflow integration • Data driven • A few details: • OpenSource, BSD-3 License • https://github.com/devicetree-org/lopper, https://pypi.org/project/lopper/ • Written in python, using pluggable backends (libfdt,dtlib) for device tree manipulations • Additional logic components in the future • Works with dts, dtb and yaml inputs • Supports unit operations (lops) and more complex python assist modules • Depending on the task, both can be used • Flexible output / input is provided via python assists • Performs validation and consistency checking
  • 5. 5 | Lopper: a framework • Common base for tooling inquiring or manipulating device trees​ • Built-in: • Core tree manipulation, merging • Input and output: dts / dtb / yaml • Parsing: libfdt or dtlib • Assist / lop management • Device tree sanity and consistency checking • Tree manipulation library / routines
  • 6. 6 | Lopper: a framework • Optional / plugin: • Assists provide Logic / semantics / context awareness • Front ends • domains / protection, yaml expansion • Backends / Assists • System Device tree pruning • RTOS/Bare Metal backend creates #defines into #include files (early availability) • OpenAMP plugin that generates device specific DT for shared pages/IRQs • Security / partitioning backend for subsystem and firewall information (TBD) • Default Domain specification plugin creates a YAML file that can later be edited (under development) • Verification assist that compares DTs from different domains to make sure they are compatible (TBD) • Sub device tree / overlay extraction • Detailed tree analysis / modification • Source validation and expansion • ReST API: an HTTP server to support GUIs and other tooling
  • 7. 7 | Lopper: components Lopper Core YAML dts other YAML dts dtb other ruamel or pyyaml libfdt or dtlib Lopper Lopper: Tree, Fdt/Dt,Sdt .. importer yaml / xlate Device / domain lops exporter ruamel or pyyaml libfdt or dtlib custom custom lops inputs outputs Front ends Back ends assists Linux RTOS Bare Metal devicetree.org • bindings • schemas • …. • Systemdevicetree • Boarddts • overlays • ‘Standard’device tree • C-devicedrivers • Configuration • …. dtc cpp
  • 8. 8 | Xen Partial Device Trees • Similar to device tree overlays but older • Everything under the top-level passthrough node is copied to the guest device tree • Xen reads partial device trees today to: • configure guest device assignment • describe passthrough hardware to the guest • Starting from a copy of the host device tree node and editing it • Removing unwanted properties • Adding Xen specific properties passthrough { compatible = "simple-bus"; ranges; #address-cells = <0x2>; #size-cells = <0x2>; timer@ff110000 { compatible = "cdns,ttc"; status = "okay"; interrupt-parent = <0xfde8>; interrupts = <0x0 0x24 0x4 0x0 0x25 0x4 0x0 0x26 0x4>; reg = <0x0 0xff110000 0x0 0x1000>; timer-width = <0x20>; xen,force-assign-without-iommu = <1>; xen,reg = <0x0 0xff110000 0x0 0x1000 0x0 0xff110000>; xen,path = "/axi/timer@ff110000"; }; };
  • 9. 9 | Xen Partial Device Trees • Xen specific properties and quirks: • xen,reg to specify memory mappings • xen,path points to the corresponding host device tree node (used for IOMMU configurations) • xen,force-assign-without-iommu when IOMMU configuration is not necessary • interrupt-parents = <0xfde8> to point to the virtual interrupt controller of the guest • no iommus, because the IOMMU is used by Xen and not exposed to the guest • xen,passthrough; in the corresponding host device tree node to mark it for assignment timer@ff110000 { compatible = "cdns,ttc"; status = "okay"; interrupt-parent = <0xfde8>; interrupts = <0x0 0x24 0x4 0x0 0x25 0x4 0x0 0x26 0x4>; reg = <0x0 0xff110000 0x0 0x1000>; timer-width = <0x20>; xen,force-assign-without-iommu = <1>; xen,reg = <0x0 0xff110000 0x0 0x1000 0x0 0xff110000>; xen,path = "/axi/timer@ff110000"; };
  • 10. 10 | Xen Partial Device Trees: the problems • Xen specific changes are not simple, but they could be automated more easily • Xen properties aside, how to generate the partial device tree? • Which properties to remove compared to the host device tree node? • How to solve clock dependencies? Do we need to include the clock controller too? • What about power domains and reset lines? • Generic problem: affects device assignment on any hypervisor and heterogeneous domains too
  • 11. 11 | Xen Partial Device Trees: a more complex example zynqmp-firmware { compatible = "xlnx,zynqmp-firmware", "xlnx,zynqmp"; method = "smc"; #power-domain-cells = <0x1>; phandle = <0x1>; clock-controller { u-boot,dm-pre-reloc; #clock-cells = <0x1>; compatible = "xlnx,zynqmp-clk"; clocks = <0x6 0x7 0x8 0x9 0xa>; clock-names = "pss_ref_clk", "video_clk", "pss_alt_ref_clk", "aux_ref_clk", "gt_crx_ref_clk"; phandle = <0x3>; }; }; pss_ref_clk { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <0x1fc9350>; phandle = <0x6>; }; video_clk { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <0x1fc9f08>; phandle = <0x7>; }; pss_alt_ref_clk { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <0x0>; phandle = <0x8>; }; […] mmc@ff170000 { compatible = "xlnx,zynqmp-8.9a", "arasan,sdhci-8.9a"; status = "okay"; interrupt-parent = <0xfde8>; interrupts = <0x0 0x31 0x4>; reg = <0x0 0xff170000 0x0 0x1000>; xlnx,device_id = <0x1>; clock-names = "clk_xin", "clk_ahb"; #clock-cells = <0x1>; clock-output-names = "clk_out_sd1", "clk_in_sd1"; clocks = <0x3 0x37 0x3 0x1f>; phandle = <0x37>; xen,reg = <0x0 0xff170000 0x0 0x1000 0x0 0xff170000>; xen,path = "/axi/mmc@ff170000"; };
  • 12. 12 | The Solution with Lopper • Leverage core Lopper functionality + assists • Read the device tree -> LopperTree • Analyze the devices • Manipulate the tree • Output dts/dtbs for passthrough devices • Trigger image generation (optional) • Requirements: • No hardcoded Xen knowledge • Inputs + devicetree properties as triggers • Split functionality into generic / resuable components • Use Lopper Library routines where possible • Data driven + command line options for flexibility • Works for any device that can be passed through
  • 13. 13 | Implementation • A pipeline of assists to extract device tree nodes and their dependencies • extract: Generates a partial / extracted device tree starting from a target node • extract-xen: Converts generic extracted tree to a Xen understood format • Imagebuilder: Takes extracted dtbs and generates boot artifacts extract board devicetree Lopper extract-xen imagebuilder
  • 14. 14 | Implementation: Assists Usage: extract-xen -t <target node> [OPTION] -t target node (full path) -p permissive matching on target node (regex) -v enable verbose debug/processing -o output file for extracted device tree Usage: extract -t <target node> [OPTION] -t target node (full path) -i include node if found in extracted node paths -p permissive matching on target node (regex) -v enable verbose debug/processing -x exclude nodes or properties matching regex -o output file for extracted device tree Usage: image-builder [--uboot] -o <output dir> --imagebuilder <path to imagebuilder> wrapper around imagebuilder (https://gitlab.com/xen-project/imagebuilder) --uboot execute imagebuilder's "uboot-script-gen", with the options: -t tftp -c ./config, and the supplied output directory -i path to imagebuilder clone -v enable verbose debug/processing -o output directory for files
  • 15. Demo
  • 16. 16 | Lopper and Yocto • Recipe is part of the meta-virtualization layer • Current use cases: • Configuration generation from device tree • Modification of qemu device trees for Xen boot support • See: qemuboot-xen-dtb.bbclass • Future: • Map devices to kernel configuration • Boot artifacts generation • …
  • 17. 17 | Future Work • Runtime dynamic device tree extraction -> overlay • Containers • Partitioning • Validation and smart comparisions • Common library / routines: • Code / driver generation • Device analysis and export • Replace scripts / custom tools and solutions • Generic image configuration and generation wrapper • Improved schema integration • Extend Yocto Project integration