BKK16-310 The HiKey AOSP collaborative experience
- 1. Presented by
Date
Event
The HiKey AOSP
collaborative experience
John Stultz
(With help from Amit Pundir, Guodong
Xu, and Vishal Bhoj)
BKK16-310 March 9, 2016
Linaro Connect BKK16
- 2. Outline
● HiKey in AOSP intro
● Issues with AOSP & how HiKey addresses them
● How Linaro’s previous efforts helped us along here
● Unique requirements for AOSP devboards
● Lessons learned
● Accomplishments & future plans
● Questions!
- 4. HiKey + AOSP!
All well documented on the AOSP website:
https://source.android.com/source/initializing.html
$ repo init -u https://android.googlesource.com/platform/manifest
$ repo sync -j24
Grab & extract vendor binaries from here:
https://developers.google.com/android/nexus/drivers#hikey
$ source build/envsetup.sh
$ lunch hikey-userdebug
$ make -j24 droidcore
- 5. Past Issues with AOSP
● AOSP as Nexus only development
project
● Slow uptake of LTS kernels
● Devboards lacking integration seen
on form-factor devices
- 6. HiKey in AOSP
● Addresses a number of complaints we and
others have had with AOSP
● Provides a reference devboard in AOSP!
● Unlike nexus devices, HiKey will move
forward to newer kernel versions
● Takes Linaro’s previous efforts generating
Android builds w/ the latest kernels and
userspace but does it inside of AOSP
● Provides good testbed for validation
- 7. Device Released Kernel Kernel release date
Nexus 5 October 31, 2013 3.4 May 20th, 2012
Nexus 5X /
Nexus 6P
October 22, 2015 3.10 June 30, 2013
Slow uptake of LTS kernels
- 8. Vendors base their BSP trees
on whatever the latest AOSP
common kernel
Google generates AOSP
common trees based upon
what kernel versions their
partner vendors require
Circular blame
- 9. Put this to the test with HiKey
● When HiKey AOSP effort started, HiKey official kernel
was 3.18, which was the latest AOSP common git
branch
● Pushed to migrate to 4.1
● AOSP released experimental android-4.1 branch.
● Linaro helped push a number of fixes in for it and
reorganized the tree
● AOSP released an official android-4.1 branch!
- 10. Forward porting AOSP common.git
● Linaro has taken the effort for a number of years to
forward port the AOSP common.git tree to the latest
mainline release
● Provided members with a “preview” of what the AOSP
tree would possibly look like, allowing for early Android
development against newer kernels
● Provided practical experience with the AOSP common.
git tree
● Helped the Android upstreaming effort
- 11. Also put us a step ahead
● Allowed us to see where upstream changes collided.
● We had to resolve a number build fixes and issues with
the forward ported tree.
● So when AOSP common.git experimental trees
appeared, we had a number of fixes ready and waiting
to go.
● So when the experimental/android-4.1 branch
appeared, Amit Pundir was ready
- 12. Keeping it going for 4.4 and beyond
● After kernel v4.4 was released, Amit Pundir had a
forward ported tree ready.
● Sent it to Google developers, so it might be a helpful
reference when they do their experimental/android-4.4
release
● Google developers decided to just take Amit’s tree,
rather than do their own forward port!
- 18. Less obvious needed items
● Configfs gadget support
● “adb reboot bootloader”
● pstore
● easy firmware flashing
● handling different sized mmc & userdata
partitions
- 19. “reboot reason” functionality
● Communicates to bootloader to enter fastboot or
recovery mode on next boot
● Working with community to get a solution that works for
a number of different systems
○ Works with upstream nexus7 kernel and HiKey
○ Integrating w/ patches from Rockchip devs
○ Working to get it all upstream
- 20. pstore via DTS
● Allows for console and dmesg data to be preserved
after a crash
● With upstream code, pstore functionality is enabled with
custom platform driver
● Couple of attempts by folks to push patches to do this
via dts entries
● Nudged developer at Google to resubmit, hopefully can
get it queued soon
- 21. Other bootloader enhancements
● HiKey uses UEFI, which normally uses fat
boot partition
○ Preference is the standard AOSP boot image format
● Extending the UEFI and recovery loader
fastboot protocol support
● Supporting proper getvars for partition
resizing
- 22. Pain points and lessons learned
● For devboards, it’s really useful to have
USB host and gadget support working at
the same time.
● Being able to update the entire bootloader
via fastboot would be useful
● Devboard testing limitations vs form-factor
expectations (ie: hotplug testing!)
- 23. Since last connect....
● Forward ported HiKey patches from 3.18 -> 4.1
● Migrated from Lollipop to Marshmallow and master
● Collaborated w/ Google to release and fixup
experimental/android-4.1 tree
● Reorganized experimental/android-4.1 tree, which was
basis for android-4.1
● Added features expected on android devices (reboot
reason, pstore, improved fastboot) to HiKey
● Upgraded to mali r6p0
● Chased lots of bugs
● Provided reference forward ported 4.4 tree, which became
experimental/andorid-4.4 & provided fixes and cleanups, to
help create android-4.4
- 24. ● Migrate AOSP HiKey builds to android-4.4
● Move to Vendor/ODM partitions
● Continue pushing HiKey and AOSP common patches
upstream
● Continue rolling HiKey AOSP builds along to the next
LTS release (4.8-4.10)
● Power management & EAS test bed
Future plans
- 25. Linaro cross team effort!
● HiSilicon LT
● Build and Baselines
● 96boards
● Member Services
● LMG Kernel
● QA Services