SlideShare a Scribd company logo
1 of 35
Device Tree Overlay
Implementation
on AOSP 9.0
WIG CHENG IN COSCUP 2020
2020/8/1
Me
Name: Wig
Work: Technexion
#> Embedded Linux
#> Industrial Android BSP
#> Robotic OS
Github: @wigcheng
Contents
• Introduce Device Tree Overlay
• AOSP 9.0 new feature: DTBO
• Implement DTBO on AOSP 9.0
•Big issue
•Make a DTBO image including DTB and DTBO
•U-boot Tweaking
• Future work
• Android 10 and 11
• Conclusion
Introduce Device Tree Overlay
Why Device Tree Overlay?
NFC HAT
VOICE HAT
RS485 HAT
CAN BUS HAT
LED HAT
a.dtb
DTB: Device Tree BlobDTS: Device Tree Source DTBO: Device Tree Blob for Overlay
a-nfc.dtbTraditional Solution
a-voicehat.dtb
a-rs485.dtb
a-can.dtb
a-led.dtb
Multiple inch LCD
a-5inch-lcd.dtb
a-10inch-lcd.dtb
...
a-60inch-lcd.dtb
U-boot
Kernel Image
a-nfc.dtb
a-voicehat.dtb
a-rs485.dtb
a-60inch-lcd.dtb
...
Why Device Tree Overlay? (cont.)
NFC HAT
VOICE HAT
RS485 HAT
CAN BUS HAT
LED HAT
a.dtb
nfc.dtboOverlay Solution
voicehat.dtbo
rs485.dtbo
can.dtbo
led.dtbo
Multiple inch LCD
5inch-lcd.dtbo
10inch-lcd.dtbo
...
60inch-lcd.dtbo
U-boot
Kernel Image
a.dtb
nfc.dtbo
voicehat.dtbo
60inch-lcd.dtbo
...
Linux example (in u-boot)
~# fdt addr ${fdt_addr}
~# fdt resize ${fdt_buffer}
~# setexpr fdtovaddr ${fdt_addr} + 0xF0000;
~# fatload mmc ${mmcdev}:${mmcpart} ${fdtovaddr} xxx.dtbo
~# fdt apply ${fdtovaddr}
U-boot
Kernel Image
a.dtb
nfc.dtbo
voicehat.dtbo
60inch-lcd.dtbo
...
Rootfs
FAT partition
AOSP 9.0 new feature: DTBO
AOSP 9.0 partitions
bootloader
boot
dtbo
vbmeta
system
vendor
recovery
presister
user data
Non-AB system
bootloader
user data
system
boot vendor
AB system
dtbo
vbmeta
presister
Source: https://source.android.com/devices/architec ture/dto/partitions
DTBO Overview
o Special Image format such as boot.img
o Depend on dt_table structure
o Depend on boot image header version
Pie
Pie Non AB
DTBO Overview (cont.d)
Structure prototype in U-boot:
1. Boot Image header: <source>/include/android_image.h
2. DT table: <source>/include/dt_table.h
Implement DTBO on AOSP 9.0
Big issue
ANDROID OPEN SOURCE BSP
Case: PICO-IMX8MM
• CPU: NXP ARM Cortex-A53 IMX8M-Mini 4-core 1.2GHz
• DRAM: 4GB
• OS: Android 9.0.0
• Complexity issue: NXP does not support multiple dtb in DTBO
[** L**] The dtbo image will be loaded from eMMC to dram in the process
of AVB verify, after verify pass the correct dtb will then be loaded to the
right address. We have only one dtb so the load process is quite simple,
you can check do_boota() in “drivers/usb/gadget/f_fastboot.c” for more
details. You don’t see the custom dtb because only the first dtb in the
dtbo will be loaded by default, what you have to do is load the second
(custom dtb) yourself.
I'm not very familiar with the dtbo.img loading process or format, I merely
helped Linaro get the headers from AOSP to U-Boot. In your case I would ask
Sam ( s***n.p******o@linaro.org ) about it. This dtbo.img is relatively new
and a bit of a niche so googling might not help.
Regards,
d****
Raspberry PI case
Classic AOSP A/B system case
bootloader boot_a
dtbo_a
vbmeta_a
system_a
vendor_a
Normal reboot
Fastboot mode
Upgrade mode
Raspberry PI case
bootloader boot_a
dtbo_a
vmeta_a
system
vendor
FAT partition
zImage bootargs dtb,dtbos uramdisk
Raspberry Open source project (Reference: android-rpi repo)
Is it useable?
Make a DTBO image
Path: <source>/device/fsl/imx8m/pico_imx8mm/AndroidBoard.mk
LOCAL_PATH := $(call my-dir)
include device/fsl/common/build/kernel.mk
include device/fsl/common/build/uboot.mk
include device/fsl/common/build/dtbo.mk
...
include $(LOCAL_PATH)/AndroidTee.mk
include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/media-profile/media-profile.mk
include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/sensor/fsl-sensor.mk
Make a DTBO image (cont.d)
Path: <source>/device/fsl/common/build/dtbo.mk
TARGET_BOARD_DTS_CONFIG := imx8mm:imx8mm-pico-pi-ili9881c.dtb dtbo-imx8mm.img
Make a DTBO image (cont.d)
/host/linux-x86/bin/mkdtimg create dtbo.img
target/product/pico_imx8mm/obj/KERNEL_OBJ/arch/arm64/boot/dts/freescale/imx8mm-pico-pi.dtb
target/product/pico_imx8mm/obj/KERNEL_OBJ/arch/arm64/boot/dts/freescale/overlays/imx8mm-pico-pi-nfc.dtbo
Make a DTBO image (cont.d)
TARGET_BOARD_DTS_CONFIG := imx8mm:imx8mm-pico-pi-ili9881c.dtb
TARGET_BOARD_DTBO_CONFIG := imx8mm:imx8mm-pico-pi-mipi_5-overlay.dts.dtbo
dtbo-imx8mm.img
dtbo.img
Get A/B slot
boot.img
Load kernel addr
Load boot header
U-boot Tweaking (before)
Path: <source>/vendor/nxp-opensource/uboot-imx/drivers/usb/gadget/f_fastboot.c
Start boota
AVB verification
Checking
AB/ NonAB
Load ramdisk addr
Second addr
Load table
Load entry[0] boot
kernel
U-boot V2018.03
dtbo.img
Get A/B slot
boot.img
Load kernel addr
Load boot header
U-boot Tweaking (after)
Path: <source>/vendor/nxp-opensource/uboot-imx/drivers/usb/gadget/f_fastboot.c
Start boota
AVB verification
Checking
AB/ NonAB
Load ramdisk addr
Second addr
Load table
Load entry[0] (dtb)
boot
kernel
Load entry[n] (dtbo)
merge entry[n]
Update second addr
U-boot V2018.03
Merge API: CONFIG_OF_LIBFDT_OVERLAY=y
Patch link
[** L**]
Nice to hear it works out! We are glad to see the patches if you can share
it with us.
Future Work
What about boot image V2
• For Android 10
• Add "DTB" field
• Keep DTB files in Boot Image
(concatenated or in DTBO image format)
• All DTBO files must be stored in ‘dtbo’
partition
End?? No, V3 format coming
• For Android 11
• Needed for GKI (Generic Kernel Image)
• Other new features and partition layouts...
Other vendors....
V1 V2 V3
NXP IMX8
Android 10
✔
TI Beagle Board
Android 10
✔
Rockchip RK3399
Android 10
✔
MTK Android 11 ✔
Summary
• DTBO discussion
Pros
• Overcome complexity issue for runtime level
• Match AOSP security architecture
• Easy to make a DTBO image
Cons
• The version of Boot image header changes are being made too fast
• Google said it's universal for all vendors, but the truth is different implement
methods for each vendors
Thank you for your listen!
Reference
• Google DTBO overview
• Linaro Connect resource:
SAN19-217 - New Android requirements for bootloaders
• Linux example: load device tree overlay on u-boot

