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 Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)shimosawa
 
The e820 trap of Linux kernel hibernation
The e820 trap of Linux kernel hibernationThe e820 trap of Linux kernel hibernation
The e820 trap of Linux kernel hibernationjoeylikernel
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtAnne Nicolas
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentialsHaitham Raik
 
Receive side scaling (RSS) with eBPF in QEMU and virtio-net
Receive side scaling (RSS) with eBPF in QEMU and virtio-netReceive side scaling (RSS) with eBPF in QEMU and virtio-net
Receive side scaling (RSS) with eBPF in QEMU and virtio-netYan Vugenfirer
 
Decompressed vmlinux: linux kernel initialization from page table configurati...
Decompressed vmlinux: linux kernel initialization from page table configurati...Decompressed vmlinux: linux kernel initialization from page table configurati...
Decompressed vmlinux: linux kernel initialization from page table configurati...Adrian Huang
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver艾鍗科技
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsoViller Hsiao
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machineAlexei Starovoitov
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
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
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMSherif Mousa
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image艾鍗科技
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals哲豪 康哲豪
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
ACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelSUSE Labs Taipei
 
semaphore & mutex.pdf
semaphore & mutex.pdfsemaphore & mutex.pdf
semaphore & mutex.pdfAdrian Huang
 

Was ist angesagt? (20)

Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
The e820 trap of Linux kernel hibernation
The e820 trap of Linux kernel hibernationThe e820 trap of Linux kernel hibernation
The e820 trap of Linux kernel hibernation
 
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven RostedtKernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
Kernel Recipes 2017 - Understanding the Linux kernel via ftrace - Steven Rostedt
 
Red hat linux essentials
Red hat linux essentialsRed hat linux essentials
Red hat linux essentials
 
Receive side scaling (RSS) with eBPF in QEMU and virtio-net
Receive side scaling (RSS) with eBPF in QEMU and virtio-netReceive side scaling (RSS) with eBPF in QEMU and virtio-net
Receive side scaling (RSS) with eBPF in QEMU and virtio-net
 
Decompressed vmlinux: linux kernel initialization from page table configurati...
Decompressed vmlinux: linux kernel initialization from page table configurati...Decompressed vmlinux: linux kernel initialization from page table configurati...
Decompressed vmlinux: linux kernel initialization from page table configurati...
 
用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver用Raspberry Pi 學Linux I2C Driver
用Raspberry Pi 學Linux I2C Driver
 
twlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdsotwlkh-linux-vsyscall-and-vdso
twlkh-linux-vsyscall-and-vdso
 
BPF - in-kernel virtual machine
BPF - in-kernel virtual machineBPF - in-kernel virtual machine
BPF - in-kernel virtual machine
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
Linux Preempt-RT Internals
Linux Preempt-RT InternalsLinux Preempt-RT Internals
Linux Preempt-RT Internals
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
ACPI Debugging from Linux Kernel
ACPI Debugging from Linux KernelACPI Debugging from Linux Kernel
ACPI Debugging from Linux Kernel
 
semaphore & mutex.pdf
semaphore & mutex.pdfsemaphore & mutex.pdf
semaphore & mutex.pdf
 

Ä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
 
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
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driverVandana Salve
 

Ä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
 
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
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 

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

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
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
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
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
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
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.
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
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
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Kürzlich hochgeladen (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
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...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
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
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
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
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
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 ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
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
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
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
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

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