Other Parts Discussed in Thread:TPS65910
u-boot版本:u-boot-2013.01.01-psp06.00.00.00
Kernel版本:linux-3.2.0-psp04.06.00.11
文件系统版本:arago-base-tisdk-image-am335x-evm
文件系统格式:ubi
CPU型号:AM3352BZCZ60
板子是自己公司设计的一款产品,带LCD;系统是根据上述的软件版本进行移植;系统没优化前,从nand启动时间约为30s,系统优化后,从nand启动时间在22s内;公司要求的启动时间在12s内;已无对策!在此拜托论坛给位前辈,坛友给出出主意
—————————————————————————————————————-
优化原则:
1、保留MMC功能
2、保留网络相关功能
3、保留USB相关功能
————————————-
目前的优化方法
参考了《Sitara Linux Training- Boot Time Reduction》、《Optimize Linux Boot Time》、《sitara_boot_camp_optimizing_linux_boot_time》
u-boot:
1、#undef CONFIG_SYS_LONGHELP
2、#define CONFIG_BOOTDELAY 0
3、采用默认环境变量,即不从nand读取
4、在SPL阶段,根据kernel的长度,从nand读取kernel镜像到0x80200000
5、不进行checksum
6、去掉一些不必要的初始化
u-boot.img大小从472KB减小到458KB
———————-
kernel:
1、修改menuconfig,取消不用的文件系统,如debug filesystem、DOS/FAT/NT filesystem
2、修改menuconfig,取消不用的驱动,如SCSI、SPI、CAN
3、修改内核源码,屏蔽到多余的hwmod,如uart,spi,i2c等
uImage大小从2745KB减小到2461KB
———————
filesystem:
基于arago-base-tisdk-image-am335x-evm制作的ubi格式,无法修改
——————————————
优化后的启动日志
[10:44:11:617]CCCCCCCC
[10:44:11:617]U-Boot SPL 2013.01.01 (Oct 26 2015 – 16:52:18)
[10:44:11:761]
[10:44:11:762]>>SPL CORE PLL:OPP100.
[10:44:11:777]>>SPL MPU PLL:550MHz.
[10:44:11:831]musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[10:44:11:832]musb-hdrc: MHDRC RTL version 2.0[10:44:11:832]musb-hdrc: setup fifo_mode 4
[10:44:11:832]musb-hdrc: 28/31 max ep, 16384/16384 memory
[10:44:11:832]USB Peripheral mode controller at 47401000 using PIO, IRQ 0
[10:44:11:833]musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, bulk combine, bulk split, HB-ISO Rx, HB-ISO Tx, SoftConn)
[10:44:11:833]musb-hdrc: MHDRC RTL version 2.0[10:44:11:834]musb-hdrc: setup fifo_mode 4
[10:44:11:834]musb-hdrc: 28/31 max ep, 16384/16384 memory
[10:44:11:836]USB Host mode controller at 47401800 using PIO, IRQ 0
[10:44:15:467]
[10:44:15:467]
[10:44:15:467]U-Boot 2013.01.01 (Oct 26 2015 – 21:16:27)
[10:44:15:467]
[10:44:15:531]I2C: ready
[10:44:15:531]PWM: Ready
[10:44:15:531]DRAM: 256 MiB
[10:44:15:771]WARNING: Caches not enabled
[10:44:15:841]NAND: 512 MiB
[10:44:15:841]MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
[10:44:15:841]*** Warning – readenv() failed, using default environment
[10:44:15:841]
[10:44:17:472]mmc_send_cmd : timeout: No status update
[10:44:17:472]Card did not respond to voltage select!
[10:44:17:472]Booting from nand …
[10:44:17:472]## Booting kernel from Legacy Image at 80200000 …
[10:44:17:473] Image Name: Linux-3.2.0
[10:44:17:473] Image Type: ARM Linux Kernel Image (uncompressed)
[10:44:17:476] Data Size: 2519120 Bytes = 2.4 MiB
[10:44:17:476] Load Address: 80008000
[10:44:17:476] Entry Point: 80008000
[10:44:18:710] Loading Kernel Image … OK
[10:44:18:742]OK
[10:44:18:742]
[10:44:18:742]Starting kernel …
[10:44:18:743]
[10:44:19:318]Uncompressing Linux… done, booting the kernel.
[10:44:19:924]Linux version 3.2.0 (root@gones-vm) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 – Linaro GCC 2013.03) ) #18 Tue Oct 27 10:34:31 CST 2015
[10:44:19:926]CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[10:44:19:927]CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[10:44:19:927]Machine: am335xevm
[10:44:19:927]Memory policy: ECC disabled, Data cache writeback
[10:44:19:927]AM335X ES2.1 (neon )
[10:44:19:928]Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
[10:44:19:928]Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=7,2048 rootfstype=ubifs rootwait=1
[10:44:19:929]PID hash table entries: 1024 (order: 0, 4096 bytes)
[10:44:19:929]Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[10:44:19:929]Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[10:44:19:929]Memory: 256MB = 256MB total
[10:44:19:930]Memory: 254700k/254700k available, 7444k reserved, 0K highmem
[10:44:19:930]Virtual kernel memory layout:
[10:44:19:930] vector : 0xffff0000 – 0xffff1000 ( 4 kB)
[10:44:19:930] fixmap : 0xfff00000 – 0xfffe0000 ( 896 kB)
[10:44:19:931] vmalloc : 0xd0800000 – 0xff000000 ( 744 MB)
[10:44:19:931] lowmem : 0xc0000000 – 0xd0000000 ( 256 MB)
[10:44:19:931] modules : 0xbf000000 – 0xc0000000 ( 16 MB)
[10:44:19:931] .text : 0xc0008000 – 0xc0466000 (4472 kB)
[10:44:19:932] .init : 0xc0466000 – 0xc0495000 ( 188 kB)
[10:44:19:932] .data : 0xc0496000 – 0xc04e5080 ( 317 kB)
[10:44:19:932] .bss : 0xc04e50a4 – 0xc05085e8 ( 142 kB)
[10:44:19:932]NR_IRQS:396
[10:44:19:933]IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[10:44:19:933]Total of 128 interrupts on 1 active controller
[10:44:19:933]OMAP clockevent source: GPTIMER2 at 24000000 Hz
[10:44:19:934]omap_dm_timer_switch_src: Switching to HW default clocksource(sys_clkin_ck) for timer1, this may impact timekeeping in low power state
[10:44:19:934]OMAP clocksource: GPTIMER1 at 24000000 Hz
[10:44:19:934]sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956ms
[10:44:19:934]Console: colour dummy device 80×30
[10:44:19:935]Calibrating delay loop… 548.86 BogoMIPS (lpj=2744320)
[10:44:19:935]pid_max: default: 32768 minimum: 301
[10:44:19:935]Security Framework initialized
[10:44:19:935]Mount-cache hash table entries: 512
[10:44:19:936]CPU: Testing write buffer coherency: ok
[10:44:19:936]omap_hwmod: gfx: failed to hardreset
[10:44:19:936]omap_hwmod: pruss: failed to hardreset
[10:44:19:937]print_constraints: dummy:[10:44:19:937]NET: Registered protocol family 16
[10:44:19:938]OMAP GPIO hardware version 0.1
[10:44:19:938]omap_mux_init: Add partition: #1: core, flags: 0
[10:44:19:939] omap_i2c.1: alias fck already exists
[10:44:19:939] edma.0: alias fck already exists
[10:44:19:939] edma.0: alias fck already exists
[10:44:19:942] edma.0: alias fck already exists
[10:44:19:942]bio: create slab <bio-0> at 0
[10:44:19:942]omap_i2c omap_i2c.1: bus 1 rev2.4.0 at 100 kHz
[10:44:19:942]tps65910 1-002d: JTAGREVNUM 0x0
[10:44:19:943]print_constraints: VRTC:[10:44:19:943]print_constraints: VIO: at 1500 mV[10:44:19:943]print_constraints: VDD1: 600 <–> 1500 mV at 1262 mV normal[10:44:19:943]print_constraints: VDD2: 600 <–> 1500 mV at 1137 mV normal[10:44:19:944]print_constraints: VDD3: 5000 mV[10:44:19:944]print_constraints: VDIG1: at 1800 mV[10:44:19:944]print_constraints: VDIG2: at 1800 mV[10:44:19:944]print_constraints: VPLL: at 1800 mV[10:44:19:945]print_constraints: VDAC: at 1800 mV[10:44:19:945]print_constraints: VAUX1: at 1800 mV[10:44:19:945]print_constraints: VAUX2: at 3300 mV[10:44:19:945]print_constraints: VAUX33: at 3300 mV[10:44:19:946]print_constraints: VMMC: at 3300 mV[10:44:19:946]tps65910 1-002d: No interrupt support, no core IRQ
[10:44:19:946]Switching to clocksource gp timer
[10:44:19:946]NET: Registered protocol family 2
[10:44:19:947]IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[10:44:19:947]TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[10:44:19:947]TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[10:44:19:947]TCP: Hash tables configured (established 8192 bind 8192)
[10:44:19:948]TCP reno registered
[10:44:19:948]UDP hash table entries: 256 (order: 0, 4096 bytes)
[10:44:19:948]UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[10:44:19:948]NET: Registered protocol family 1
[10:44:19:949]RPC: Registered named UNIX socket transport module.
[10:44:19:949]RPC: Registered udp transport module.
[10:44:19:949]RPC: Registered tcp transport module.
[10:44:19:949]RPC: Registered tcp NFSv4.1 backchannel transport module.
[10:44:19:950]NetWinder Floating Point Emulator V0.97 (double precision)
[10:44:19:950]VFS: Disk quotas dquot_6.5.2
[10:44:19:950]Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[10:44:19:952]msgmni has been set to 497
[10:44:19:971]alg: No test for stdrng (krng)
[10:44:19:971]io scheduler noop registered
[10:44:19:971]io scheduler deadline registered
[10:44:19:971]io scheduler cfq registered (default)
[10:44:19:971]Could not set LED4 to fully on
[10:44:19:972]omap_uart.0: ttyO0 at MMIO 0x44e09000 (irq = 72) is a OMAP UART0
[10:44:19:973]console [ttyO0] enabled
[10:44:19:980]omap_uart.1: ttyO1 at MMIO 0x48022000 (irq = 73) is a OMAP UART1
[10:44:19:980]omap4_rng omap4_rng: OMAP4 Random Number Generator ver. 2.00
[10:44:20:035]brd: module loaded
[10:44:20:035]loop: module loaded
[10:44:20:036]i2c-core: driver [tsl2550] using legacy suspend method
[10:44:20:036]i2c-core: driver [tsl2550] using legacy resume method
[10:44:20:036]at24 1-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
[10:44:20:036]We have skiped the EEPROM
[10:44:20:037]Board name: A335X_SK
[10:44:20:037]Board version:[10:44:20:038]The board is a AM335x Starter Kit.
[10:44:20:038] omap_hsmmc.0: alias fck already exists
[10:44:20:040]Configure user gpio…
[10:44:20:051] da8xx_lcdc.0: alias fck already exists
[10:44:20:052]da8xx_lcdc da8xx_lcdc.0: GLCD: Found NHD-4.3-ATXI#-T-1 panel
[10:44:20:058]Console: switching to colour frame buffer device 100×37
[10:44:20:156]omap-gpmc omap-gpmc: GPMC revision 6.0
[10:44:20:156]Registering NAND on CS0
[10:44:20:157]Register matrix keypad (5×8) Device
[10:44:20:157]registered am33xx_sr device
[10:44:20:157]mtdoops: mtd device (mtddev=name/number) must be supplied
[10:44:20:157]omap2-nand driver initializing
[10:44:20:158]ONFI flash detected
[10:44:20:158]ONFI param page 0 valid
[10:44:20:158]NAND device: Manufacturer ID: 0x2c, Chip ID: 0xdc (Micron MT29F4G08ABADAWP)
[10:44:20:159]Creating 8 MTD partitions on "omap2-nand.0":
[10:44:20:159]0x000000000000-0x000000020000 : "SPL"
[10:44:20:159]0x000000020000-0x000000040000 : "SPL.backup1"
[10:44:20:159]0x000000040000-0x000000060000 : "SPL.backup2"
[10:44:20:160]0x000000060000-0x000000080000 : "SPL.backup3"
[10:44:20:161]0x000000080000-0x000000260000 : "U-Boot"
[10:44:20:169]0x000000260000-0x000000280000 : "U-Boot Env"
[10:44:20:170]0x000000280000-0x000000780000 : "Kernel"
[10:44:20:171]0x000000780000-0x000020000000 : "File System"
[10:44:20:393]UBI: attaching mtd7 to ubi0
[10:44:20:394]UBI: physical eraseblock size: 131072 bytes (128 KiB)
[10:44:20:394]UBI: logical eraseblock size: 126976 bytes
[10:44:20:394]UBI: smallest flash I/O unit: 2048
[10:44:20:395]UBI: VID header offset: 2048 (aligned 2048)
[10:44:20:401]UBI: data offset: 4096
[10:44:24:729]UBI: max. sequence number: 416
[10:44:24:964]UBI: attached mtd7 to ubi0
[10:44:24:965]UBI: MTD device name: "File System"
[10:44:24:965]UBI: MTD device size: 504 MiB
[10:44:24:965]UBI: number of good PEBs: 4036
[10:44:24:965]UBI: number of bad PEBs: 0
[10:44:24:966]UBI: number of corrupted PEBs: 0
[10:44:24:966]UBI: max. allowed volumes: 128
[10:44:24:966]UBI: wear-leveling threshold: 4096
[10:44:24:966]UBI: number of internal volumes: 1
[10:44:24:967]UBI: number of user volumes: 1
[10:44:24:967]UBI: available PEBs: 0
[10:44:24:967]UBI: total number of reserved PEBs: 4036
[10:44:24:967]UBI: number of PEBs reserved for bad PEB handling: 40
[10:44:24:967]UBI: max/mean erase counter: 2/1
[10:44:24:968]UBI: image sequence number: 171284200
[10:44:24:968]UBI: background thread "ubi_bgt0d" started, PID 476
[10:44:24:969]mousedev: PS/2 mouse device common for all mice
[10:44:24:969]input: matrix-keypad as /devices/platform/matrix-keypad/input/input0
[10:44:24:969]input: ti-tsc as /devices/platform/omap/ti_tscadc/tsc/input/input1
[10:44:24:970]rtc-pcf8563 1-0051: chip found, driver version 0.4.3
[10:44:24:970]rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0
[10:44:24:970]i2c /dev entries driver
[10:44:24:970]Linux video capture interface: v2.00
[10:44:24:971]OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
[10:44:24:971]cpuidle: using governor ladder
[10:44:24:971]cpuidle: using governor menu
[10:44:24:971]tiadc tiadc: attached adc driver
[10:44:24:972]oprofile: hardware counters not available
[10:44:24:972]oprofile: using timer interrupt.
[10:44:24:973]nf_conntrack version 0.5.0 (3979 buckets, 15916 max)
[10:44:24:973]ip_tables: (C) 2000-2006 Netfilter Core Team
[10:44:24:973]TCP cubic registered
[10:44:24:973]NET: Registered protocol family 17
[10:44:24:974]Registering the dns_resolver key type
[10:44:24:974]VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[10:44:24:974]ThumbEE CPU extension supported.
[10:44:24:974]mux: Failed to setup hwmod io irq -22
[10:44:24:975]Power Management for AM33XX family
[10:44:24:975]Trying to load am335x-pm-firmware.bin (60 secs timeout)
[10:44:24:975]Copied the M3 firmware to UMEM
[10:44:24:975]Cortex M3 Firmware Version = 0x181
[10:44:24:976]smartreflex smartreflex: am33xx_sr_probe: Driver initialized
[10:44:24:976]clock: disabling unused clocks to save power
[10:44:24:976]Disabling unused clock "wdt0_fck"
[10:44:24:978]Disabling unused clock "spi0_fck"
[10:44:24:986]Disabling unused clock "rtc_fck"
[10:44:24:989]Disabling unused clock "i2c2_fck"
[10:44:24:997]rtc-pcf8563 1-0051: setting system clock to 2013-07-22 17:15:24 UTC (1374513324)
[10:44:25:060]UBIFS: recovery needed
[10:44:25:281]UBIFS: recovery completed
[10:44:25:282]UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[10:44:25:282]UBIFS: file system size: 505491456 bytes (493644 KiB, 482 MiB, 3981 LEBs)
[10:44:25:282]UBIFS: journal size: 9023488 bytes (8812 KiB, 8 MiB, 72 LEBs)
[10:44:25:283]UBIFS: media format: w4/r0 (latest is w4/r0)
[10:44:25:283]UBIFS: default compressor: lzo
[10:44:25:285]UBIFS: reserved for root: 0 bytes (0 KiB)
[10:44:25:294]VFS: Mounted root (ubifs filesystem) on device 0:11.
[10:44:25:295]Freeing init memory: 188K
[10:44:25:509]INIT: version 2.88 booting
[10:44:26:115]Starting udev
[10:44:29:221]Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
[10:44:29:222]bootlogd.
[10:44:29:633]ALSA: Restoring mixer settings…
[10:44:29:890]Configuring network interfaces… /usr/sbin/alsactl: load_state:1686: No soundcards found…
[10:44:30:005]ifconfig: SIOCGIFFLAGS: No such device
[10:44:30:006]done.
[10:44:30:083]INIT: Entering runlevel: 5
[10:44:30:323]Starting system message bus: dbus.
[10:44:30:372]Starting telnet daemon.
[10:44:30:450]Starting syslogd/klogd: done
[10:44:30:546]Starting thttpd.
[10:44:31:137]Stopping Bootlog daemon: bootlogd.
[10:44:31:186]umount: can't umount /mnt/.psplash: Device or resource busy
[10:44:32:260]
[10:44:32:261] _____ _____ _ _[10:44:32:261]| _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_[10:44:32:261]| | _| .'| . | . | | __| _| . | | | -_| _| _|
[10:44:32:262]|__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|[10:44:32:262] |___| |___|[10:44:32:262]
[10:44:32:262]Arago Project https://www.ti2k.com/wp-content/uploads/ti2k/DeyiSupport_DSP_Main_Page am335x-evm ttyO0
[10:44:32:264]
[10:44:32:278]Arago 2013.05 am335x-evm ttyO0
[10:44:32:279]
—————————————-
即使"optargs=quiet"后,系统启动时间也没明显减小;离目标启动时间还差10来秒;各位前辈、坛友们,不吝赐教!先谢过了
1、在优化原则前提下,还有什么优化方法?
2、在优化原则前提下,系统启动时间最快能到多少?
Gones Guo:
系统启动时间要想控制在12s内,还有其他可选的方案吗?
,
Yaoming Qin:
可以考虑用sd卡启动,这个速度比nand flash快很多
,
Gones Guo:
目前产品规划,打算从nand flash启动;其实我想请教的是,以我目前现在的情况
1、从nand启动最快可以到多少时间(凭您的经验);
2、u-boot、kernel、文件系统还有进一步优化的空间吗?
,
user1267653:
我认为可以到达你要的12s;
从ubifs 改成 yaffs2 可以减少到 15s; 我们有1G的nandflash;改成YAFFS2 从14减少到 3s;
分boot分区100M做启动分区;里面只有文件系统;启动时间更少;启动后再挂载data分区;这样可以再节省5s