More Related Content

What's hot

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
Utkarsh Mankad
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
Susant Sahani
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
Kan-Ru Chen
 

What's hot (20)

Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Synchronization linux
Synchronization linuxSynchronization linux
Synchronization linux
 
The Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast StorageThe Linux Block Layer - Built for Fast Storage
The Linux Block Layer - Built for Fast Storage
 
Android device driver structure introduction
Android device driver structure introductionAndroid device driver structure introduction
Android device driver structure introduction
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
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)
 
Implementing generic JNI hardware control for Kotlin based app on AOSP
Implementing generic JNI hardware control for Kotlin based app on AOSPImplementing generic JNI hardware control for Kotlin based app on AOSP
Implementing generic JNI hardware control for Kotlin based app on AOSP
 
Yocto project
Yocto projectYocto project
Yocto project
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Open source Android 10 on Orange Pi: Meth or Reality?
Open source Android 10 on Orange Pi: Meth or Reality?Open source Android 10 on Orange Pi: Meth or Reality?
Open source Android 10 on Orange Pi: Meth or Reality?
 
Linux Device Tree
Linux Device TreeLinux Device Tree
Linux Device Tree
 
Introduction to yocto
Introduction to yoctoIntroduction to yocto
Introduction to yocto
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Low Level View of Android System Architecture
Low Level View of Android System ArchitectureLow Level View of Android System Architecture
Low Level View of Android System Architecture
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 

