Author: Sam Protsenko <semen.protsenko at linaro dot org>

Date of last update: 28 May 2019

AOSP master with linux-mainline on BeagleBoard X15.

Modified projects

In order to make AOSP/master + linux-mainline work on X15, some projects were modified:

Please switch to linux-mainline branch after downloading (for each project).

Build environment

Next environment should be used to build the U-Boot and Linux kernel:

$ export PATH=/opt/gcc-linaro-7.3.1-2018.05-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE="ccache arm-eabi-"
$ export ARCH=arm

Download and Build

U-Boot

Obtain U-Boot master with additional patches for booting linux-mainline kernel:

$ cd ~/repos
$ git clone https://git.linaro.org/people/semen.protsenko/u-boot.git
$ cd u-boot
$ git checkout linux-mainline

Build U-Boot:

$ make am57xx_evm_defconfig
$ make -j4

Android kernel configs

Obtain Android kernel configs:

$ cd ~/repos
$ git clone https://android.googlesource.com/kernel/configs

linux-mainline kernel

Obtain linux-mainline kernel with additional patches for booting the Android:

$ cd ~/repos
$ git clone https://git.linaro.org/people/semen.protsenko/linux-mainline.git
$ cd linux-mainline
$ git checkout linux-mainline

Configure the kernel, using multi_v7_defconfig + Android kernel configs:

./scripts/kconfig/merge_config.sh -r \
        arch/arm/configs/multi_v7_defconfig \
        ti_config_fragments/multi_v7_prune.cfg \
        ti_config_fragments/baseport.cfg \
        ti_config_fragments/ipc.cfg \
        ti_config_fragments/connectivity.cfg \
        ti_config_fragments/audio_display.cfg \
        ti_config_fragments/omap_soc.cfg \
        ti_config_fragments/lpae.cfg \
        ti_config_fragments/dra7_only.cfg \
        ti_config_fragments/systemd.cfg \
        ../configs/android-4.19/android-base.config \
        ../configs/android-4.19/android-recommended.config \
        ti_config_fragments/android.cfg > /dev/null

Build the kernel:

$ make -j4 zImage modules dtbs

AOSP master

Obtain AOSP master:

$ cd ~/repos
$ mkdir aosp
$ cd aosp
$ repo init -u https://android.googlesource.com/platform/manifest -b master
$ repo sync -j20

Add patches for beagle_x15 device:

$ cd device/ti/beagle_x15
$ git remote add sam https://git.linaro.org/people/semen.protsenko/android/device-ti-beagle_x15.git
$ git fetch sam
$ git checkout linux-mainline
$ cd -

Add patches for am57x hardware project:

$ cd hardware/ti/am57x
$ git remote add sam https://git.linaro.org/people/semen.protsenko/android/hardware-ti-am57x.git
$ git fetch sam
$ git checkout linux-mainline
$ cd -

Apply temporary workaround for "com.android.phone" issue:

$ cd frameworks/opt/telephony
$ git fetch "https://android.googlesource.com/platform/frameworks/opt/telephony" refs/changes/63/970163/1 && git cherry-pick FETCH_HEAD
$ cd -

Apply temporary fix for "EthernetServiceThread":

$ cd frameworks/opt/net/ethernet
$ git fetch "https://android.googlesource.com/platform/frameworks/opt/net/ethernet" refs/changes/55/968455/1 && git cherry-pick FETCH_HEAD
$ cd -

Build AOSP master:

$ export KERNELDIR=~/repos/linux-mainline
$ . ./build/envsetup.sh
$ lunch beagle_x15-userdebug
$ make -j4
$ make bootfitimage

Flashing and Running

1. Boot the board from eMMC, press SPACE to get into U-Boot shell. Get into fastboot mode:

=> fastboot 1

2. Flash U-Boot images

$ cd ~/repos/u-boot
$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img
$ fastboot reboot

3. Get into new U-Boot shell by pressing space.

4. Prepare new environment and get into fastboot mode:

=> env default -f -a
=> setenv partitions $partitions_android
=> env save
=> fastboot 1

5. Flash Android images:

$ cd ~/repos/aosp
$ cd out/target/product/beagle_x15
$ fastboot oem format
$ fastboot flash boot boot_fit.img
$ fastboot flash system system.img
$ fastboot flash userdata userdata.img
$ fastboot flash vendor vendor.img
$ fastboot reboot

After last command, the board will reboot and Android will be booted.

References

[1] JIRA ticket: https://projects.linaro.org/browse/LCG-2316

AOSP/Boards/BeagleboardX15-mainline (last modified 2019-06-11 19:01:58)