With the popularity of Android phones, along with the success in the consumer field, the industrial Android platform is also becoming more and more popular in Europe.
In this session, the presenter will share his experience of integrating AOSP 9.0 on multiple industrial grade platform with various hardware specifications, as well as demonstrate a real case of using the latest dtbo.img architecture to achieve separating the hardware specifications from the software definitions. With this additional abstract layer, the maintenance costs and upgrade complexity will be dramatically improved while fully matching the security architecture of AOSP.
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
...
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
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...
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
35. Reference
• Google DTBO overview
• Linaro Connect resource:
SAN19-217 - New Android requirements for bootloaders
• Linux example: load device tree overlay on u-boot