SlideShare a Scribd company logo
1 of 29
Download to read offline
War Story:
Using Mainline Linux
for an Android TV BSP
Neil Armstrong
Baylibre SAS
Timeline
● Android & Mainline
● HAL story
● GPU war story
● Boot Flows
● Other integration issues
● Conclusion
Scope of the project
● Build an “Upstream” AOSP BSP for new Amlogic SoC
● Targets (for now) the TV profile (for Android TV)
● Will use Android 4.19 as initial kernel base
● New SoCs from Amlogic, not yet supported in
mainline
● Team had AOSP port experience on very early
Android releases (~1.6)
Android & Mainline Linux
Android & Mainline
● Android has a long a complex history with mainline
Linux
● Recently, Google outlines multiple efforts
○ Project Treble: kernel ABI as “vendor interface” to have a
“Generic System Image”
○ “One kernel to boot them all” project to leverage common
kernel build
Android & Mainline
● AOSP 10 can run using pure vanilla kernel
● But we still use an Android derived branch with:
○ Android specific kernel config
○ Android specific kernel patches/fixes
○ Android kernel build YAML
Android & Mainline
● Our use case ?
○ No vendor, only mainline
○ New SoCs:
■ S905X2
■ S905X3
○ We need to push the support upstream and
backport
Android & Mainline
● The upstream process ?
○ As usual
○ But, we need to backport the upstream patches
to the Android tree
○ Using ChromeOS kernel rules for commit message
■ UPSTREAM
■ BACKPORT
■ FROMLIST
Android & Mainline
● But, why upstream-first ?
○ Easy maintenance
○ Fast rebase (git will drop backports)
○ Ensure code quality
● Cons ?
○ Slow
○ More work to be accepted upstream
○ Upstream won’t accept complex hacky features
Android & Mainline
Upstream won’t accept complex hacky features ?!
● Not an issue !
● WiP patches can be applied from List
○ So we can take more time to polish them
● Non-upstreamable patches are also possible
○ But we try to limit these
○ We tag them with “ANDROID:”
Hardware Abstraction Layers
HAL story
● Android based on Frameworks and HALs
● HALs translates the Frameworks high level system needs into system
calls
● Why ?
○ At the time, ARM mainline Linux was very limited
■ No dynamic graphic stack (only fbdev)
■ No sensor framework
■ Very limited Runtime Power Management
■ ...
HAL story
HAL story
● With the limited mainline Linux kernel
○ Vendor wrote their own HAL for display, GPU, …
○ Google wrote their own PM, syslog… drivers
● It tooks a very long time until AOSP could run on vanilla
○ It took time for Kernel dev to push alternatives
○ It took time for Google to use these alternatives
○ The DRM framework took time to mature
○ There is still a lot of work...
HAL story
● Our HAL usage ?
● The Yukawa project uses the default HALs for
○ drm-hwcomposer (was a huge blocker)
○ bluetooth
○ Wifi, ....
● Custom HALS :
○ Gralloc for the ARM Mali integration
○ HDMI-CEC, but could be generic
○ Lights
GPU Integration
GPU war story
GPU war story
● GPU library <-> gralloc <-> hwcomposer relationship
○ Google made their own OpenGL API
○ A private vendor “private_handle_t” structure is added
○ Is added by gralloc to be used by the HWComposer module
○ Can also be used by the OpenGL library
○ Contains properties of the allocated GPU buffer
GPU war story
● Mali ?
○ ARM provides a vendor Gralloc module
○ The Gralloc module version is tied to the OpenGL library version
○ E.g: Amlogic modified the private_handle_t structure
○ We are tied to use the Amlogic derived Gralloc module
● The drm-hwcomposer also needs a vendor implementation
○ Using the vendor gralloc private_handle_t define
○ Using the private_handle_t structure to import the buffer into DRM
GPU war story
● But
○ drm-hwcomposer is an external “generic” HAL
○ So -> upstream first !
GPU war story
● We still have an issue !
● Low-cost Android TV vendors (Amlogic, Allwinner, Rockchip, …) SoCs
usually cannot handle a full 4K UI layer
○ So they limit the Android UI in 1080p max
○ This is done in their Hardware Composer HAL module
● So, can we do the same with drm-hwcomposer ?
○ No
○ It needs a complete HWC API change to separate the
■ Display Mode
■ UI Layer dimensions
○ This are not distinguished as today
○ So we need to “lie” to Android and give a fake “1080p mode” for all 4K modes
Boot Flows
Boot Flows
● Old way (pre-Android 9)
○ Kernel as bootimg + initrd (DT added at the end of kernel zImage)
○ Mounts system, mounts vendor and boots
○ Can still be used for Android 9
● New Way v1 (system-as-root)
○ Kernel as bootimg (DT as “second” payload) + eventual DTBO
○ Mounts system using UUID, finds vendor in DT and mounts it
○ Optional for Android 9, Mandatory for Android 10 if not using “New Way v2”
● New Way v2 (dynamic partitions support)
○ Kernel as bootimg (DT as dtb payload) + initrd (required for dm-linear) + eventual DTBO
○ Mounts system & vendor from the “Super” partition and boots
○ Mandatory for Android 10 if not using “New Way v1”
Boot Flows
● Supporting all boot flows in a single codebase is very hard
● Simplest is to support the last one: Android 10 + System-as-root
● U-boot has regular patchset to support these feature
○ Pushed by Google, TI or other vendors
○ But those are very generic
○ Still needs a complex boot flow script !
Boot Flows
● The reference board are support in mainline U-Boot o/
● But we still needs a few hacks on top to meet the complete
Android boot flow :-(
Other Integration Issues
Other issues
● Audio
○ It’s a mess, Google develops a complete HAL API
○ But no generic ALSA HAL, at all !
○ Solution ? re-use the old https://github.com/CirrusLogic/tinyhal
● WiFi
○ It’s a mess, don’t look at it, they still rely(ied ?) on their old
wpa-supplicant fork
○ Hopefully it’s moving forward ?
● Similar Display Modes
○ You can’t provide multiple display modes with same width X height X freq
○ No Interlaced support...
Conclusion
● https://android.googlesource.com/device/amlogic/yukawa/
● Android is much more Mainline Linux friendly
● Common modern Kernel APIs are being adopted
● Still a long road before having:
○ Single kernel for multiple boards
○ Mainline based kernel with very few patches
● Hopefully Panfrost will solve the GPU nightmare
● HWComposer needs some adaptations

More Related Content

What's hot

Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapGeorge Markomanolis
 
LAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLinaro
 
LAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg developmentLAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg developmentLinaro
 
Lee 2020 what the clock !
Lee 2020  what the clock !Lee 2020  what the clock !
Lee 2020 what the clock !Neil Armstrong
 
LAS16-200: SCMI - System Management and Control Interface
LAS16-200:  SCMI - System Management and Control InterfaceLAS16-200:  SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control InterfaceLinaro
 
Las16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLas16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLinaro
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLinaro
 
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
 
ONNC - 0.9.1 release
ONNC - 0.9.1 releaseONNC - 0.9.1 release
ONNC - 0.9.1 releaseLuba Tang
 
BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!Linaro
 
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLinaro
 
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by Hisilicon
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by HisiliconLAS16-310: Introducing the first 96Boards TV Platform: Poplar by Hisilicon
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by HisiliconLinaro
 
LAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development LifecycleLAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development LifecycleLinaro
 
Las16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLas16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLinaro
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
ELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureNeil Armstrong
 
LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201Linaro
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLinaro
 
BKK16-100K1 George Grey, Linaro CEO Opening Keynote
BKK16-100K1 George Grey, Linaro CEO Opening KeynoteBKK16-100K1 George Grey, Linaro CEO Opening Keynote
BKK16-100K1 George Grey, Linaro CEO Opening KeynoteLinaro
 
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLinaro
 

What's hot (20)

Utilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmapUtilizing AMD GPUs: Tuning, programming models, and roadmap
Utilizing AMD GPUs: Tuning, programming models, and roadmap
 
LAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMGLAS16-209: Finished and Upcoming Projects in LMG
LAS16-209: Finished and Upcoming Projects in LMG
 
LAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg developmentLAS16-TR06: Remoteproc & rpmsg development
LAS16-TR06: Remoteproc & rpmsg development
 
Lee 2020 what the clock !
Lee 2020  what the clock !Lee 2020  what the clock !
Lee 2020 what the clock !
 
LAS16-200: SCMI - System Management and Control Interface
LAS16-200:  SCMI - System Management and Control InterfaceLAS16-200:  SCMI - System Management and Control Interface
LAS16-200: SCMI - System Management and Control Interface
 
Las16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need itLas16 200 - firmware summit - ras what is it- why do we need it
Las16 200 - firmware summit - ras what is it- why do we need it
 
LAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel AwarenessLAS16-403: GDB Linux Kernel Awareness
LAS16-403: GDB Linux Kernel Awareness
 
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
 
ONNC - 0.9.1 release
ONNC - 0.9.1 releaseONNC - 0.9.1 release
ONNC - 0.9.1 release
 
BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!BKK16-103 OpenCSD - Open for Business!
BKK16-103 OpenCSD - Open for Business!
 
LAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoSLAS16-207: Bus scaling QoS
LAS16-207: Bus scaling QoS
 
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by Hisilicon
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by HisiliconLAS16-310: Introducing the first 96Boards TV Platform: Poplar by Hisilicon
LAS16-310: Introducing the first 96Boards TV Platform: Poplar by Hisilicon
 
LAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development LifecycleLAS16-106: GNU Toolchain Development Lifecycle
LAS16-106: GNU Toolchain Development Lifecycle
 
Las16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - statusLas16 309 - lua jit arm64 port - status
Las16 309 - lua jit arm64 port - status
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
ELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, futureELC-E 2019 Device tree, past, present, future
ELC-E 2019 Device tree, past, present, future
 
LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201LAS16-TR03: Upstreaming 201
LAS16-TR03: Upstreaming 201
 
LAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android NLAS16-201: ART JIT in Android N
LAS16-201: ART JIT in Android N
 
BKK16-100K1 George Grey, Linaro CEO Opening Keynote
BKK16-100K1 George Grey, Linaro CEO Opening KeynoteBKK16-100K1 George Grey, Linaro CEO Opening Keynote
BKK16-100K1 George Grey, Linaro CEO Opening Keynote
 
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leaderLAS16-405:OpenDataPlane: Software Defined Dataplane leader
LAS16-405:OpenDataPlane: Software Defined Dataplane leader
 

Similar to Ostech war story using mainline linux for an android tv bsp

LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205Linaro
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VOpersys inc.
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIOpersys inc.
 
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...The Linux Foundation
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Opersys inc.
 
NAB 2019 Latest Technical and Business Progress with AV1
NAB 2019 Latest Technical and Business Progress with AV1NAB 2019 Latest Technical and Business Progress with AV1
NAB 2019 Latest Technical and Business Progress with AV1Karan "Kay" Singh
 
GNU/Linux ou Android comme système d'exploitation embarqué ?
GNU/Linux ou Android comme système d'exploitation embarqué ?GNU/Linux ou Android comme système d'exploitation embarqué ?
GNU/Linux ou Android comme système d'exploitation embarqué ?Open Source Experience
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningAnne Nicolas
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Ron Munitz
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLeszek Godlewski
 
BKK16-105 HALs for LITE
BKK16-105 HALs for LITEBKK16-105 HALs for LITE
BKK16-105 HALs for LITELinaro
 
X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)Ron Munitz
 
