Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
261 changes: 216 additions & 45 deletions source/linux/How_to_Guides/Target/How_to_boot_quickly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

Software environment
^^^^^^^^^^^^^^^^^^^^
This guide uses 10.0 Processor SDK as reference.
This guide uses Processor SDK and MCU+SDK as reference.

Check warning on line 29 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'MCU') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message": "[RedHat.Definitions] Define acronyms and abbreviations (such as 'MCU') on first occurrence if they're likely to be unfamiliar.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 29, "column": 35}}}, "severity": "INFO"}

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

Expand Down Expand Up @@ -135,7 +135,7 @@

.. ifconfig:: CONFIG_part_variant in ('AM62PX')

You can track current performance numbers here: `AM62PX <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/11_01_01_08/exports/docs/api_guide_am62px/DATASHEET_AM62PX_EVM.html#autotoc_md119>`_
You can track current performance numbers here: `AM62PX <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/12_00_00_27/exports/docs/api_guide_am62px/DATASHEET_AM62PX_EVM.html#autotoc_md119>`_


- Flashing binaries:
Expand All @@ -158,7 +158,7 @@

.. ifconfig:: CONFIG_part_variant in ('AM62PX')

- `UART flashing tool AM62PX <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/11_01_01_08/exports/docs/api_guide_am62px/TOOLS_FLASH.html>`_
- `UART flashing tool AM62PX <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/12_00_00_27/exports/docs/api_guide_am62px/TOOLS_FLASH.html>`_

- U-Boot eMMC flashing tool AM62PX: :ref:`u-boot-build-guide-environment-k3`

Expand All @@ -176,7 +176,7 @@

.. ifconfig:: CONFIG_part_variant in ('AM62PX')

The following section will reference `AM62PX MCU+ SDK's SBL examples <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/11_01_01_08/exports/docs/api_guide_am62px/EXAMPLES_DRIVERS_SBL.html>`_.
The following section will reference `AM62PX MCU+ SDK's SBL examples <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/12_00_00_27/exports/docs/api_guide_am62px/EXAMPLES_DRIVERS_SBL.html>`_.

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

Expand All @@ -188,7 +188,7 @@

.. ifconfig:: CONFIG_part_variant in ('AM62PX')

- `AM62PX Falcon Mode <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/11_01_01_08/exports/docs/api_guide_am62px/TOOLS_BOOT.html#LINUX_APPIMAGE_GEN_TOOL>`_
- `AM62PX Falcon Mode <https://software-dl.ti.com/mcu-plus-sdk/esd/AM62PX/12_00_00_27/exports/docs/api_guide_am62px/TOOLS_BOOT.html#LINUX_APPIMAGE_GEN_TOOL>`_

- Removing unnecessary prints

Expand Down Expand Up @@ -305,7 +305,85 @@
Reducing userspace boot time
----------------------------

It is recommended to use a tiny intermediate filesystem that can be used to run applications early with minimal configuration and then mount into a filesystem with full functionality. For this purpose, the installer packages a filesystem: :file:`<PSDK_PATH>/filesystem/<machine>/tisdk-tiny-initramfs-am62xx-evm.cpio` that can be used as an initramfs.
Use a tiny filesystem to run applications early with minimal configuration. You can build a custom minimal tisdk-tiny-initramfs using Yocto.

Building custom tiny initramfs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. note::

For detailed instructions on setting up the Yocto build environment, see :ref:`building-the-sdk-with-yocto`.

To build the sysvinit based :file:`tisdk-tiny-initramfs-am62xx-evm.cpio` using Yocto, follow these steps:

Check warning on line 317 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'sysvinit'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'sysvinit'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 317, "column": 14}}}, "severity": "WARNING"}

1. Clone and setup the Yocto environment:

.. code-block:: console

$ git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
$ cd tisdk
$ ./oe-layertool-setup.sh -f configs/processor-sdk/<oeconfig-file>

