Android 10 (master) with kernel 5.4

I’ve made some really good progress in getting this all smoothed out and working well. I started with the upstream (AOSP) treble enabled implementation for db845c and added the older db820c over it, as well as added an automotive product.

I’ve also smoothed out the qcomlt-5.4 kernel and added what was needed for Android.

Mostly working, with the exception of USB Gadget (adb over USB) and the board’s analog audio features.

Build instructions are in the readme in this repository with pinned manifest;

Note: The kernel should work (with a proper defconfig) for debian as well. It cures all of the sporadic boot failure problems that all of the 4.14 kernels experienced to varying degrees.

2 Likes

hey, this is impressive! many thanks for sharing the good work.
I guess we should try to get all that stuff into the Linaro kernel and resurrect/improve our debian images… I know i said we wouldn’t pay too much attention on this board, but since you seem to have done most of the work … maybe we should reconsider that…

would you be willing to try to submit the relevant patches upstream so that we don’t have to keep carrying them over and over? especially the cpufreq related patches. someone from the community might work soon on CPR on 835 (from the aarch64-laptop project), and that work will be relevant for 820 as well… so by putting everything together, that could be a great enhancement…

in case you haven’t seen that before:

thanks a lot for your work!

Hi @anon91830841
I’m not really sure how to push them forward with upstream, apparently they have been proposed for upstream back in June 2018, but something stalled;

https://patchwork.kernel.org/project/linux-arm-msm/list/?submitter=174873&state=*&archive=both

Hi @doitright,

Thanks for your work. I’m following your readme to build pinned_020620.xml manifest and running into kernel and Android boot errors.

repo init -u https://android.googlesource.com/platform/manifest -b master
wget https://gitlab.com/aosp-automotive/pinned-manifests/raw/master/pinned_020620.xml -O .repo/manifests pinned_020620.xml
repo init -m pinned_020620.xml
repo sync
git clone https://gitlab.com/aosp-automotive/dragonboard-kernel-src.git
git checkout -t origin/mainline-5.4.20-db820c
make db820c_defconfig
make
cat ./arch/arm64/boot/Image.gz ./arch/arm64/boot/dts/qcom/apq8096-db820c.dtb > {android root}/device/linaro/dragonboard-kernels/db820c-5.4.gz-dtb
. build/envsetup.sh
lunch db820c_car-userdebug
m

Kernel and Android boot log:

[    0.000000] Linux version 5.4.20-621240-gf6ef4a2da656 (dyun@UbuntuSSD) (gcc version 7.5.0 (Linaro GCC 7.5-2019.12)) #6 SMP PREEMPT Tue Apr 21 16:31:16 PDT 2020
...
[    3.943257] ------------[ cut here ]------------
[    3.947717] gpu_gx status stuck at 'off'
[    3.947756] WARNING: CPU: 1 PID: 1 at drivers/clk/qcom/gdsc.c:145 gdsc_toggle_logic+0xc8/0xd0
...
[    6.739412] ------------[ cut here ]------------
[    6.744478] WARNING: CPU: 1 PID: 1 at drivers/regulator/core.c:2044 _regulator_put.part.24+0x144/0x150
...
[   36.966289] init: starting service 'vendor.audio-hal'...
[   37.092565] init: starting service 'vendor.gralloc-2-0'...
[   37.103479] init: starting service 'vendor.hwcomposer-2-2'...
[   37.134080] init: Service 'vendor.gralloc-2-0' (pid 809) exited with status 1
[   37.134126] init: Sending signal 9 to service 'vendor.gralloc-2-0' (pid 809) process group...
[   37.140567] libprocessgroup: Successfully killed process cgroup uid 1000 pid 809 in 0ms
[   37.165709] init: Service 'vendor.hwcomposer-2-2' (pid 810) exited with status 1
[   37.165763] init: Sending signal 9 to service 'vendor.hwcomposer-2-2' (pid 810) process group...
[   37.172753] libprocessgroup: Successfully killed process cgroup uid 1000 pid 810 in 0ms
[   37.230386] init: starting service 'audioserver'...
[   37.593382] binder: release 804:804 transaction 3368 in, still active
[   37.593414] binder: send failed reply for transaction 3368 to 813:813
[   37.614423] binder: undelivered death notification, 0000e22a986248c0

The Android boot process just goes in a loop trying to restart audio, gralloc, and hwcomposer. Can you help? I recently purchased the DragonBoard 820c REV A, APQ8096SG.

Thanks!

It’s hard to help without the full log. Clippings like that really don’t help. You can paste bulk logs into something like a gitlab “snippet” and create a link to it.

But before that, your message doesn’t indicate copying of the kernel modules into the location where the AOSP build system will find them. If you skipped that step, several things, including graphics and audio, will not initialize.

Flashing AOSP

AOSP booting

I did copy over the kernel modules for 5.4.20-db820c.

find . -name '*.ko' -exec cp {} {android root}/device/linaro/dragonboard-kernels/db820c-5.4-modules/ \;

There were only 2 modules:
./drivers/remoteproc/qcom_q6v5_pas.ko
./drivers/gpu/drm/msm/msm.ko

Also, the board came preinstalled with Debian, so put the device into EDL mode and flashed the aosp partitions.

cd aosp/device/linaro/dragonboard/installer/db820c
sudo ~/bin/qdl prog_ufs_firehose_8996_ddr.elf rawprogram.xml patch.xml