Mob modcon 2015-android rom cooking tutorial
Mob modcon 2015-android rom cooking tutorialMob modcon 2015-android rom cooking tutorial
Mob modcon 2015-android rom cooking tutorialRon Munitz
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux HeritageOpersys inc.
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UIOpersys inc.
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023Igalia
 
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Ron Munitz
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLinaro
 

Similar to Ostech war story using mainline linux for an android tv bsp (20)

LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205LMG Lightning Talks - SFO17-205
LMG Lightning Talks - SFO17-205
 
Is Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon VIs Android the New Embedded Linux? at AnDevCon V
Is Android the New Embedded Linux? at AnDevCon V
 
Is Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VIIs Android the New Embedded Linux? at AnDevCon VI
Is Android the New Embedded Linux? at AnDevCon VI
 
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
XPDDS17: Keynote: Shared Coprocessor Framework on ARM - Oleksandr Andrushchen...
 
Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012Android Hacks, Variants, Tricks and Resources ESC SV 2012
Android Hacks, Variants, Tricks and Resources ESC SV 2012
 
NAB 2019 Latest Technical and Business Progress with AV1
NAB 2019 Latest Technical and Business Progress with AV1NAB 2019 Latest Technical and Business Progress with AV1
NAB 2019 Latest Technical and Business Progress with AV1
 
