Sumit Semwal | 4607dcf | 2023-07-18 18:36:06 +0530 | [diff] [blame] | 1 | .. |
| 2 | # Copyright (c) 2023, Linaro Ltd. |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | |
| 6 | RB3 |
| 7 | === |
| 8 | |
Sumit Semwal | 9755e04 | 2023-11-30 16:34:51 +0530 | [diff] [blame^] | 9 | RB3 is one of the supported dev-boards listed on |
Sumit Semwal | 4607dcf | 2023-07-18 18:36:06 +0530 | [diff] [blame] | 10 | `source.android.com <https://source.android.com/docs/setup/create/devices>`_. |
| 11 | |
| 12 | The vendor-packages required to build RB3 images with AOSP are |
Sumit Semwal | 9755e04 | 2023-11-30 16:34:51 +0530 | [diff] [blame^] | 13 | listed `here <http://releases.devboardsforandroid.linaro.org/vendor-packages>`_. |
Sumit Semwal | 4607dcf | 2023-07-18 18:36:06 +0530 | [diff] [blame] | 14 | |
Sumit Semwal | 9755e04 | 2023-11-30 16:34:51 +0530 | [diff] [blame^] | 15 | |
| 16 | Getting started with RB3 (also known as DB845c) |
| 17 | ----------------------------------------------- |
| 18 | |
| 19 | Learn about your RB3 board as well as how to prepare and set up for basic |
| 20 | use from the |
| 21 | `96boards DB845c getting started page <https://www.96boards.org/documentation/consumer/dragonboard/dragonboard845c/getting-started/rb3-kit/>`_. |
| 22 | |
| 23 | Make sure you are running AOSP (ptable compatible) bootloader on DB845c. Latest |
| 24 | bootloader binaries (build #97 and above) are `hosted here |
| 25 | <http://snapshots.linaro.org/96boards/dragonboard845c/linaro/rescue/>`_. |
| 26 | |
| 27 | For flashing instructions checkout |
| 28 | `96boards DB845c recovery page <https://www.96boards.org/documentation/consumer/dragonboard/dragonboard845c/installation/board-recovery.md.html>`_. |
| 29 | |
| 30 | NOTE: |
| 31 | |
| 32 | You can also update bootloader binaries by running **flashall** script, which is |
| 33 | a part of the vendor package of the RB3 AOSP build target. Boot in fastboot mode |
| 34 | and run following command from your HOST machine:: |
| 35 | |
| 36 | git clone https://gerrit.devboardsforandroid.linaro.org/linaro-vendor-package |
| 37 | cd src/db845c/dragonboard-845c-bootloader-ufs-aosp/ |
| 38 | ./flashall |
| 39 | |
| 40 | |
| 41 | Install pre-built AOSP images on RB3 |
| 42 | ------------------------------------ |
| 43 | |
| 44 | Linaro create daily AOSP builds for DB845c that user can download, flash and |
| 45 | boot from. If you are interested in prebuilt AOSP images for DB845c and want to |
| 46 | avoid compiling your own, please download and flash boot.img, vendor_boot.img, |
| 47 | super.img and userdata.img from |
| 48 | `the snapshot here <http://snapshots.linaro.org/96boards/dragonboard845c/linaro/aosp-master>`_. |
| 49 | |
| 50 | Flash downloaded AOSP images by running following commands, while booted |
| 51 | in fastboot mode:: |
| 52 | |
| 53 | fastboot flash userdata userdata.img |
| 54 | fastboot flash super super.img |
| 55 | fastboot flash vendor_boot vendor_boot.img |
| 56 | fastboot flash boot boot.img |
| 57 | |
| 58 | |
| 59 | Compile AOSP from sources for RB3 |
| 60 | --------------------------------- |
| 61 | |
| 62 | #. Download the AOSP source tree and build db845c-userdebug build target: |
| 63 | |
| 64 | :: |
| 65 | |
| 66 | repo init -u https://android.googlesource.com/platform/manifest -b master |
| 67 | repo sync -j`nproc` |
| 68 | ./device/linaro/dragonboard/fetch-vendor-package.sh |
| 69 | source ./build/envsetup.sh |
| 70 | lunch db845c-trunk_staging-userdebug |
| 71 | make -j`nproc` |
| 72 | |
| 73 | |
| 74 | #. Install: `Boot DB845c into fastboot mode <https://www.96boards.org/documentation/consumer/dragonboard/dragonboard845c/installation/board-recovery.md.html#booting-into-fastboot>`_ and run following command: |
| 75 | |
| 76 | :: |
| 77 | |
| 78 | ./device/linaro/dragonboard/installer/db845c/flash-all-aosp.sh |
| 79 | |
| 80 | You can also perform QDL board recovery by running following script after |
| 81 | booting DB845c in `USB flashing mode <https://www.96boards.org/documentation/consumer/dragonboard/dragonboard845c/installation/board-recovery.md.html#connecting-the-board-in-usb-flashing-mode-aka-edl-mode>`_: |
| 82 | |
| 83 | :: |
| 84 | |
| 85 | ./device/linaro/dragonboard/installer/db845c/recovery.sh |
| 86 | |
| 87 | |
| 88 | Building the kernel for RB3 |
| 89 | --------------------------- |
| 90 | |
| 91 | The **Preferred** option is to build DB845c Android GKI kernel artifacts using |
| 92 | official Bazel build. Run the following commands to clone the kernel source, |
| 93 | prebuilt Android toolchains and build scripts. |
| 94 | |
| 95 | :: |
| 96 | |
| 97 | mkdir repo-db845c |
| 98 | cd repo-db845c |
| 99 | repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline |
| 100 | repo sync -j`nproc` |
| 101 | tools/bazel clean |
| 102 | tools/bazel run //common:db845c_dist |
| 103 | |
| 104 | Now delete all the objects in |
| 105 | $(AOSP_TOPDIR)device/linaro/dragonboard-kernel/android-mainline/, then copy |
| 106 | build artifacts from out/db845c/dist/ to |
| 107 | $(AOSP_TOPDIR)/device/linaro/dragonboard-kernel/android-mainline/ |
| 108 | |
| 109 | If you want to properly test the GKI kernel, you should |
| 110 | |
| 111 | * grab the latest kernel_aarch64 build from |
| 112 | https://ci.android.com/builds/branches/aosp_kernel-common-android-mainline/grid? |
| 113 | |
| 114 | * under artifacts, download the Image.gz and copy it to |
| 115 | $(AOSP_TOPDIR)/device/linaro/dragonboard-kernel/android-mainline/ |
| 116 | |
| 117 | Then rebuild AOSP using: |
| 118 | |
| 119 | :: |
| 120 | |
| 121 | make TARGET_KERNEL_USE=mainline -j`nproc`' |
Sumit Semwal | 4607dcf | 2023-07-18 18:36:06 +0530 | [diff] [blame] | 122 | |