Skip to content

Commit ae44b71

Browse files
Mattijs Korpershoekcshilwant
authored andcommitted
feat(android): Remove un-needed CONFIG_part_variant conditionals
The common Android documentation (located at source/android) has a bunch of conditionals that test if device is either AM62X or AM62PX. Since the Android SDK only supports these 2 SoCs, there is no need to have these conditionals. Remove them to simplify the .rst files. Signed-off-by: Mattijs Korpershoek <[email protected]>
1 parent a281e8c commit ae44b71

File tree

3 files changed

+78
-104
lines changed

3 files changed

+78
-104
lines changed

source/android/Foundational_Components_Bootloaders.rst

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,16 @@ The toolchains are automatically downloaded by the build scripts.
88

99
**Install OPTEE-OS build dependencies**
1010

11-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
12-
13-
Check OPTEE-OS docs to know list of dependencies needed to be installed :
14-
https://optee.readthedocs.io/en/latest/building/prerequisites.html
11+
Check OPTEE-OS docs to know list of dependencies needed to be installed :
12+
https://optee.readthedocs.io/en/latest/building/prerequisites.html
1513

1614

1715
**Install additional dependencies**
1816

19-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
20-
21-
.. code-block:: console
17+
.. code-block:: console
2218
23-
$ sudo apt install bc bison build-essential curl u-boot-tools flex git libssl-dev python3 python3-pip wget -y
24-
$ pip3 install pycryptodome pyelftools shyaml --user
19+
$ sudo apt install bc bison build-essential curl u-boot-tools flex git libssl-dev python3 python3-pip wget -y
20+
$ pip3 install pycryptodome pyelftools shyaml --user
2521
2622
2723
.. _android-download-bootloaders:
@@ -30,18 +26,16 @@ The toolchains are automatically downloaded by the build scripts.
3026
Downloading sources
3127
*******************
3228

33-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
29+
Fetch the code using ``repo``:
3430

35-
Fetch the code using ``repo``:
36-
37-
.. code-block:: console
31+
.. code-block:: console
3832
39-
$ mkdir ${YOUR_PATH}/ti-bootloader-aosp/ && cd $_
40-
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Bootloader.xml
41-
$ repo sync
33+
$ mkdir ${YOUR_PATH}/ti-bootloader-aosp/ && cd $_
34+
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Bootloader.xml
35+
$ repo sync
4236
43-
For more information about ``repo``, visit `Android's official
44-
documentation <https://source.android.com/setup/build/downloading>`__
37+
For more information about ``repo``, visit `Android's official
38+
documentation <https://source.android.com/setup/build/downloading>`__
4539

4640
.. _android-build-bootloaders:
4741

source/android/Foundational_Components_Kernel.rst

Lines changed: 40 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@ Android Kernel
88
Downloading sources
99
*******************
1010

11-
.. ifconfig:: CONFIG_part_variant in ('AM62X' 'AM62PX')
11+
Fetch the code using ``repo``:
1212

13-
Fetch the code using ``repo``:
13+
.. code-block:: console
1414
15-
.. code-block:: console
15+
$ mkdir ${YOUR_PATH}/ti-kernel-aosp/ && cd $_
16+
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Kernel-6.6.xml
17+
$ repo sync
1618
17-
$ mkdir ${YOUR_PATH}/ti-kernel-aosp/ && cd $_
18-
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Kernel-6.6.xml
19-
$ repo sync
19+
.. tip::
2020

21-
.. tip::
21+
To save some disk space, pass the ``--depth=1`` option to ``repo init``:
2222

23-
To save some disk space, pass the ``--depth=1`` option to ``repo init``:
24-
25-
.. code-block:: console
23+
.. code-block:: console
2624
27-
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Kernel-6.6.xml --depth=1
25+
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01_Kernel-6.6.xml --depth=1
2826
2927
.. _android-build-kernel:
3028

@@ -39,75 +37,65 @@ Building everything from scratch
3937

4038
The kernel is compatible with all AM62x boards, such as the SK EVM and the Beagle Play.
4139