GNU/Linux ou Android comme système d'exploitation embarqué ?
GNU/Linux ou Android comme système d'exploitation embarqué ?GNU/Linux ou Android comme système d'exploitation embarqué ?
GNU/Linux ou Android comme système d'exploitation embarqué ?
 
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) WinningKernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
Kernel Recipes 2016 - Upstream Kernel Graphics is (Finally) Winning
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
 
Linux as a gaming platform, ideology aside
Linux as a gaming platform, ideology asideLinux as a gaming platform, ideology aside
Linux as a gaming platform, ideology aside
 
BKK16-105 HALs for LITE
BKK16-105 HALs for LITEBKK16-105 HALs for LITE
BKK16-105 HALs for LITE
 
X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)X86 ROM Cooking 101 (Android Builders Summit 2014)
X86 ROM Cooking 101 (Android Builders Summit 2014)
 
Mob modcon 2015-android rom cooking tutorial
Mob modcon 2015-android rom cooking tutorialMob modcon 2015-android rom cooking tutorial
Mob modcon 2015-android rom cooking tutorial
 
Armbian linux
Armbian linuxArmbian linux
Armbian linux
 
Leveraging Android's Linux Heritage
Leveraging Android's Linux HeritageLeveraging Android's Linux Heritage
Leveraging Android's Linux Heritage
 
