Skip to content

Commit c2b565e

Browse files
committed
feat(linux): Update boot time guide
- Fix RST syntax, formatting issues, links. - Update steps for early display testing and initramfs build. - Improve filesystem setup documentation. - Update boot time values. Signed-off-by: Paresh Bhagat <p-bhagat@ti.com>
1 parent d48e546 commit c2b565e

1 file changed

Lines changed: 216 additions & 45 deletions

File tree

source/linux/How_to_Guides/Target/How_to_boot_quickly.rst

Lines changed: 216 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The objectives of this document are as follows:
2626

2727
Software environment
2828
^^^^^^^^^^^^^^^^^^^^
29-
This guide uses 10.0 Processor SDK as reference.
29+
This guide uses Processor SDK and MCU+SDK as reference.
3030

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

@@ -135,7 +135,7 @@ Reducing bootloader time
135135

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

138-
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>`_
138+
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>`_
139139

140140

141141
- Flashing binaries:
@@ -158,7 +158,7 @@ Reducing bootloader time
158158

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

161-
- `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>`_
161+
- `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>`_
162162

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

@@ -176,7 +176,7 @@ Secondary Boot Loader (SBL)
176176

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

179-
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>`_.
179+
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>`_.
180180

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

@@ -188,7 +188,7 @@ Secondary Boot Loader (SBL)
188188

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

191-
- `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>`_
191+
- `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>`_
192192

193193
- Removing unnecessary prints
194194

@@ -305,7 +305,85 @@ Reducing Linux kernel boot time
305305
Reducing userspace boot time
306306
----------------------------
307307

308-
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.
308+
Use a tiny filesystem to run applications early with minimal configuration. You can build a custom minimal tisdk-tiny-initramfs using Yocto.
309+
310+
Building custom tiny initramfs
311+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
312+
313+
.. note::
314+
315+
For detailed instructions on setting up the Yocto build environment, see :ref:`building-the-sdk-with-yocto`.
316+
317+
To build the sysvinit based :file:`tisdk-tiny-initramfs-am62xx-evm.cpio` using Yocto, follow these steps:
318+
319+
1. Clone and setup the Yocto environment:
320+
321+
.. code-block:: console
322+
323+
$ git clone https://git.ti.com/git/arago-project/oe-layersetup.git tisdk
324+
$ cd tisdk
325+
$ ./oe-layertool-setup.sh -f configs/processor-sdk/<oeconfig-file>
326+
327+
2. Configure local.conf to use sysvinit instead of systemd:
328+
329+
.. code-block:: console
330+
331+
$ cd build
332+
$ echo 'DISTRO_FEATURES:append = " sysvinit"' >> conf/local.conf
333+
$ echo 'DISTRO_FEATURES:remove = "systemd"' >> conf/local.conf
334+
$ echo 'ARAGO_SYSVINIT = "1"' >> conf/local.conf
335+
336+
3. Apply recipe changes in meta-tisdk:
337+
338+
.. code-block:: console
339+
340+
$ cd ../sources/meta-tisdk
341+
342+
Apply the following diff to :file:`meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb`
343+
344+
.. code-block:: diff
345+
346+
diff --git a/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb b/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
347+
index 232b734..a76d5f6 100644
348+
--- a/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
349+
+++ b/meta-ti-foundational/recipes-core/images/tisdk-tiny-initramfs.bb
350+
@@ -16,17 +16,6 @@ PACKAGE_INSTALL = " \
351+
base-files \
352+
base-passwd \
353+
busybox \
354+
- netbase \
355+
- shadow-base \
356+
- update-alternatives-opkg \
357+
- parted \
358+
- util-linux \
359+
- e2fsprogs \
360+
- dosfstools \
361+
- mmc-utils \
362+
- tar \
363+
- gzip \
364+
- xz \
365+
- wget \
366+
- dropbear \
367+
+ sysvinit \
368+
+ initscripts \
369+
"
370+
371+
4. Setup build environment and build the custom initramfs:
372+
373+
.. code-block:: console
374+
375+
$ cd ../../build
376+
$ . conf/setenv
377+
$ MACHINE=am62xx-evm bitbake -k tisdk-tiny-initramfs
378+
379+
.. note::
380+
381+
Since this is only a ramfs image, the MACHINE value does not significantly matter here.
382+
383+
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.
384+
385+
Optimizing the Filesystem
386+
^^^^^^^^^^^^^^^^^^^^^^^^^^
309387

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

@@ -317,16 +395,15 @@ In order to package the filesystem as initramfs into the kernel, follow these st
317395
$ cd output
318396
$ cpio -idv < tisdk-tiny-initramfs-am62xx-evm.cpio
319397
320-
321398
2. Edit the kernel config:
322399

