SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Device Tree
Rouyun Pan
緣起
• 某年某⽉月的某⼀一天... 

神⼈人Linus Torvalds寫了⼀一封信
有⼀一堆闌尾在⽴立法院, 可割可棄!!!
So, 割闌尾~
• 科科跟宅宅們參考了PowerPC等其他體系架構下
已經使⽤用的Flattened Device Tree(FDT).起源於
OpenFirmware IEEE 1275 device-tree notion.
• ⽇日後決定採⽤用Device Tree為描述硬體平台的資料
結構.
Device Tree
• 由⼀一系列被命名的結點(Node)和屬性
(Property)來組成. Node可包含Sub-Node.
Property是成對的name和value. 可讀性⾼高.
• 可以在開機的時候, 在透過它將訊息傳遞給作業系
統,⽽而不需要在把這些資訊放在程式碼中.
• 未來也很⽅方便增減修改Device Tree, 容易⽀支援不同
的Soc或硬體週邊.
Z > B!!!
How to work with device tree
complier
Device tree
description
binary data
bootloader kernel
platform
probe
carry
HW configuration
pass
DTS
DTC
DTB
Device tree misc.
• DTS

- device tree source file
• DTC

- device tree compiler, It compiles DTS to DTB.
• DTB

- device tree blob, the binary data to store the
information of DTS.
DTS Format(1)
/{!
! properties = ”value as string” | <value as u32 list> | [ value as byte stream ] |
<&node name>!
! child_node[@address] {!
! ! child_properties!
! }!
}!
!
&node_name {!
! compatible = "<manufacturer>,<model>"!
! properties!
}!
“/“ 表⽰示根節點, 不需要寫節點名稱
屬性Properties可以⽤用混合格式表⽰示,
如“字串”,或<32位元整數列表>,或[位元組流]或

<&其他參考節點名稱>
每個 Node 都會有⼀一個’compatible’ property. 格式為
"<manufacturer>,<model>",第⼀一個字串表⽰示確切名
稱,第⼆二個字串表⽰示可兼容的其他設備。
DTS Format(2)
/{!
! properties = ”value as string” | <value as u32 list> | [ value as byte stream ] |
<&node name>!
! child_node[@address] {!
! ! child_properties!
! }!
}!
!
&node_name {!
! compatible = "<manufacturer>,<model>"!
! properties!
}!
結點的命名,遵循的格式為:
<name>[@address]