Inside Android's UI
Inside Android's UIInside Android's UI
Inside Android's UI
 
Freedreno on Android – XDC 2023
Freedreno on Android          – XDC 2023Freedreno on Android          – XDC 2023
Freedreno on Android – XDC 2023
 
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
Android ROM Cooking 101: A practical tutorial (DroidCon Tel-Aviv 2014)
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
Armbian balcoon
Armbian balcoonArmbian balcoon
Armbian balcoon
 

More from Neil Armstrong

Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCs
Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCsLinux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCs
Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCsNeil Armstrong
 
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCs
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCsEmbedded Recipes 2017 - Mainline Linux on Amlogic SoCs
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCsNeil Armstrong
 
ELC North America 2017- Mainline Linux on Amlogic SoCs
ELC North America 2017- Mainline Linux on Amlogic SoCsELC North America 2017- Mainline Linux on Amlogic SoCs
ELC North America 2017- Mainline Linux on Amlogic SoCsNeil Armstrong
 
Fête de l'internet d'Antibes 2011 - Recherche sur Internet
Fête de l'internet d'Antibes 2011 - Recherche sur InternetFête de l'internet d'Antibes 2011 - Recherche sur Internet
Fête de l'internet d'Antibes 2011 - Recherche sur InternetNeil Armstrong
 
Fete internet antibes 2011 - Recherche sur Internet
Fete internet antibes 2011 - Recherche sur InternetFete internet antibes 2011 - Recherche sur Internet
Fete internet antibes 2011 - Recherche sur InternetNeil Armstrong
 
IPv6, un second souffle pour l’internet
 IPv6, un second souffle pour l’internet IPv6, un second souffle pour l’internet
IPv6, un second souffle pour l’internetNeil Armstrong
 
Intellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsIntellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsNeil Armstrong
 