Similar to Device Tree Overlay implementation on AOSP 9.0

Similar to Device Tree Overlay implementation on AOSP 9.0 (20)

Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
Kubernetes on Bare Metal at the Kitchener-Waterloo Kubernetes and Cloud Nativ...
 
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
BeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream ComponentsBeagleBone Black: Platform Bring-Up with Upstream Components
BeagleBone Black: Platform Bring-Up with Upstream Components
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
A million ways to provision embedded linux devices
A million ways to provision embedded linux devicesA million ways to provision embedded linux devices
A million ways to provision embedded linux devices
 
OPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build TutorialOPTEE on QEMU - Build Tutorial
OPTEE on QEMU - Build Tutorial
 
Effective images remix
Effective images remixEffective images remix
Effective images remix
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
Ci For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or GalCi For The Web 2.0 Guy Or Gal
Ci For The Web 2.0 Guy Or Gal
 
Next Stop, Android
Next Stop, AndroidNext Stop, Android
Next Stop, Android
 
C# Production Debugging Made Easy
 C# Production Debugging Made Easy C# Production Debugging Made Easy
C# Production Debugging Made Easy
 
Compiling and using u boot for beagle bone
Compiling and using u boot for beagle boneCompiling and using u boot for beagle bone
Compiling and using u boot for beagle bone
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Hardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshopHardwear.io 2018 BLE Security Essentials workshop
Hardwear.io 2018 BLE Security Essentials workshop
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Recently uploaded (20)

Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Device Tree Overlay implementation on AOSP 9.0

  • 1. Device Tree Overlay Implementation on AOSP 9.0 WIG CHENG IN COSCUP 2020 2020/8/1
  • 2. Me Name: Wig Work: Technexion #> Embedded Linux #> Industrial Android BSP #> Robotic OS Github: @wigcheng
  • 3. Contents • Introduce Device Tree Overlay • AOSP 9.0 new feature: DTBO • Implement DTBO on AOSP 9.0 •Big issue •Make a DTBO image including DTB and DTBO •U-boot Tweaking • Future work • Android 10 and 11 • Conclusion
  • 5. Why Device Tree Overlay? NFC HAT VOICE HAT RS485 HAT CAN BUS HAT LED HAT a.dtb DTB: Device Tree BlobDTS: Device Tree Source DTBO: Device Tree Blob for Overlay a-nfc.dtbTraditional Solution a-voicehat.dtb a-rs485.dtb a-can.dtb a-led.dtb Multiple inch LCD a-5inch-lcd.dtb a-10inch-lcd.dtb ... a-60inch-lcd.dtb U-boot Kernel Image a-nfc.dtb a-voicehat.dtb a-rs485.dtb a-60inch-lcd.dtb ...
  • 6. Why Device Tree Overlay? (cont.) NFC HAT VOICE HAT RS485 HAT CAN BUS HAT LED HAT a.dtb nfc.dtboOverlay Solution voicehat.dtbo rs485.dtbo can.dtbo led.dtbo Multiple inch LCD 5inch-lcd.dtbo 10inch-lcd.dtbo ... 60inch-lcd.dtbo U-boot Kernel Image a.dtb nfc.dtbo voicehat.dtbo 60inch-lcd.dtbo ...
  • 7. Linux example (in u-boot) ~# fdt addr ${fdt_addr} ~# fdt resize ${fdt_buffer} ~# setexpr fdtovaddr ${fdt_addr} + 0xF0000; ~# fatload mmc ${mmcdev}:${mmcpart} ${fdtovaddr} xxx.dtbo ~# fdt apply ${fdtovaddr} U-boot Kernel Image a.dtb nfc.dtbo voicehat.dtbo 60inch-lcd.dtbo ... Rootfs FAT partition
  • 8. AOSP 9.0 new feature: DTBO
  • 9. AOSP 9.0 partitions bootloader boot dtbo vbmeta system vendor recovery presister user data Non-AB system bootloader user data system boot vendor AB system dtbo vbmeta presister
  • 10. Source: https://source.android.com/devices/architec ture/dto/partitions DTBO Overview o Special Image format such as boot.img o Depend on dt_table structure o Depend on boot image header version Pie Pie Non AB
  • 11. DTBO Overview (cont.d) Structure prototype in U-boot: 1. Boot Image header: <source>/include/android_image.h 2. DT table: <source>/include/dt_table.h
  • 12. Implement DTBO on AOSP 9.0
  • 14. Case: PICO-IMX8MM • CPU: NXP ARM Cortex-A53 IMX8M-Mini 4-core 1.2GHz • DRAM: 4GB • OS: Android 9.0.0 • Complexity issue: NXP does not support multiple dtb in DTBO
  • 15. [** L**] The dtbo image will be loaded from eMMC to dram in the process of AVB verify, after verify pass the correct dtb will then be loaded to the right address. We have only one dtb so the load process is quite simple, you can check do_boota() in “drivers/usb/gadget/f_fastboot.c” for more details. You don’t see the custom dtb because only the first dtb in the dtbo will be loaded by default, what you have to do is load the second (custom dtb) yourself.
  • 16. I'm not very familiar with the dtbo.img loading process or format, I merely helped Linaro get the headers from AOSP to U-Boot. In your case I would ask Sam ( s***n.p******o@linaro.org ) about it. This dtbo.img is relatively new and a bit of a niche so googling might not help. Regards, d****
  • 17. Raspberry PI case Classic AOSP A/B system case bootloader boot_a dtbo_a vbmeta_a system_a vendor_a Normal reboot Fastboot mode Upgrade mode
  • 18. Raspberry PI case bootloader boot_a dtbo_a vmeta_a system vendor FAT partition zImage bootargs dtb,dtbos uramdisk Raspberry Open source project (Reference: android-rpi repo)
  • 20. Make a DTBO image Path: <source>/device/fsl/imx8m/pico_imx8mm/AndroidBoard.mk LOCAL_PATH := $(call my-dir) include device/fsl/common/build/kernel.mk include device/fsl/common/build/uboot.mk include device/fsl/common/build/dtbo.mk ... include $(LOCAL_PATH)/AndroidTee.mk include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/media-profile/media-profile.mk include $(FSL_PROPRIETARY_PATH)/fsl-proprietary/sensor/fsl-sensor.mk
  • 21. Make a DTBO image (cont.d) Path: <source>/device/fsl/common/build/dtbo.mk TARGET_BOARD_DTS_CONFIG := imx8mm:imx8mm-pico-pi-ili9881c.dtb dtbo-imx8mm.img
  • 22. Make a DTBO image (cont.d) /host/linux-x86/bin/mkdtimg create dtbo.img target/product/pico_imx8mm/obj/KERNEL_OBJ/arch/arm64/boot/dts/freescale/imx8mm-pico-pi.dtb target/product/pico_imx8mm/obj/KERNEL_OBJ/arch/arm64/boot/dts/freescale/overlays/imx8mm-pico-pi-nfc.dtbo
  • 23.
  • 24. Make a DTBO image (cont.d) TARGET_BOARD_DTS_CONFIG := imx8mm:imx8mm-pico-pi-ili9881c.dtb TARGET_BOARD_DTBO_CONFIG := imx8mm:imx8mm-pico-pi-mipi_5-overlay.dts.dtbo dtbo-imx8mm.img
  • 25. dtbo.img Get A/B slot boot.img Load kernel addr Load boot header U-boot Tweaking (before) Path: <source>/vendor/nxp-opensource/uboot-imx/drivers/usb/gadget/f_fastboot.c Start boota AVB verification Checking AB/ NonAB Load ramdisk addr Second addr Load table Load entry[0] boot kernel U-boot V2018.03
  • 26. dtbo.img Get A/B slot boot.img Load kernel addr Load boot header U-boot Tweaking (after) Path: <source>/vendor/nxp-opensource/uboot-imx/drivers/usb/gadget/f_fastboot.c Start boota AVB verification Checking AB/ NonAB Load ramdisk addr Second addr Load table Load entry[0] (dtb) boot kernel Load entry[n] (dtbo) merge entry[n] Update second addr U-boot V2018.03 Merge API: CONFIG_OF_LIBFDT_OVERLAY=y
  • 28. [** L**] Nice to hear it works out! We are glad to see the patches if you can share it with us.
  • 30. What about boot image V2 • For Android 10 • Add "DTB" field • Keep DTB files in Boot Image (concatenated or in DTBO image format) • All DTBO files must be stored in ‘dtbo’ partition
  • 31. End?? No, V3 format coming • For Android 11 • Needed for GKI (Generic Kernel Image) • Other new features and partition layouts...
  • 32. Other vendors.... V1 V2 V3 NXP IMX8 Android 10 ✔ TI Beagle Board Android 10 ✔ Rockchip RK3399 Android 10 ✔ MTK Android 11 ✔
  • 33. Summary • DTBO discussion Pros • Overcome complexity issue for runtime level • Match AOSP security architecture • Easy to make a DTBO image Cons • The version of Boot image header changes are being made too fast • Google said it's universal for all vendors, but the truth is different implement methods for each vendors
  • 34. Thank you for your listen!
  • 35. Reference • Google DTBO overview • Linaro Connect resource: SAN19-217 - New Android requirements for bootloaders • Linux example: load device tree overlay on u-boot