Check warning on line 325 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.UserReplacedValues] Separate words by underscores in user-replaced values. Raw Output: {"message": "[RedHat.UserReplacedValues] Separate words by underscores in user-replaced values.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 325, "column": 60}}}, "severity": "INFO"}

2. Configure local.conf to use sysvinit instead of systemd:

Check warning on line 327 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'sysvinit'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'sysvinit'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 327, "column": 32}}}, "severity": "WARNING"}

.. code-block:: console

$ cd build
$ echo 'DISTRO_FEATURES:append = " sysvinit"' >> conf/local.conf
$ echo 'DISTRO_FEATURES:remove = "systemd"' >> conf/local.conf
$ echo 'ARAGO_SYSVINIT = "1"' >> conf/local.conf

3. Apply recipe changes in meta-tisdk:

.. code-block:: console

$ cd ../sources/meta-tisdk

Apply the following diff to :file:`meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb`

Check warning on line 342 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Slash] Use either 'or' or 'and' in 'core/images' Raw Output: {"message": "[RedHat.Slash] Use either 'or' or 'and' in 'core/images'", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 342, "column": 69}}}, "severity": "WARNING"}

Check warning on line 342 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Slash] Use either 'or' or 'and' in 'foundational/recipes' Raw Output: {"message": "[RedHat.Slash] Use either 'or' or 'and' in 'foundational/recipes'", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 342, "column": 48}}}, "severity": "WARNING"}

.. code-block:: diff

diff --git a/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb b/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
index 232b734..a76d5f6 100644
--- a/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
+++ b/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
@@ -16,17 +16,6 @@ PACKAGE_INSTALL = " \
base-files \
base-passwd \
busybox \
- netbase \
- shadow-base \
- update-alternatives-opkg \
- parted \
- util-linux \
- e2fsprogs \
- dosfstools \
- mmc-utils \
- tar \
- gzip \
- xz \
- wget \
- dropbear \
+ sysvinit \
+ initscripts \
"

4. Setup build environment and build the custom initramfs:

.. code-block:: console

$ cd ../../build
$ . conf/setenv
$ MACHINE=am62xx-evm bitbake -k tisdk-tiny-initramfs

.. note::

Since this is only a ramfs image, the MACHINE value does not significantly matter here.

Check warning on line 381 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'ramfs'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'ramfs'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 381, "column": 26}}}, "severity": "WARNING"}

The built cpio file will be available in the deploy-ti directory: :file:`deploy-ti/images/<machine>/tisdk-tiny-initramfs-<machine>.cpio` and you can use it as described in the following sections.

Check warning on line 383 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Slash] Use either 'or' or 'and' in 'ti/images' Raw Output: {"message": "[RedHat.Slash] Use either 'or' or 'and' in 'ti/images'", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 383, "column": 81}}}, "severity": "WARNING"}

Check warning on line 383 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Spelling] Verify the word 'cpio'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale. Raw Output: {"message": "[RedHat.Spelling] Verify the word 'cpio'. It is not in the American English or Red Hat terminology spelling dictionaries used by Vale.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 383, "column": 11}}}, "severity": "WARNING"}

Check warning on line 383 in source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.SentenceLength] Try to keep sentences to an average of 32 words or fewer. Raw Output: {"message": "[RedHat.SentenceLength] Try to keep sentences to an average of 32 words or fewer.", "location": {"path": "source/linux/How_to_Guides/Target/How_to_boot_quickly.rst", "range": {"start": {"line": 383, "column": 1}}}, "severity": "INFO"}

Optimizing the Filesystem
^^^^^^^^^^^^^^^^^^^^^^^^^^

In order to package the filesystem as initramfs into the kernel, follow these steps:

Expand All @@ -317,16 +395,15 @@
$ cd output
$ cpio -idv < tisdk-tiny-initramfs-am62xx-evm.cpio


2. Edit the kernel config:

.config:
Edit .config file directly:

.. code-block:: kconfig

CONFIG_INITRAMFS_SOURCE="/path/to/filesystem"

or using :code:`menuconfig`:
or using :code:`menuconfig` and generate new .config:

.. code-block:: kconfig

Expand All @@ -335,7 +412,9 @@
General setup ->
Initial RAM filesystem and RAM disk (initramfs/initrd) support ->
Initramfs source file(s)
/path/to/filesystem
/path/to/filesystem or cpio file