More from Neil Armstrong (7)

Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCs
Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCsLinux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCs
Linux Conf Australia 2018 - Kernel Miniconf - Mainline Linux on Amlogic SoCs
 
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCs
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCsEmbedded Recipes 2017 - Mainline Linux on Amlogic SoCs
Embedded Recipes 2017 - Mainline Linux on Amlogic SoCs
 
ELC North America 2017- Mainline Linux on Amlogic SoCs
ELC North America 2017- Mainline Linux on Amlogic SoCsELC North America 2017- Mainline Linux on Amlogic SoCs
ELC North America 2017- Mainline Linux on Amlogic SoCs
 
Fête de l'internet d'Antibes 2011 - Recherche sur Internet
Fête de l'internet d'Antibes 2011 - Recherche sur InternetFête de l'internet d'Antibes 2011 - Recherche sur Internet
Fête de l'internet d'Antibes 2011 - Recherche sur Internet
 
Fete internet antibes 2011 - Recherche sur Internet
Fete internet antibes 2011 - Recherche sur InternetFete internet antibes 2011 - Recherche sur Internet
Fete internet antibes 2011 - Recherche sur Internet
 
IPv6, un second souffle pour l’internet
 IPv6, un second souffle pour l’internet IPv6, un second souffle pour l’internet
IPv6, un second souffle pour l’internet
 
Intellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server InternalsIntellicore Tech Talk 10 - Apache Web Server Internals
Intellicore Tech Talk 10 - Apache Web Server Internals
 

Recently uploaded

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 