323-
.config:
400+
Edit .config file directly:
324401

325402
.. code-block:: kconfig
326403
327404
CONFIG_INITRAMFS_SOURCE="/path/to/filesystem"
328405
329-
or using :code:`menuconfig`:
406+
or using :code:`menuconfig` and generate new .config:
330407

331408
.. code-block:: kconfig
332409
@@ -335,7 +412,9 @@ In order to package the filesystem as initramfs into the kernel, follow these st
335412
General setup ->
336413
Initial RAM filesystem and RAM disk (initramfs/initrd) support ->
337414
Initramfs source file(s)
338-
/path/to/filesystem
415+
/path/to/filesystem or cpio file
416+
417+
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`.
339418

340419
3. Rebuild the kernel
341420

@@ -355,9 +434,9 @@ The time taken to boot filesystem is measured from Process ID 1(PID1) to login p
355434
356435
host$ rm <filesystem>/etc/rc5.d/*
357436
host$ cd <filesystem>/etc/rcS.d
358-
host$ rm S02banner.sh S04udev S05checkroot.sh S06modutils.sh S07bootlogd S29read-only-rootfs-hook.sh S36bootmisc.sh S37populate-volatile.sh S38dmesg.sh S38urandom
437+
host$ rm S02banner.sh S05checkroot.sh S07bootlogd S29read-only-rootfs-hook.sh S36bootmisc.sh S37populate-volatile.sh S38dmesg.sh S38urandom
359438
360-
This shaves off 1.536s from filesystem boot time. udev alone takes up 1.152s.
439+
This shaves off 1.536s from filesystem boot time.
361440

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

@@ -370,6 +449,63 @@ The time taken to boot filesystem is measured from Process ID 1(PID1) to login p
370449
371450
This removes 52ms from the boot up time.
372451

452+
- Custom Init Script for Maximum Boot Speed
453+
454+
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.
455+
456+
Remove the existing :file:`/sbin/init` and create a custom :file:`/sbin/init` script with the following commands:
457+
458+
.. code-block:: sh
459+
460+
#!/bin/sh
461+
462+
mount -t proc none /proc
463+
mount -t sysfs none /sys
464+
mount -t devtmpfs dev /dev
465+
466+
# Uncomment to run modetest in the background
467+
# 42 - connector ID
468+
# 40 - CRTC ID
469+
# 1920x1200 - resolution of panel
470+
#(modetest -M tidss -s 42@40:1920x1200 0<&- 2>/tmp/output.log) &
471+
472+
# For sysvinit based flow
473+
# Use either sysvinit or direct shell approach
474+
# exec /sbin/init.sysvinit $*
475+
476+
# Shell - restarts automatically when exited
477+
while true; do
478+
/bin/sh </dev/console >/dev/console 2>&1
479+
done
480+
481+
Make the script executable:
482+
483+
.. code-block:: console
484+
485+
host$ chmod +x <filesystem>/sbin/init
486+
487+
**Considerations:**
488+
489+
- No system services or proper init system functionality.
490+
- Job control is limited (warning message: "can't access tty; job control turned off").
491+
- The shell warning message is harmless and indicates that advanced terminal features are disabled.
492+
493+
- Create symlink from init to sbin/init if it does not exist:
494+
495+
.. code-block:: console
496+
497+
host$ cd <filesystem>
498+
host$ ln -sf /sbin/init init
499+
500+
- Convert file system to cpio file.
501+
502+
.. code-block:: console
503+
504+
host$ cd <filesystem>
505+
host$ find . | sort | cpio --reproducible -o -H newc -R root:root > ../tisdk-tiny-initramfs-new.cpio
506+
507+
Pass the new cpio file during kernel build.
508+
373509
Measurements
374510
------------
375511

@@ -603,10 +739,10 @@ To measure the instance when the filesystem starts, navigate to :file:`init/main
603739

