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 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
 
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
 
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
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
GlobalLogic Ukraine
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
Emertxe Information Technologies Pvt Ltd
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
Amr Ali (ISTQB CTAL Full, CSM, ITIL Foundation)
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
The Linux Foundation
 
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
Adrian Huang
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
SUSE Labs Taipei
 
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
 
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
The Linux Foundation
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
Tushar B Kute
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
shimosawa
 
Linux PV on HVM
Linux PV on HVMLinux PV on HVM
Linux PV on HVM
The Linux Foundation
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
QUONTRASOLUTIONS
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
Houcheng Lin
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
艾鍗科技
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
Chris Simmonds
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
Ni Zo-Ma
 

What's hot (20)

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
 
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
 
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)
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
 
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
qemu + gdb + sample_code: Run sample code in QEMU OS and observe Linux Kernel...
 
Hands-on ethernet driver
Hands-on ethernet driverHands-on ethernet driver
Hands-on ethernet driver
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
XPDDS18: Design and Implementation of Automotive: Virtualization Based on Xen...
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux PV on HVM
Linux PV on HVMLinux PV on HVM
Linux PV on HVM
 
Introduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra SolutionsIntroduction to Linux Kernel by Quontra Solutions
Introduction to Linux Kernel by Quontra Solutions
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 

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
 
Dom0less - Xen Developer Summit 2019
Dom0less  - Xen Developer Summit 2019Dom0less  - Xen Developer Summit 2019
Dom0less - Xen Developer Summit 2019
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
 
Dom0less - Xen Developer Summit 2019
Dom0less  - Xen Developer Summit 2019Dom0less  - Xen Developer Summit 2019
Dom0less - Xen Developer Summit 2019
 
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

Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
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
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
dakas1
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
Quickdice ERP
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
Karya Keeper
 
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
 
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
 
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
 
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
 
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
 
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
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
GohKiangHock
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
YousufSait3
 
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
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
AnkitaPandya11
 
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
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
TaghreedAltamimi
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 

Recently uploaded (20)

Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
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
 
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
一比一原版(UMN毕业证)明尼苏达大学毕业证如何办理
 
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian CompaniesE-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
E-Invoicing Implementation: A Step-by-Step Guide for Saudi Arabian Companies
 
Project Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdfProject Management: The Role of Project Dashboards.pdf
Project Management: The Role of Project Dashboards.pdf
 
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
 
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
 
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
 
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?
 
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)
 
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
 
SQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure MalaysiaSQL Accounting Software Brochure Malaysia
SQL Accounting Software Brochure Malaysia
 
zOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL DifferenceszOS Mainframe JES2-JES3 JCL-JECL Differences
zOS Mainframe JES2-JES3 JCL-JECL Differences
 
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 ...
 
fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.fiscal year variant fiscal year variant.
fiscal year variant fiscal year variant.
 
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
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Lecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptxLecture 2 - software testing SE 412.pptx
Lecture 2 - software testing SE 412.pptx
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 

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