Recently uploaded (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 

Ostech war story using mainline linux for an android tv bsp

  • 1. War Story: Using Mainline Linux for an Android TV BSP Neil Armstrong Baylibre SAS
  • 2. Timeline ● Android & Mainline ● HAL story ● GPU war story ● Boot Flows ● Other integration issues ● Conclusion
  • 3. Scope of the project ● Build an “Upstream” AOSP BSP for new Amlogic SoC ● Targets (for now) the TV profile (for Android TV) ● Will use Android 4.19 as initial kernel base ● New SoCs from Amlogic, not yet supported in mainline ● Team had AOSP port experience on very early Android releases (~1.6)
  • 5. Android & Mainline ● Android has a long a complex history with mainline Linux ● Recently, Google outlines multiple efforts ○ Project Treble: kernel ABI as “vendor interface” to have a “Generic System Image” ○ “One kernel to boot them all” project to leverage common kernel build
  • 6. Android & Mainline ● AOSP 10 can run using pure vanilla kernel ● But we still use an Android derived branch with: ○ Android specific kernel config ○ Android specific kernel patches/fixes ○ Android kernel build YAML
  • 7. Android & Mainline ● Our use case ? ○ No vendor, only mainline ○ New SoCs: ■ S905X2 ■ S905X3 ○ We need to push the support upstream and backport
  • 8. Android & Mainline ● The upstream process ? ○ As usual ○ But, we need to backport the upstream patches to the Android tree ○ Using ChromeOS kernel rules for commit message ■ UPSTREAM ■ BACKPORT ■ FROMLIST
  • 9.
  • 10. Android & Mainline ● But, why upstream-first ? ○ Easy maintenance ○ Fast rebase (git will drop backports) ○ Ensure code quality ● Cons ? ○ Slow ○ More work to be accepted upstream ○ Upstream won’t accept complex hacky features
  • 11. Android & Mainline Upstream won’t accept complex hacky features ?! ● Not an issue ! ● WiP patches can be applied from List ○ So we can take more time to polish them ● Non-upstreamable patches are also possible ○ But we try to limit these ○ We tag them with “ANDROID:”
  • 13. HAL story ● Android based on Frameworks and HALs ● HALs translates the Frameworks high level system needs into system calls ● Why ? ○ At the time, ARM mainline Linux was very limited ■ No dynamic graphic stack (only fbdev) ■ No sensor framework ■ Very limited Runtime Power Management ■ ...
  • 15. HAL story ● With the limited mainline Linux kernel ○ Vendor wrote their own HAL for display, GPU, … ○ Google wrote their own PM, syslog… drivers ● It tooks a very long time until AOSP could run on vanilla ○ It took time for Kernel dev to push alternatives ○ It took time for Google to use these alternatives ○ The DRM framework took time to mature ○ There is still a lot of work...
  • 16. HAL story ● Our HAL usage ? ● The Yukawa project uses the default HALs for ○ drm-hwcomposer (was a huge blocker) ○ bluetooth ○ Wifi, .... ● Custom HALS : ○ Gralloc for the ARM Mali integration ○ HDMI-CEC, but could be generic ○ Lights
  • 19. GPU war story ● GPU library <-> gralloc <-> hwcomposer relationship ○ Google made their own OpenGL API ○ A private vendor “private_handle_t” structure is added ○ Is added by gralloc to be used by the HWComposer module ○ Can also be used by the OpenGL library ○ Contains properties of the allocated GPU buffer
  • 20. GPU war story ● Mali ? ○ ARM provides a vendor Gralloc module ○ The Gralloc module version is tied to the OpenGL library version ○ E.g: Amlogic modified the private_handle_t structure ○ We are tied to use the Amlogic derived Gralloc module ● The drm-hwcomposer also needs a vendor implementation ○ Using the vendor gralloc private_handle_t define ○ Using the private_handle_t structure to import the buffer into DRM
  • 21. GPU war story ● But ○ drm-hwcomposer is an external “generic” HAL ○ So -> upstream first !
  • 22. GPU war story ● We still have an issue ! ● Low-cost Android TV vendors (Amlogic, Allwinner, Rockchip, …) SoCs usually cannot handle a full 4K UI layer ○ So they limit the Android UI in 1080p max ○ This is done in their Hardware Composer HAL module ● So, can we do the same with drm-hwcomposer ? ○ No ○ It needs a complete HWC API change to separate the ■ Display Mode ■ UI Layer dimensions ○ This are not distinguished as today ○ So we need to “lie” to Android and give a fake “1080p mode” for all 4K modes
  • 24. Boot Flows ● Old way (pre-Android 9) ○ Kernel as bootimg + initrd (DT added at the end of kernel zImage) ○ Mounts system, mounts vendor and boots ○ Can still be used for Android 9 ● New Way v1 (system-as-root) ○ Kernel as bootimg (DT as “second” payload) + eventual DTBO ○ Mounts system using UUID, finds vendor in DT and mounts it ○ Optional for Android 9, Mandatory for Android 10 if not using “New Way v2” ● New Way v2 (dynamic partitions support) ○ Kernel as bootimg (DT as dtb payload) + initrd (required for dm-linear) + eventual DTBO ○ Mounts system & vendor from the “Super” partition and boots ○ Mandatory for Android 10 if not using “New Way v1”
  • 25. Boot Flows ● Supporting all boot flows in a single codebase is very hard ● Simplest is to support the last one: Android 10 + System-as-root ● U-boot has regular patchset to support these feature ○ Pushed by Google, TI or other vendors ○ But those are very generic ○ Still needs a complex boot flow script !
  • 26. Boot Flows ● The reference board are support in mainline U-Boot o/ ● But we still needs a few hacks on top to meet the complete Android boot flow :-(
  • 28. Other issues ● Audio ○ It’s a mess, Google develops a complete HAL API ○ But no generic ALSA HAL, at all ! ○ Solution ? re-use the old https://github.com/CirrusLogic/tinyhal ● WiFi ○ It’s a mess, don’t look at it, they still rely(ied ?) on their old wpa-supplicant fork ○ Hopefully it’s moving forward ? ● Similar Display Modes ○ You can’t provide multiple display modes with same width X height X freq ○ No Interlaced support...
  • 29. Conclusion ● https://android.googlesource.com/device/amlogic/yukawa/ ● Android is much more Mainline Linux friendly ● Common modern Kernel APIs are being adopted ● Still a long road before having: ○ Single kernel for multiple boards ○ Mainline based kernel with very few patches ● Hopefully Panfrost will solve the GPU nightmare ● HWComposer needs some adaptations