42-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
40+
.. code-block:: console
4341
44-
.. code-block:: console
42+
$ cd ${YOUR_PATH}/ti-kernel-aosp/
43+
$ export TARGET_KERNEL_USE="6.6"
44+
$ export DIST_DIR=${YOUR_PATH}/ti-aosp-15/device/ti/am62x-kernel/kernel/${TARGET_KERNEL_USE}
45+
$ tools/bazel run //common:ti_dist -- --dist_dir=$DIST_DIR
4546
46-
$ cd ${YOUR_PATH}/ti-kernel-aosp/
47-
$ export TARGET_KERNEL_USE="6.6"
48-
$ export DIST_DIR=${YOUR_PATH}/ti-aosp-15/device/ti/am62x-kernel/kernel/${TARGET_KERNEL_USE}
49-
$ tools/bazel run //common:ti_dist -- --dist_dir=$DIST_DIR
47+
Android uses Kleaf, a Bazel-based build system to build the kernel.
48+
AOSP documentation can be found `here <https://source.android.com/docs/setup/build/building-kernels?hl=fr>`__ and
49+
Kleaf documentation `here <https://android.googlesource.com/kernel/build/+/refs/heads/main/kleaf/README.md>`__
5050

51-
Android uses Kleaf, a Bazel-based build system to build the kernel.
52-
AOSP documentation can be found `here <https://source.android.com/docs/setup/build/building-kernels?hl=fr>`__ and
53-
Kleaf documentation `here <https://android.googlesource.com/kernel/build/+/refs/heads/main/kleaf/README.md>`__
51+
.. attention::
5452

55-
.. attention::
56-
57-
Kernel builds hangs when using the ``btrfs`` file system.
58-
This is a known issue according to the `kleaf documentation <https://android.googlesource.com/kernel/build/+/refs/heads/main/kleaf/docs/errors.md#build-hangs-on-btrfs>`_
59-
Make sure to pass the ``--workaround_btrfs_b292212788`` flag to bazel when using ``btrfs``.
53+
Kernel builds hangs when using the ``btrfs`` file system.
54+
This is a known issue according to the `kleaf documentation <https://android.googlesource.com/kernel/build/+/refs/heads/main/kleaf/docs/errors.md#build-hangs-on-btrfs>`_
55+
Make sure to pass the ``--workaround_btrfs_b292212788`` flag to bazel when using ``btrfs``.
6056

6157

6258
Defconfig/menuconfig changes
6359
============================
6460

6561
The usual (``make menuconfig``) is done via ``bazel`` command :
6662

67-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
68-
69-
.. code-block:: console
70-
71-
$ cd ${YOUR_PATH}/ti-kernel-aosp/
72-
$ tools/bazel run //common:ti_config -- menuconfig
63+
.. code-block:: console
7364
74-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
65+
$ cd ${YOUR_PATH}/ti-kernel-aosp/
66+
$ tools/bazel run //common:ti_config -- menuconfig
7567
76-
.. note::
68+
.. note::
7769

78-
Users must have built the android kernel image prior to building the Android file system.
79-
Otherwise pre-built kernel images present in :file:`device/ti/am62x-kernel`
80-
will be used to create :file:`boot.img`
70+
Users must have built the android kernel image prior to building the Android file system.
71+
Otherwise pre-built kernel images present in :file:`device/ti/am62x-kernel`
72+
will be used to create :file:`boot.img`
8173

8274

8375
Rebuild Android images
8476
======================
8577

86-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
87-
88-
We should re-generate the Android images to include the newly build kernel.
89-
Follow the Android :ref:`android-build-aosp` to do so.
78+
We should re-generate the Android images to include the newly build kernel.
79+
Follow the Android :ref:`android-build-aosp` to do so.
9080

9181
*********************
9282
Flashing instructions
9383
*********************
9484

95-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
85+
In order to flash a new kernel, several images should be flashed:
9686