604740
.. code-block:: console
605741
606-
[2025-12-09 14:29:28.387] NOTICE: BL31: v2.13.0(release):v2.13.0-259-ge0c4d3903
607-
[2025-12-09 14:29:28.387] NOTICE: BL31: Built : 06:45:06, Dec 7 2025
608-
[2025-12-09 14:29:29.107]
609-
[2025-12-09 14:29:29.107] am62xx-evm login:
742+
[2026-04-28 08:17:15.247] NOTICE: BL31: v2.14.0(release):sandbox/v2.14-472-g76500ceae
743+
[2026-04-28 08:17:15.247] NOTICE: BL31: Built : 21:08:02, Apr 15 2026
744+
[2026-04-28 08:17:15.807] /bin/sh: can't access tty; job control turned off
745+
[2026-04-28 08:17:15.807] ~ #
610746
611747
+-----------------+-----------+
612748
| Stage | Time (ms) |
@@ -615,66 +751,101 @@ To measure the instance when the filesystem starts, navigate to :file:`init/main
615751
+-----------------+-----------+
616752
| ROM | 31 |
617753
+-----------------+-----------+
618-
| SBL | 200 |
754+
| SBL | 214 |
619755
+-----------------+-----------+
620-
| Linux Kernel | 549 |
756+
| Linux Kernel | 523 |
621757
+-----------------+-----------+
622-
| Tiny FS | 171 |
758+
| Tiny FS | 37 |
623759
+-----------------+-----------+
624-
| Total | 966 |
760+
| Total | 820 |
625761
+-----------------+-----------+
626762

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

629765
.. note::
630766

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

633-
Additional notes
634-
----------------
769+
Additional steps to test early display
770+
--------------------------------------
635771

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

638774
.. note::
639775

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

644-
- This statically compiled :download:`modetest </files/modetest>` can be added to the filesystem to test out display at boot on an OLDI panel.
778+
- For early display with OLDI panel, disable bridge-hdmi or sii9022 node in device tree.
779+
780+
.. code-block:: diff
781+
782+
diff --git a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
783+
index e40abe7afe45..70153e592600 100644
784+
--- a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
785+
+++ b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts
786+
@@ -589,6 +589,7 @@ sii9022: bridge-hdmi@3b {
787+
interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
788+
#sound-dai-cells = <0>;
789+
sil,i2s-data-lanes = < 0 >;
790+
+ status = "disabled";
791+
792+
- Use fdtoverlay command to modify dtb file (base tree) with dtbo overlay for OLDI panel.
793+
794+
.. code-block:: console
795+
796+
host$ fdtoverlay -v -i k3-am62p5-sk.dtb -o merged.dtb k3-am62p5-sk-microtips-mf101hie-panel.dtbo
645797
646-
- `init` is a symbolic link to /sbin/init. Remove the file sbin/init
798+
Later rename merged.dtb to k3-am62p5-sk.dtb when generating linux.falcon.appimage.hs_fs.
647799

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

650-
rm <filesystem>/sbin/init
802+
.. code-block:: console
803+
804+
host$ cd <filesystem>
805+
host$ cp ~/Downloads/modetest <filesystem>/usr/bin
806+
host$ chmod +x modetest
807+
808+
- In the new :file:`sbin/init` created earlier, uncomment modetest.
809+
810+
.. code-block:: sh
651811
652-
- Create a new sbin/init and add the following.
812+
#!/bin/sh
653813
654-
.. code-block:: sh
814+
mount -t proc none /proc
815+
mount -t sysfs none /sys
816+
mount -t devtmpfs dev /dev
655817
656-
#!/bin/sh
818+
# Run modetest in the background
819+
# 42 - connector ID
820+
# 40 - CRTC ID
821+
# 1920x1200 - resolution of panel
822+
(modetest -M tidss -s 42@40:1920x1200 0<&- 2>/tmp/output.log) &
657823
658-
mount -t proc none /proc
659-
mount -t sysfs none /sys
660-
mount -t devtmpfs dev /dev
824+
# For sysvinit based flow
825+
# Use either sysvinit or direct shell approach
826+
# exec /sbin/init.sysvinit $*
661827
662-
# Run modetest in the background
663-
# 40 - connector ID
664-
# 38 - CRTC ID
665-
# 1920x1200 - resolution of panel
666-
(modetest -M tidss -s 40@38:1920x1200 0<&- 2>/tmp/output.log) &
828+
# Shell - restarts automatically when exited
829+
while true; do
830+
/bin/sh </dev/console >/dev/console 2>&1
831+
done
667832
668-
exec /sbin/init.sysvinit $*
833+
To get the connector ID and CRTC ID of OLDI panel used, run :code:`kmsprint` or :code:`modetest -M tidss`
669834

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

672-
- Make it executable
837+
.. code-block:: console
838+
839+
$ chmod +x <filesystem>/sbin/init
673840
674-
.. code-block:: console
841+
- Convert file system to cpio file.
842+
843+
.. code-block:: console
675844
676-
chmod +x <filesystem>/sbin/init
845+
host$ cd <filesystem>
846+
host$ find . | sort | cpio --reproducible -o -H newc -R root:root > ../tisdk-tiny-initramfs-new.cpio
677847
848+
Pass the new cpio file during kernel build.
678849

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

0 commit comments

Comments
 (0)