name是⼀一個ASCII字串,⽤用於描述結點對應的
裝置類型. 如果⼀一個結點描述的裝置有記憶體地
址,則填⼊入@address。多個相同類型設備結點
的name可以⼀一樣,只要address不同即可
DTS format(3)
/ {
compatible = "acme,coyotes-revenge";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&intc>;
cpus {
#address-cells = <1>;
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
compatible = "arm,cortex-a9";
reg = <1>;
};
};
serial@1010adbd {
compatible = "arm,pl011";
reg = <0x101abcd 0x1000>;
reg_name = “”
};
節點1
節點2!
⼦子節點1!
⼦子節點2!
根節點
DTS format(4)/ {
compatible = "acme,coyotes-revenge";
#address-cells = <1>; !
#size-cells = <1>;
interrupt-parent = <&intc>;
cpus {
#address-cells = <1>; !
#size-cells = <0>;
cpu@0 {
compatible = "arm,cortex-a9";
reg = <0>;
};
cpu@1 {
compatible = "arm,cortex-a9";
reg = <1>;
};
};
serial@1010adbd {
compatible = "arm,pl011";
reg = <0x101abcd 0x1000>;!
! reg_name = “”!
};
有位址的裝置會使⽤用
#address-cells 和 #size-cells 來決定⼦子結點
的’reg’屬性的格式怎麼填
reg = <address1 length1 [address2 length2] ... >
#size-cells = <0>; 表⽰示只填⼊入Reg的starting address
#address-cells = <1>; !
#size-cells = <1>; !
填⼊入格式為 Reg = <Starting_address Size>
.dts & dtsi
• .dts 是採⽤用ASCII 格式的Device Tree描述檔⽂文件.
⼀一般放置位在 kernel/arch/arm/boot/dts/。
• ⼀一個SoC可能拿來開發多個產品線,為了⽅方便,
把SoC公⽤用的硬體設定或不同產品的共同部分提
煉為.dtsi,類似C語⾔言的.h。其他不同產品的.dts
可以引⽤用這些共通的.dtsi。
Modularization
msm1234-abc.dts
msm1234-abc.dtsi
panel-abc.dtsi msm1234.dtsi
msm1234-gpu.dtsi
msm1234-
iommu.dtsi
msm1234-
mdss.dtsi
for example - Driver probe
@mdss_mdp.cpp
static const struct of_device_id mdss_mdp_dt_match[] =
.compatible = "qcom,mdss_mdp"
MODULE_DEVICE_TABLE (of, mdss_mdp_dt_match);
!
static struct platform_driver mdss_mdp_driver = {
.probe = mdss_mdp_probe,
.driver = {
.name = "mdp",
.of_match_table = mdss_mdp_dt_match,
}
}
!
static int __init mdss_mdp_driver_init (void) {
platform_driver_register( &mdss_mdp_driver );
}
@msm1234-mdss.dtsi
&soc {
!
mdss_mdp: qcom,mdss_mdp@12340000 {
compatible = "qcom,mdss_mdp";
reg = <0x12340000 0xff00>
reg-names = "mdp_phys", "vbif_phys";
…
!
mdss_dsi0: qcom,mdss_dsi@12345000 {
compatible = "qcom,mdss-dsi-ctrl";
qcom,mdss-mdp = <&mdss_mdp>;
…
!
qcom,mdss_wb_panel {
compatible = "qcom,mdss_wb";
…
…
Parsing APIs of Device Tree
property * of_find_property();
device_node * of_find_node_by_name();
of_find_node_by_type();

of_find_compatible_node();

of_find_matching_node_and_match();

of_find_node_by_path(); 

of_find_node_by_phandle();
void * of_get_property();
int of_property_read_u32_index() 

of_property_read_u8_array();

of_property_read_u16_array(); 

of_property_read_u32_array();

of_property_read_string();

of_property_read_string_index();
int of_parse_phandle_with_args(),
of_parse_phandle_with_fixed_args(),
of_count_phandle_with_args()
Reference
• http://www.devicetree.org/Main_Page
• http://www.devicetree.org/Device_Tree_Usage
• Device Tree Support on ARM Linux

Chih-Min Chao) http://gplus.to/cmchao COSCUP
2011 in Taiwan
• http://blog.csdn.net/21cnbao/article/details/
8457546

Weitere ähnliche Inhalte

Was ist angesagt?

Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugginglibfetion
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
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 bootedAdrian Huang
 
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 NLKBshimosawa
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File SystemAdrian Huang
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!Mr. Vengineer
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisPaul V. Novarese
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDBLinaro
 

Was ist angesagt? (20)

Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
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
 
Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
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 Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
Audio Drivers
Audio DriversAudio Drivers
Audio Drivers
 
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 - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!ARM Trusted FirmwareのBL31を単体で使う!
ARM Trusted FirmwareのBL31を単体で使う!
 
Linux Crash Dump Capture and Analysis
Linux Crash Dump Capture and AnalysisLinux Crash Dump Capture and Analysis
Linux Crash Dump Capture and Analysis
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
U-Boot - An universal bootloader
U-Boot - An universal bootloader U-Boot - An universal bootloader
U-Boot - An universal bootloader
 
Embedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile DevicesEmbedded Virtualization applied in Mobile Devices
Embedded Virtualization applied in Mobile Devices
 
Q2.12: Debugging with GDB
Q2.12: Debugging with GDBQ2.12: Debugging with GDB
Q2.12: Debugging with GDB
 

Ähnlich wie Device tree

Kernel Recipes 2015: Representing device-tree peripherals in ACPI
Kernel Recipes 2015: Representing device-tree peripherals in ACPIKernel Recipes 2015: Representing device-tree peripherals in ACPI
Kernel Recipes 2015: Representing device-tree peripherals in ACPIAnne Nicolas
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLinaro
 
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022Stefano Stabellini
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linuxChih-Min Chao
 
Nick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with noseNick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with noseGeekPwn Keen
 
HPCC Systems vs Hadoop
HPCC Systems vs HadoopHPCC Systems vs Hadoop
HPCC Systems vs HadoopFujio Turner
 
Cassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User GroupCassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User GroupAdam Hutson
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - SummaryNugroho Gito
 
Cassandra for Sysadmins
Cassandra for SysadminsCassandra for Sysadmins
Cassandra for SysadminsNathan Milford
 
Script of Scripts Polyglot Notebook and Workflow System
Script of ScriptsPolyglot Notebook and Workflow SystemScript of ScriptsPolyglot Notebook and Workflow System
Script of Scripts Polyglot Notebook and Workflow SystemBo Peng
 
High Availability in 37 Easy Steps
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy StepsTim Serong
 
Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached Fuad Arshad
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaPrajal Kulkarni
 
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 LopperStefano Stabellini
 
Linux Conference Australia 2018 : Device Tree, past, present, future
Linux Conference Australia 2018 : Device Tree, past, present, futureLinux Conference Australia 2018 : Device Tree, past, present, future
Linux Conference Australia 2018 : Device Tree, past, present, futureNeil Armstrong
 
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...Kim Berg Hansen
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commandstmavroidis
 
2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red Hat2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red HatShawn Wells
 

Ähnlich wie Device tree (20)

Kernel Recipes 2015: Representing device-tree peripherals in ACPI
Kernel Recipes 2015: Representing device-tree peripherals in ACPIKernel Recipes 2015: Representing device-tree peripherals in ACPI
Kernel Recipes 2015: Representing device-tree peripherals in ACPI
 
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device ConfigurationLAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
LAS16-300: Mini Conference 2 Cortex-M Software - Device Configuration
 
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022System Device Tree and Lopper: Concrete Examples - ELC NA 2022
System Device Tree and Lopper: Concrete Examples - ELC NA 2022
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Nick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with noseNick Stephens-how does someone unlock your phone with nose
Nick Stephens-how does someone unlock your phone with nose
 
HPCC Systems vs Hadoop
HPCC Systems vs HadoopHPCC Systems vs Hadoop
HPCC Systems vs Hadoop
 
Cassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User GroupCassandra & Python - Springfield MO User Group
Cassandra & Python - Springfield MO User Group
 
Ui disk & terminal drivers
Ui disk & terminal driversUi disk & terminal drivers
Ui disk & terminal drivers
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - Summary
 
Cassandra for Sysadmins
Cassandra for SysadminsCassandra for Sysadmins
Cassandra for Sysadmins
 
Script of Scripts Polyglot Notebook and Workflow System
Script of ScriptsPolyglot Notebook and Workflow SystemScript of ScriptsPolyglot Notebook and Workflow System
Script of Scripts Polyglot Notebook and Workflow System
 
High Availability in 37 Easy Steps
High Availability in 37 Easy StepsHigh Availability in 37 Easy Steps
High Availability in 37 Easy Steps
 
Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached Oracle Database Appliance - RAC in a box Some strings attached
Oracle Database Appliance - RAC in a box Some strings attached
 
Attack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and KibanaAttack monitoring using ElasticSearch Logstash and Kibana
Attack monitoring using ElasticSearch Logstash and Kibana
 
1 network intro
1 network intro1 network intro
1 network intro
 
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
 
Linux Conference Australia 2018 : Device Tree, past, present, future
Linux Conference Australia 2018 : Device Tree, past, present, futureLinux Conference Australia 2018 : Device Tree, past, present, future
Linux Conference Australia 2018 : Device Tree, past, present, future
 
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
When 7 bit-ascii ain't enough - about NLS, collation, charsets, unicode and s...
 
Linux Networking Commands
Linux Networking CommandsLinux Networking Commands
Linux Networking Commands
 
2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red Hat2012-03-15 What's New at Red Hat
2012-03-15 What's New at Red Hat
 

Mehr von Rouyun Pan

有點硬又不會太硬的DNN加速器
有點硬又不會太硬的DNN加速器有點硬又不會太硬的DNN加速器
有點硬又不會太硬的DNN加速器Rouyun Pan
 
深度學習工作流程
深度學習工作流程深度學習工作流程
深度學習工作流程Rouyun Pan
 
Tensorflow lite for microcontroller
Tensorflow lite for microcontrollerTensorflow lite for microcontroller
Tensorflow lite for microcontrollerRouyun Pan
 
Google edge tpu
Google edge tpuGoogle edge tpu
Google edge tpuRouyun Pan
 
用Adobe Camera raw 進行膚色校正
用Adobe Camera raw 進行膚色校正用Adobe Camera raw 進行膚色校正
用Adobe Camera raw 進行膚色校正Rouyun Pan
 
給攝影師的古典藝術構圖
給攝影師的古典藝術構圖給攝影師的古典藝術構圖
給攝影師的古典藝術構圖Rouyun Pan
 
照片直方圖解析
照片直方圖解析照片直方圖解析
照片直方圖解析Rouyun Pan
 
Deep Learning Hardware: Past, Present, & Future
Deep Learning Hardware: Past, Present, & FutureDeep Learning Hardware: Past, Present, & Future
Deep Learning Hardware: Past, Present, & FutureRouyun Pan
 
「轉貼」移動互聯網行業盤點
「轉貼」移動互聯網行業盤點「轉貼」移動互聯網行業盤點
「轉貼」移動互聯網行業盤點Rouyun Pan
 
The overview of VR solutions
The overview of VR solutionsThe overview of VR solutions
The overview of VR solutionsRouyun Pan
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwuiRouyun Pan
 
[轉貼] 社群大數據 - 輿情觀測及分析應用
[轉貼] 社群大數據 - 輿情觀測及分析應用[轉貼] 社群大數據 - 輿情觀測及分析應用
[轉貼] 社群大數據 - 輿情觀測及分析應用Rouyun Pan
 
WebRTC overview
WebRTC overviewWebRTC overview
WebRTC overviewRouyun Pan
 
Android 待機與操作耗電檢查
Android 待機與操作耗電檢查Android 待機與操作耗電檢查
Android 待機與操作耗電檢查Rouyun Pan
 
Analyzing Display and Performance with Systrace
Analyzing Display and Performance with SystraceAnalyzing Display and Performance with Systrace
Analyzing Display and Performance with SystraceRouyun Pan
 

Mehr von Rouyun Pan (20)

調色筆記
調色筆記調色筆記
調色筆記
 
有點硬又不會太硬的DNN加速器
有點硬又不會太硬的DNN加速器有點硬又不會太硬的DNN加速器
有點硬又不會太硬的DNN加速器
 
深度學習工作流程
深度學習工作流程深度學習工作流程
深度學習工作流程
 
Tensorflow lite for microcontroller
Tensorflow lite for microcontrollerTensorflow lite for microcontroller
Tensorflow lite for microcontroller
 
Google edge tpu
Google edge tpuGoogle edge tpu
Google edge tpu
 
用Adobe Camera raw 進行膚色校正
用Adobe Camera raw 進行膚色校正用Adobe Camera raw 進行膚色校正
用Adobe Camera raw 進行膚色校正
 
給攝影師的古典藝術構圖
給攝影師的古典藝術構圖給攝影師的古典藝術構圖
給攝影師的古典藝術構圖
 
照片直方圖解析
照片直方圖解析照片直方圖解析
照片直方圖解析
 
Deep Learning Hardware: Past, Present, & Future
Deep Learning Hardware: Past, Present, & FutureDeep Learning Hardware: Past, Present, & Future
Deep Learning Hardware: Past, Present, & Future
 
Deep learning
Deep learningDeep learning
Deep learning
 
VR解密
VR解密VR解密
VR解密
 
「轉貼」移動互聯網行業盤點
「轉貼」移動互聯網行業盤點「轉貼」移動互聯網行業盤點
「轉貼」移動互聯網行業盤點
 
The overview of VR solutions
The overview of VR solutionsThe overview of VR solutions
The overview of VR solutions
 
Render thead of hwui
Render thead of hwuiRender thead of hwui
Render thead of hwui
 
Project Tango
Project TangoProject Tango
Project Tango
 
[轉貼] 社群大數據 - 輿情觀測及分析應用
[轉貼] 社群大數據 - 輿情觀測及分析應用[轉貼] 社群大數據 - 輿情觀測及分析應用
[轉貼] 社群大數據 - 輿情觀測及分析應用
 
財報分析1
財報分析1財報分析1
財報分析1
 
WebRTC overview
WebRTC overviewWebRTC overview
WebRTC overview
 
Android 待機與操作耗電檢查
Android 待機與操作耗電檢查Android 待機與操作耗電檢查
Android 待機與操作耗電檢查
 
Analyzing Display and Performance with Systrace
Analyzing Display and Performance with SystraceAnalyzing Display and Performance with Systrace
Analyzing Display and Performance with Systrace
 

Kürzlich hochgeladen

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 

Kürzlich hochgeladen (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Device tree

  • 2. 緣起 • 某年某⽉月的某⼀一天... 
 神⼈人Linus Torvalds寫了⼀一封信 有⼀一堆闌尾在⽴立法院, 可割可棄!!!
  • 3. So, 割闌尾~ • 科科跟宅宅們參考了PowerPC等其他體系架構下 已經使⽤用的Flattened Device Tree(FDT).起源於 OpenFirmware IEEE 1275 device-tree notion. • ⽇日後決定採⽤用Device Tree為描述硬體平台的資料 結構.
  • 4. Device Tree • 由⼀一系列被命名的結點(Node)和屬性 (Property)來組成. Node可包含Sub-Node. Property是成對的name和value. 可讀性⾼高. • 可以在開機的時候, 在透過它將訊息傳遞給作業系 統,⽽而不需要在把這些資訊放在程式碼中. • 未來也很⽅方便增減修改Device Tree, 容易⽀支援不同 的Soc或硬體週邊. Z > B!!!
  • 5. How to work with device tree complier Device tree description binary data bootloader kernel platform probe carry HW configuration pass DTS DTC DTB
  • 6. Device tree misc. • DTS
 - device tree source file • DTC
 - device tree compiler, It compiles DTS to DTB. • DTB
 - device tree blob, the binary data to store the information of DTS.
  • 7. DTS Format(1) /{! ! properties = ”value as string” | <value as u32 list> | [ value as byte stream ] | <&node name>! ! child_node[@address] {! ! ! child_properties! ! }! }! ! &node_name {! ! compatible = "<manufacturer>,<model>"! ! properties! }! “/“ 表⽰示根節點, 不需要寫節點名稱 屬性Properties可以⽤用混合格式表⽰示, 如“字串”,或<32位元整數列表>,或[位元組流]或
 <&其他參考節點名稱> 每個 Node 都會有⼀一個’compatible’ property. 格式為 "<manufacturer>,<model>",第⼀一個字串表⽰示確切名 稱,第⼆二個字串表⽰示可兼容的其他設備。
  • 8. DTS Format(2) /{! ! properties = ”value as string” | <value as u32 list> | [ value as byte stream ] | <&node name>! ! child_node[@address] {! ! ! child_properties! ! }! }! ! &node_name {! ! compatible = "<manufacturer>,<model>"! ! properties! }! 結點的命名,遵循的格式為: <name>[@address]
 name是⼀一個ASCII字串,⽤用於描述結點對應的 裝置類型. 如果⼀一個結點描述的裝置有記憶體地 址,則填⼊入@address。多個相同類型設備結點 的name可以⼀一樣,只要address不同即可
  • 9. DTS format(3) / { compatible = "acme,coyotes-revenge"; #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&intc>; cpus { #address-cells = <1>; #size-cells = <0>; cpu@0 { compatible = "arm,cortex-a9"; reg = <0>; }; cpu@1 { compatible = "arm,cortex-a9"; reg = <1>; }; }; serial@1010adbd { compatible = "arm,pl011"; reg = <0x101abcd 0x1000>; reg_name = “” }; 節點1 節點2! ⼦子節點1! ⼦子節點2! 根節點
  • 10. DTS format(4)/ { compatible = "acme,coyotes-revenge"; #address-cells = <1>; ! #size-cells = <1>; interrupt-parent = <&intc>; cpus { #address-cells = <1>; ! #size-cells = <0>; cpu@0 { compatible = "arm,cortex-a9"; reg = <0>; }; cpu@1 { compatible = "arm,cortex-a9"; reg = <1>; }; }; serial@1010adbd { compatible = "arm,pl011"; reg = <0x101abcd 0x1000>;! ! reg_name = “”! }; 有位址的裝置會使⽤用 #address-cells 和 #size-cells 來決定⼦子結點 的’reg’屬性的格式怎麼填 reg = <address1 length1 [address2 length2] ... > #size-cells = <0>; 表⽰示只填⼊入Reg的starting address #address-cells = <1>; ! #size-cells = <1>; ! 填⼊入格式為 Reg = <Starting_address Size>
  • 11. .dts & dtsi • .dts 是採⽤用ASCII 格式的Device Tree描述檔⽂文件. ⼀一般放置位在 kernel/arch/arm/boot/dts/。 • ⼀一個SoC可能拿來開發多個產品線,為了⽅方便, 把SoC公⽤用的硬體設定或不同產品的共同部分提 煉為.dtsi,類似C語⾔言的.h。其他不同產品的.dts 可以引⽤用這些共通的.dtsi。
  • 13. for example - Driver probe @mdss_mdp.cpp static const struct of_device_id mdss_mdp_dt_match[] = .compatible = "qcom,mdss_mdp" MODULE_DEVICE_TABLE (of, mdss_mdp_dt_match); ! static struct platform_driver mdss_mdp_driver = { .probe = mdss_mdp_probe, .driver = { .name = "mdp", .of_match_table = mdss_mdp_dt_match, } } ! static int __init mdss_mdp_driver_init (void) { platform_driver_register( &mdss_mdp_driver ); } @msm1234-mdss.dtsi &soc { ! mdss_mdp: qcom,mdss_mdp@12340000 { compatible = "qcom,mdss_mdp"; reg = <0x12340000 0xff00> reg-names = "mdp_phys", "vbif_phys"; … ! mdss_dsi0: qcom,mdss_dsi@12345000 { compatible = "qcom,mdss-dsi-ctrl"; qcom,mdss-mdp = <&mdss_mdp>; … ! qcom,mdss_wb_panel { compatible = "qcom,mdss_wb"; … …
  • 14. Parsing APIs of Device Tree property * of_find_property(); device_node * of_find_node_by_name(); of_find_node_by_type();
 of_find_compatible_node();
 of_find_matching_node_and_match();
 of_find_node_by_path(); 
 of_find_node_by_phandle(); void * of_get_property(); int of_property_read_u32_index() 
 of_property_read_u8_array();
 of_property_read_u16_array(); 
 of_property_read_u32_array();
 of_property_read_string();
 of_property_read_string_index(); int of_parse_phandle_with_args(), of_parse_phandle_with_fixed_args(), of_count_phandle_with_args()
  • 15. Reference • http://www.devicetree.org/Main_Page • http://www.devicetree.org/Device_Tree_Usage • Device Tree Support on ARM Linux
 Chih-Min Chao) http://gplus.to/cmchao COSCUP 2011 in Taiwan • http://blog.csdn.net/21cnbao/article/details/ 8457546