Both cpio or filesystem path can be passed to "Initramfs source file". If providing a filesystem path directly, ensure required files and folders are executable. example :file:`/sbin/init` or :file:`/usr/bin/modetest`.

3. Rebuild the kernel

Expand All @@ -355,9 +434,9 @@

host$ rm <filesystem>/etc/rc5.d/*
host$ cd <filesystem>/etc/rcS.d
host$ rm S02banner.sh S04udev S05checkroot.sh S06modutils.sh S07bootlogd S29read-only-rootfs-hook.sh S36bootmisc.sh S37populate-volatile.sh S38dmesg.sh S38urandom
host$ rm S02banner.sh S05checkroot.sh S07bootlogd S29read-only-rootfs-hook.sh S36bootmisc.sh S37populate-volatile.sh S38dmesg.sh S38urandom

This shaves off 1.536s from filesystem boot time. udev alone takes up 1.152s.
This shaves off 1.536s from filesystem boot time.

- Remove package manager, console logo and add /dev/null in the filesystem

Expand All @@ -370,6 +449,63 @@

This removes 52ms from the boot up time.

- Custom Init Script for Maximum Boot Speed

For applications requiring fastest boot time, you can replace the default init system with a custom init script. This approach bypasses sysvinit entirely and provides direct access to the shell while running essential applications in the background. Use this approach if you don't need system services and prefer maximum boot speed over functionality.

Remove the existing :file:`/sbin/init` and create a custom :file:`/sbin/init` script with the following commands:

.. code-block:: sh

#!/bin/sh

mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs dev /dev

# Uncomment to run modetest in the background
# 42 - connector ID
# 40 - CRTC ID
# 1920x1200 - resolution of panel
#(modetest -M tidss -s 42@40:1920x1200 0<&- 2>/tmp/output.log) &

# For sysvinit based flow
# Use either sysvinit or direct shell approach
# exec /sbin/init.sysvinit $*

# Shell - restarts automatically when exited
while true; do
/bin/sh </dev/console >/dev/console 2>&1
done

Make the script executable:

.. code-block:: console

host$ chmod +x <filesystem>/sbin/init

**Considerations:**

- No system services or proper init system functionality.
- Job control is limited (warning message: "can't access tty; job control turned off").
- The shell warning message is harmless and indicates that advanced terminal features are disabled.

- Create symlink from init to sbin/init if it does not exist:

.. code-block:: console

host$ cd <filesystem>
host$ ln -sf /sbin/init init

- Convert file system to cpio file.

.. code-block:: console

host$ cd <filesystem>
host$ find . | sort | cpio --reproducible -o -H newc -R root:root > ../tisdk-tiny-initramfs-new.cpio

Pass the new cpio file during kernel build.

Measurements
------------

Expand Down Expand Up @@ -603,10 +739,10 @@

.. code-block:: console

[2025-12-09 14:29:28.387] NOTICE: BL31: v2.13.0(release):v2.13.0-259-ge0c4d3903
[2025-12-09 14:29:28.387] NOTICE: BL31: Built : 06:45:06, Dec 7 2025
[2025-12-09 14:29:29.107]
[2025-12-09 14:29:29.107] am62xx-evm login:
[2026-04-28 08:17:15.247] NOTICE: BL31: v2.14.0(release):sandbox/v2.14-472-g76500ceae
[2026-04-28 08:17:15.247] NOTICE: BL31: Built : 21:08:02, Apr 15 2026
[2026-04-28 08:17:15.807] /bin/sh: can't access tty; job control turned off
[2026-04-28 08:17:15.807] ~ #

+-----------------+-----------+
| Stage | Time (ms) |
Expand All @@ -615,66 +751,101 @@
+-----------------+-----------+
| ROM | 31 |
+-----------------+-----------+
| SBL | 200 |
| SBL | 214 |
+-----------------+-----------+
| Linux Kernel | 549 |
| Linux Kernel | 523 |
+-----------------+-----------+
| Tiny FS | 171 |
| Tiny FS | 37 |
+-----------------+-----------+
| Total | 966 |
| Total | 820 |
+-----------------+-----------+

Bootloader loads HSM binary (9KB), MCU/DSP image (50KB) and Kernel+FS image (22MB) in the above measurements
Boot loader loads HSM binary (9KB), MCU/DSP image (56KB) and Kernel+FS image (18MB) in the above measurements

.. note::

Filesytem time is measured using minicom time stamp. ( Boot Time via minicom - Kernel time by GPIO = Filesystem Time )

Additional notes
----------------
Additional steps to test early display
--------------------------------------

.. ifconfig:: CONFIG_part_variant in ('AM62X', 'AM62PX')

.. note::

Ensure that you are not affecting your host computer when making the changes detailed below.
For early display with OLDI panel, disable bridge-hdmi or sii9022 node in device tree.
Also use fdtoverlay command to modify dtb file (base tree) with dtbo overlay for OLDI panel.

- This statically compiled :download:`modetest </files/modetest>` can be added to the filesystem to test out display at boot on an OLDI panel.
- For early display with OLDI panel, disable bridge-hdmi or sii9022 node in device tree.

.. code-block:: diff

diff --git a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
index e40abe7afe45..70153e592600 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
@@ -589,6 +589,7 @@ sii9022: bridge-hdmi@3b {
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
#sound-dai-cells = <0>;
sil,i2s-data-lanes = < 0 >;
+ status = "disabled";

- Use fdtoverlay command to modify dtb file (base tree) with dtbo overlay for OLDI panel.

.. code-block:: console

host$ fdtoverlay -v -i k3-am62p5-sk.dtb -o merged.dtb k3-am62p5-sk-microtips-mf101hie-panel.dtbo

- `init` is a symbolic link to /sbin/init. Remove the file sbin/init
Later rename merged.dtb to k3-am62p5-sk.dtb when generating linux.falcon.appimage.hs_fs.

.. code-block:: console
- Add statically compiled :download:`modetest </files/modetest>` to filesystem to test out display at boot on an OLDI panel.

rm <filesystem>/sbin/init
.. code-block:: console

host$ cd <filesystem>
host$ cp ~/Downloads/modetest <filesystem>/usr/bin
host$ chmod +x modetest

- In the new :file:`sbin/init` created earlier, uncomment modetest.

.. code-block:: sh

- Create a new sbin/init and add the following.
#!/bin/sh

.. code-block:: sh
mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs dev /dev

#!/bin/sh
# Run modetest in the background
# 42 - connector ID
# 40 - CRTC ID
# 1920x1200 - resolution of panel
(modetest -M tidss -s 42@40:1920x1200 0<&- 2>/tmp/output.log) &

mount -t proc none /proc
mount -t sysfs none /sys
mount -t devtmpfs dev /dev
# For sysvinit based flow
# Use either sysvinit or direct shell approach
# exec /sbin/init.sysvinit $*

# Run modetest in the background
# 40 - connector ID
# 38 - CRTC ID
# 1920x1200 - resolution of panel
(modetest -M tidss -s 40@38:1920x1200 0<&- 2>/tmp/output.log) &
# Shell - restarts automatically when exited
while true; do
/bin/sh </dev/console >/dev/console 2>&1
done

exec /sbin/init.sysvinit $*
To get the connector ID and CRTC ID of OLDI panel used, run :code:`kmsprint` or :code:`modetest -M tidss`

You can get the connector ID and CRTC ID of your OLDI panel by running :code:`kmsprint` or :code:`modetest -M tidss`
- Make it executable

- Make it executable
.. code-block:: console

$ chmod +x <filesystem>/sbin/init

.. code-block:: console
- Convert file system to cpio file.

.. code-block:: console

chmod +x <filesystem>/sbin/init
host$ cd <filesystem>
host$ find . | sort | cpio --reproducible -o -H newc -R root:root > ../tisdk-tiny-initramfs-new.cpio

Pass the new cpio file during kernel build.

.. ifconfig:: CONFIG_part_variant in ('AM62AX')

Expand Down
Loading