97-
In order to flash a new kernel, several images should be flashed:
98-
99-
.. code-block:: console
87+
.. code-block:: console
10088
101-
$ adb reboot fastboot
102-
< Wait for fastbootd reboot >
89+
$ adb reboot fastboot
90+
< Wait for fastbootd reboot >
10391
104-
$ cd <PATH/TO/IMAGES>
105-
$ fastboot flash boot boot.img
106-
$ fastboot flash vendor_boot vendor_boot.img
107-
$ fastboot flash vendor_dlkm vendor_dlkm.img
108-
$ fastboot reboot
92+
$ cd <PATH/TO/IMAGES>
93+
$ fastboot flash boot boot.img
94+
$ fastboot flash vendor_boot vendor_boot.img
95+
$ fastboot flash vendor_dlkm vendor_dlkm.img
96+
$ fastboot reboot
10997
110-
The board should boot with the new kernel.
98+
The board should boot with the new kernel.
11199

112100
********************
113101
Enabling new drivers

source/android/Overview_Building_the_SDK.rst

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,20 @@ To install it, please refer to this webpage : https://source.android.com/setup/d
2828
Downloading sources
2929
*******************
3030

31-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
31+
Create a folder for downloading all sources
3232

33-
Create a folder for downloading all sources
34-
35-
.. code-block:: console
36-
37-
$ mkdir ~/10_01_00 && cd $_
38-
$ export YOUR_PATH=$PWD
33+
.. code-block:: console
3934
40-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
35+
$ mkdir ~/10_01_00 && cd $_
36+
$ export YOUR_PATH=$PWD
4137
42-
Fetch the code using ``repo``:
38+
Fetch the code using ``repo``:
4339

44-
.. code-block:: console
40+
.. code-block:: console
4541
46-
$ mkdir ${YOUR_PATH}/ti-aosp-15 && cd $_
47-
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01.xml
48-
$ repo sync
42+
$ mkdir ${YOUR_PATH}/ti-aosp-15 && cd $_
43+
$ repo init -u https://git.ti.com/git/android/manifest.git -b android15-release -m releases/RLS_10_01.xml
44+
$ repo sync
4945
5046
.. tip::
5147

@@ -65,16 +61,14 @@ Downloading sources
6561
Build Instructions
6662
******************
6763

68-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
69-
70-
.. code-block:: console
64+
.. code-block:: console
7165
72-
$ cd ${YOUR_PATH}/ti-aosp-15
73-
$ source build/envsetup.sh
74-
$ lunch <BUILD_TARGET>
75-
$ m
76-
[...]
77-
#### build completed successfully (49:14 (mm:ss)) ####
66+
$ cd ${YOUR_PATH}/ti-aosp-15
67+
$ source build/envsetup.sh
68+
$ lunch <BUILD_TARGET>
69+
$ m
70+
[...]
71+
#### build completed successfully (49:14 (mm:ss)) ####
7872
7973
Where ``<BUILD_TARGET>`` is listed in the table below :
8074

@@ -129,22 +123,20 @@ The following build flags are available. **Default** values are **highlighted**.
129123
- **false**/true
130124
- Boot from SD card instead of eMMC
131125

132-
.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')
126+
After building is complete, the necessary images will be available in
127+
:file:`${YOUR_PATH}/ti-aosp-15/out/target/product/am62*/`.
133128

134-
After building is complete, the necessary images will be available in
135-
:file:`${YOUR_PATH}/ti-aosp-15/out/target/product/am62*/`.
129+
To proceed to flash Android, see :ref:`android-flashing`.
136130

137-
To proceed to flash Android, see :ref:`android-flashing`.
138-
139-
.. tip::
131+
.. tip::
140132

141-
As stated previously, Android build contains **pre-built binaries**
142-
for both the kernel and the bootloaders.
143-
These are ready to be used as-is with the EVM boards.
144-
For customization, it's possible to rebuild them.
133+
As stated previously, Android build contains **pre-built binaries**
134+
for both the kernel and the bootloaders.
135+
These are ready to be used as-is with the EVM boards.
136+
For customization, it's possible to rebuild them.
145137

146-
- See :ref:`android-build-kernel` for the kernel
147-
- See :ref:`android-build-bootloaders` for the bootloaders
138+
- See :ref:`android-build-kernel` for the kernel
139+
- See :ref:`android-build-bootloaders` for the bootloaders
148140

149141
.. ifconfig:: CONFIG_part_variant in ('AM62X')
150142

0 commit comments

Comments
 (0)