Ok, so it looks like its loading the display driver (msm.ko), and that the issue is actually with the audio HAL not loading, which kind of makes sense since you don’t have one of my sound cards installed. Although this is just a guess since you didn’t share the Android log (command: “logcat” in the console will run it). Does the boot animation show on the screen?

Try commenting out lines from

through

That did it! Successful boot to Android automotive home screen.

Thanks @doitright

1 Like

Another option that should work, is if you just comment out the codec { ... }; from those 2 sections you commented out. This would keep the sound card more intact, and should generate i2s on the low speed header.

Will make the changes, thanks for the advice.

@doitright,

I am trying to build automotive AOSP as per the given steps.

AOSP-Automotive / pinned manifests

However, it is falling on 99% with the below error.

user@USER-no-MacBook-Pro-2 aosp % make -j2

============================================

PLATFORM_VERSION_CODENAME=S

PLATFORM_VERSION=S

TARGET_PRODUCT=db820c_car

TARGET_BUILD_VARIANT=userdebug

TARGET_BUILD_TYPE=release

TARGET_ARCH=arm64

TARGET_ARCH_VARIANT=armv8-a

TARGET_CPU_VARIANT=kryo

TARGET_2ND_ARCH=arm

TARGET_2ND_ARCH_VARIANT=armv8-a

TARGET_2ND_CPU_VARIANT=kryo

HOST_ARCH=x86_64

HOST_OS=darwin

HOST_OS_EXTRA=Darwin-19.5.0-x86_64-10.15.5

HOST_BUILD_TYPE=release

BUILD_ID=AOSP.MASTER

OUT_DIR=out

PRODUCT_SOONG_NAMESPACES=external/mesa3d

============================================

[ 1% 3/204] including art/Android.mk …

art/build/Android.common.mk:52: warning: unsupported HOST_ARCH=x86_64

[ 99% 203/204] finishing build rules …

FAILED:

In file included from build/make/core/main.mk:1360:

build/make/core/Makefile:57: error: VINTF metadata found in PRODUCT_COPY_FILES: device/linaro/dragonboard/automotive/manifest.xml:vendor/etc/vintf/manifest/manifest-car.xml, use DEVICE_MANIFEST_FILE / DEVICE_MATRIX_FILE / vintf_compatibility_matrix / vintf_fragments instead!.

02:19:27 ckati failed with: exit status 1

failed to build some targets (01:51 (mm:ss))

Your output there is inconsistent with what you should get with the newest pinned manifest. Did you possibly grab an older manifest?

No. Then after I successfully build with pinned manifest (pinned_020620.xml). I will try with new pinned manifest(pinned_052820.xml) later.

@doitright,

I have received Dragon board 820C.
I have followed the procedure and trying to boot up, however currently facing one issue.

The boot animation is displayed on the screen, however it does not reach to home screen.
I can access adb, already taken log using logcat, can you check?

I could not understand the issue

Your logcat cuts off after just 15 seconds. It takes a lot longer than that to boot. Normal boot is around 30+ seconds, first boot is at least a couple of minutes.

Give it more time and collect a longer logcat.

Also, in gitlab do you see the button at the top that says “snippet”? Use that to post logs instead of how you are. It’s easier for you to upload, and easier for me to read.

Did you make the kernel modification outlined above for those who don’t use one of my sound cards?

@doitright,
Thank you for your reply.
Yes I already commented arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi#L931 -L960

I attached new snippet log, please check

I performed the following steps.

repo init -u https://android.googlesource.com/platform/manifest -b master
wget https://gitlab.com/aosp-automotive/pinned-manifests/raw/master/pinned_020620.xml -O .repo/manifests pinned_020620.xml
repo init -m pinned_020620.xml
repo sync
git clone https://gitlab.com/aosp-automotive/dragonboard-kernel-src.git
git checkout -t origin/mainline-5.4.20-db820c

Commented out arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi#L931 - L960 for removing sound card support.
Compile the kernel with db820c_defconfig

make db820c_defconfig
make -j24
cat ./arch/arm64/boot/Image.gz ./arch/arm64/boot/dts/qcom/apq8096-db820c.dtb > {android root}/device/linaro/dragonboard-kernels/db820c-5.4.gz-dtb
. build/envsetup.sh
lunch db820c_car-userdebug

Copy the kernel and .ko modules to device /linaro/dragonboard-kernels/db820c-5.4-modules/ using below command.

cat ./arch/arm64/boot/Image.gz ./arch/arm64/boot/dts/qcom/apq8096-db820c.dtb > {android root}/device/linaro/dragonboard-kernels/db820c-5.4.gz-dtb

find . -name '*.ko' -exec cp {} {android root}/device/linaro/dragonboard-kernels/db820c-5.4-modules/ \;

Build AOSP

make -j4

Flashing process
Modify the name boot-debug.img to boot.img
Flash AOSP with Following command.

sudo ./device/linaro/dragonboard/installer/db820c/flash-all-aosp.sh

You need to start over.
Follow the instructions in the readme here:

Use the newest manifest, and don’t muck with the kernel branch, use the default branch.

I made a small change to the audio hal to keep it from crashing if there is no sound card installed on the system.

This means that the change to the kernel is no longer required for it to boot successfully.

@doitright,

It worked. Got the home screen.
Thank you for sharing the details.

1 Like