This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] AM62P:Linux 启动时间优化。

Guru**** 2796425 points

Other Parts Discussed in Thread: AM62P

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1622908/am62p-linux-boot-time-optimization

部件号: AM62P

您好 TI 专家、

我的目标是将 Linux 启动时间减少到 5 秒以内。
我的设置
1.从 SD 卡引导。
2.猎鹰模式 Linux
3.将操作系统大小缩减至 1.5 GB 以下
4.禁用内核日志(通过 menuconfig ), systemd 日志(通过编辑/etc/systemd/system.conf 和/etc/systemd/journald.conf )也禁用了一些不再需要的服务。
5.使用 initramfs 与此 链接中提到的优化

通过上述设置、我实现了以下目标。
1.从上面的设置中,如果排除第 5 点,那么我在 Linux 中使用 falcon 模式的引导时间最长为 8 秒。
2.但按照上述优化使用 initramfs 后,有如下观察结果:
   i.我已附加了在使用以下/sbin/init 时无法登录到操作系统的引导日志

#!/bin/sh

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

# 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) &

exec /sbin/init.sysvinit $*
U-Boot SPL 2025.01-00766-g7493977a537f (Dec 03 2025 - 15:20:36 +0000)
SYSFW ABI: 4.0 (firmware rev 0x000b '11.2.5--v11.02.05 (Fancy Rat)')
Set clock rates for '/a53@0', CPU: 1250MHz at Speed Grade 'U'
SPL initial stack usage: 17104 bytes
Trying to boot from MMC2
Authentication passed
Loading falcon payload from MMC2
Authentication passed
Authentication passed
Loading Environment from nowhere... OK
Authentication passed
Authentication passed
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.13.0(release):v2.13.0-259-ge0c4d3903b-dirty
NOTICE:  BL31: Built : 07:01:36, Jul  1 2025

am62xx-evm login: root
login
am62xx-evm login: root
login
am62xx-evm login: 

   二.对于成功引导和 logginf、我已经在/sbin/init 文件和日志下面附加了

#!/bin/sh

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

sleep 5

mount -t devtmpfs  dev  /dev

ls /dev/ >> /tmp/log 2>&1
echo "ls dev" $? >> /dev/ttyS2

ls /dev/mmcblk1p2 >> /tmp/log 2>&1

mount /dev/mmcblk1p2 /mnt/
echo "Mount FS:" $? >> /dev/ttyS2

umount /proc
umount /sys

exec switch_root /mnt/ /sbin/init
U-Boot SPL 2025.01-gfca559b2ded2-dirty (Mar 04 2026 - 18:54:53 +0530)
SYSFW ABI: 4.0 (firmware rev 0x000b '11.2.5--v11.02.05 (Fancy Rat)')
Set clock rates for '/a53@0', CPU: 1250MHz at Speed Grade 'U'
SPL initial stack usage: 17104 bytes
Trying to boot from MMC2
Authentication passed
Loading falcon payload from MMC2
Authentication passed
Authentication passed
Loading Environment from nowhere... OK
Authentication passed
Authentication passed
Starting ATF on ARM64 core...

NOTICE:  BL31: v2.14.0(release):sandbox/v2.14-499-g7a22051c1
NOTICE:  BL31: Built : 12:23:51, Feb 10 2026
I/TC: 
I/TC: OP-TEE version: 4.9.0-22-ge9eaf44aa (gcc version 13.3.1 20240614 (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))) #1 Tue Feb 10 06:54:31 UTC 2026 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check optee.readthedocs.io/.../porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 4.0 (firmware rev 0x000b '11.2.5--v11.02.05 (Fancy Rat)')
I/TC: HUK Initialized
I/TC: Disabling output console
ls dev 0
Mount FS: 0

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project am62pxx-evm ttyS2

Arago 2025.01 am62pxx-evm ttyS2

am62pxx-evm login: root
root@am62pxx-evm:~#
  1. 现在根据上述观察结果。 TI SDK 中提供的/sbin/init 为何无法正常工作。
  2. 修改后的/sbin/init 的引导时间也会增加到 13 秒。 但是、当使用 initramfs 进行引导时、预计不会发生这种情况、为什么会发生这种情况呢?

请说明上述情况并帮助我们优化启动时间
还将指导我们使用标准引导还是 Falcon 引导 for Linux?

此致、
Aditya T