在內核目錄下,使用menuconfig去裁剪內核,配置裁剪內核:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
然後覆蓋以前的配置文件:
cp .config arch/arm64/configs/hi3559av100_arm64_big_little_emmc_defconfig -f
最後單獨編譯內核:
make BOOT_MEDIA=emmc AMP_TYPE=linux atf
uboot配置參數:
正常情況下:
setenv bootargs 'mem=512M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=yaffs2 mtdparts=hinand:1M(boot),9M(kernel),16M(rootfs)'
setenv bootcmd 'nand read 0x44000000 0x100000 0x900000;bootm 0x44000000'
添加 quite 去掉內核在串口的打印:
setenv bootargs 'mem=512M quiet console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)'
在串口打印前面實時輸出各模塊耗時情況,但是不建議用這個:
setenv bootargs 'mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)'
1、去除電源管理信
裁減部分電源管理選項可有效減小內核大小。
優化方法:修改默認.config 選項以裁減部分電源管理功能:
源碼根目錄下輸入:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
選項路徑:
Power management options --->
裁減以下選項:
[ ] Suspend to RAM and standby
[ ] Device power management core functionality
預估收益:內核大小收益 130 kbyte。
預估風險:配置後,Hibernation 無法使用。
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Thu Jun 25 20:52:02 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b81000 s40600 r8192 d29032 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129024
[ 0.000000] Kernel command line: mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14668(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.000000] Memory: 491808K/524288K available (5822K kernel code, 340K rwdata, 1744K rodata, 320K init, 301K bss, 28384K reserved, 4096K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 GB)
[ 0.000000] .text : 0xffffff8008080000 - 0xffffff8008630000 ( 5824 KB)
[ 0.000000] .rodata : 0xffffff8008630000 - 0xffffff80087f0000 ( 1792 KB)
[ 0.000000] .init : 0xffffff80087f0000 - 0xffffff8008840000 ( 320 KB)
[ 0.000000] .data : 0xffffff8008840000 - 0xffffff8008895008 ( 341 KB)
[ 0.000000] .bss : 0xffffff8008895008 - 0xffffff80088e0724 ( 302 KB)
[ 0.000000] fixed : 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffbf00000000 - 0xffffffc000000000 ( 4 GB maximum)
[ 0.000000] 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 MB actual)
[ 0.000000] memory : 0xffffffc004000000 - 0xffffffc024000000 ( 512 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[ 0.000003] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[ 0.000247] Console: colour dummy device 80x25
[ 0.000258] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000)
[ 0.000266] pid_max: default: 32768 minimum: 301
[ 0.000320] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000325] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000810] ASID allocator initialised with 65536 entries
[ 0.001880] Detected VIPT I-cache on CPU1
[ 0.001923] CPU1: Booted secondary processor [410fd034]
[ 0.002181] Detected VIPT I-cache on CPU2
[ 0.002204] CPU2: Booted secondary processor [410fd092]
[ 0.002441] Detected VIPT I-cache on CPU3
[ 0.002453] CPU3: Booted secondary processor [410fd092]
[ 0.002486] Brought up 4 CPUs
[ 0.002503] SMP: Total of 4 processors activated.
[ 0.002510] CPU features: detected feature: 32-bit EL0 Support
[ 0.002517] CPU: All CPU(s) started at EL1
[ 0.002536] alternatives: patching kernel code
[ 0.007088] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.007112] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.007380] pinctrl core: initialized pinctrl subsystem
[ 0.007868] NET: Registered protocol family 16
[ 0.008863] vdso: 2 pages (1 code @ ffffff8008637000, 1 data @ ffffff8008844000)
[ 0.008890] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.009390] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.009459] Serial: AMBA PL011 UART driver
[ 0.010773] 12100000.uart: ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0) is a PL011 rev2
[ 0.475075] console [ttyAMA0] enabled
[ 0.478956] 12101000.uart: ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = 0) is a PL011 rev2
[ 0.487837] 12102000.uart: ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = 0) is a PL011 rev2
[ 0.496715] 12103000.uart: ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = 0) is a PL011 rev2
[ 0.505598] 12104000.uart: ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = 0) is a PL011 rev2
[ 0.532034] vgaarb: loaded
[ 0.534940] SCSI subsystem initialized
[ 0.538748] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.545747] ssp-pl022 12120000.spi: mapped registers from 0x0000000012120000 to ffffff800890d000
[ 0.554998] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.561990] ssp-pl022 12121000.spi: mapped registers from 0x0000000012121000 to ffffff8008929000
[ 0.571179] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.578165] ssp-pl022 12122000.spi: mapped registers from 0x0000000012122000 to ffffff800892f000
[ 0.587346] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.594331] ssp-pl022 12123000.spi: mapped registers from 0x0000000012123000 to ffffff8008935000
[ 0.603512] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.610498] ssp-pl022 12124000.spi: mapped registers from 0x0000000012124000 to ffffff800893b000
[ 0.620105] usbcore: registered new interface driver usbfs
[ 0.625625] usbcore: registered new interface driver hub
[ 0.630983] usbcore: registered new device driver usb
[ 0.636173] Linux video capture interface: v2.00
[ 0.641455] clocksource: Switched to clocksource arch_sys_counter
[ 0.647652] VFS: Disk quotas dquot_6.6.0
[ 0.651590] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.659529] NET: Registered protocol family 2
[ 0.664089] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.671148] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.677608] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.683972] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.689802] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.696124] NET: Registered protocol family 1
[ 0.700641] RPC: Registered named UNIX socket transport module.
[ 0.706555] RPC: Registered udp transport module.
[ 0.711250] RPC: Registered tcp transport module.
[ 0.715945] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.723142] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.732157] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.738402] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.744626] fuse init (API version 7.26)
[ 0.749177] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.756576] io scheduler noop registered
[ 0.760495] io scheduler deadline registered (default)
[ 0.765637] io scheduler cfq registered
[ 0.775058] pl061_gpio 12140000.gpio_chip: PL061 GPIO chip @0x0000000012140000 registered
[ 0.783367] pl061_gpio 12141000.gpio_chip: PL061 GPIO chip @0x0000000012141000 registered
[ 0.791675] pl061_gpio 12142000.gpio_chip: PL061 GPIO chip @0x0000000012142000 registered
[ 0.799978] pl061_gpio 12143000.gpio_chip: PL061 GPIO chip @0x0000000012143000 registered
[ 0.808287] pl061_gpio 12144000.gpio_chip: PL061 GPIO chip @0x0000000012144000 registered
[ 0.816594] pl061_gpio 12145000.gpio_chip: PL061 GPIO chip @0x0000000012145000 registered
[ 0.824893] pl061_gpio 12146000.gpio_chip: PL061 GPIO chip @0x0000000012146000 registered
[ 0.833189] pl061_gpio 12147000.gpio_chip: PL061 GPIO chip @0x0000000012147000 registered
[ 0.841491] pl061_gpio 12148000.gpio_chip: PL061 GPIO chip @0x0000000012148000 registered
[ 0.849790] pl061_gpio 12149000.gpio_chip: PL061 GPIO chip @0x0000000012149000 registered
[ 0.858093] pl061_gpio 1214a000.gpio_chip: PL061 GPIO chip @0x000000001214a000 registered
[ 0.866391] pl061_gpio 1214b000.gpio_chip: PL061 GPIO chip @0x000000001214b000 registered
[ 0.874692] pl061_gpio 1214c000.gpio_chip: PL061 GPIO chip @0x000000001214c000 registered
[ 0.882994] pl061_gpio 1214d000.gpio_chip: PL061 GPIO chip @0x000000001214d000 registered
[ 0.891290] pl061_gpio 1214e000.gpio_chip: PL061 GPIO chip @0x000000001214e000 registered
[ 0.899589] pl061_gpio 1214f000.gpio_chip: PL061 GPIO chip @0x000000001214f000 registered
[ 0.907887] pl061_gpio 12150000.gpio_chip: PL061 GPIO chip @0x0000000012150000 registered
[ 0.916188] pl061_gpio 12151000.gpio_chip: PL061 GPIO chip @0x0000000012151000 registered
[ 0.924494] pl061_gpio 12152000.gpio_chip: PL061 GPIO chip @0x0000000012152000 registered
[ 0.933161] Unable to detect cache hierarchy from DT for CPU 0
[ 0.940983] brd: module loaded
[ 0.945309] loop: module loaded
[ 0.949044] hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.0
[ 0.955145] hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID
[ 0.961230] hisi-sfc hisi_spi_nor.0: spi nor register fail!
[ 0.966798] hisi-sfc: probe of hisi_spi_nor.0 failed with error -2
[ 0.973050] SPI Nand ID Table Version 2.6
[ 0.978061] Cannot found a valid SPI Nand Device
[ 0.982672] hisi_spi_nand_probe(171): Error: driver probe, result: -19
[ 1.146472] libphy: hisi_gemac_mii_bus: probed
[ 1.308466] libphy: hisi_gemac_mii_bus: probed
[ 1.314639] libphy: Fixed MDIO Bus: probed
[ 1.320474] hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 22:7e:24:a0:8d:b3
[ 1.393450] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 1.399771] Higmac dma_sg_phy: 0x0000000063c80000
[ 1.404632] ETH: rgmii, phy_addr=1
[ 1.409471] hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): using random MAC address ba:2f:43:18:3f:50
[ 1.481449] phy 3 not found
[ 1.486466] xhci-hcd 12310000.xhci_1: xHCI Host Controller
[ 1.491954] xhci-hcd 12310000.xhci_1: new USB bus registered, assigned bus number 1
[ 1.499756] xhci-hcd 12310000.xhci_1: hcc params 0x0220fe6d hci version 0x110 quirks 0x00010010
[ 1.508469] xhci-hcd 12310000.xhci_1: irq 41, io mem 0x12310000
[ 1.514587] hub 1-0:1.0: USB hub found
[ 1.518341] hub 1-0:1.0: 1 port detected
[ 1.522322] xhci-hcd 12310000.xhci_1: xHCI Host Controller
[ 1.527805] xhci-hcd 12310000.xhci_1: new USB bus registered, assigned bus number 2
[ 1.535477] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[ 1.543679] hub 2-0:1.0: USB hub found
[ 1.547429] hub 2-0:1.0: 1 port detected
[ 1.551521] usbcore: registered new interface driver usb-storage
[ 1.557576] mousedev: PS/2 mouse device common for all mice
[ 1.652920] hibvt_rtc 180b0000.rtc: rtc core: registered 180b0000.rtc as rtc0
[ 1.660107] hibvt_rtc 180b0000.rtc: RTC driver for hibvt enabled
[ 1.666173] i2c /dev entries driver
[ 1.669767] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 1.675995] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 1.682220] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 1.688447] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 1.694670] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 1.700893] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 1.707119] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 1.713343] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 1.719566] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 1.725787] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 1.732008] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 1.738318] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 1.744703] usbcore: registered new interface driver uvcvideo
[ 1.750440] USB Video Class driver (1.1.1)
[ 1.754674] sdhci: Secure Digital Host Controller Interface driver
[ 1.760845] sdhci: Copyright(c) Pierre Ossman
[ 1.765196] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.795454] mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit
[ 1.838451] mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit
[ 1.877452] mmc2: SDHCI controller on 10110000.SD [10110000.SD] using ADMA 64-bit
[ 1.915736] usbcore: registered new interface driver usbhid
[ 1.921305] usbhid: USB HID core driver
[ 1.925441] NET: Registered protocol family 10
[ 1.930211] NET: Registered protocol family 17
[ 1.948843] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 1.957499] mmc0: new HS400 MMC card at address 0001
[ 1.962614] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 1.967191] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 1.973154] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 1.979116] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 1.985040] hibvt_rtc 180b0000.rtc: setting system clock to 1970-01-01 00:06:34 UTC (394)
[ 1.985053] mmcblk0: p1(boot) p2(kernel) p3()
[ 1.997835] uart-pl011 12100000.uart: no DMA platform data
[ 2.008575] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 2.016675] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 2.022735] Freeing unused kernel memory: 320K (ffffffc0047f0000 - ffffffc004840000)
2、網絡協議去除 ipv6 支持
裁減網絡協議 ipv6 選項以減小內核大小。
優化方法:修改默認.config 選項使其去除 ipv6 支持:
源碼根目錄下輸入:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
選項路徑:
[*] Networking support --->
Networking options --->
以下選項不配置:
< > The IPv6 protocol ----
預估收益:內核大小收益 135 kbyte。
預估風險:內核功能無法支持 ipv6。
3、USB 默認編譯成模塊使用
USB 模塊初始化需要時消耗一定時間,通過把 USB 模塊編譯成 ko 文件來延後初始化 (如在 UI 顯示完成後再根據情況加載),可有效縮短 Kernel 本身的啓動時間。
優化方法:修改默認.config 選項使 USB 編譯成模塊:
源碼根目錄下輸入:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
選項路徑:
Device Drivers ---> [*] USB support --->
以下選項編譯成模塊:
<M> Support for Host-side USB
USB 配置成模塊後,可在內核根目錄通過以下命令編譯出模塊文件:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- modules
USB 相關模塊文件列表如下:
./drivers/usb/common/usb-common.ko ./drivers/usb/core/usbcore.ko ./drivers/usb/gadget/udc/udc-core.ko ./drivers/usb/gadget/legacy/g_mass_storage.ko ./drivers/usb/gadget/function/usb_f_mass_storage.ko ./drivers/usb/gadget/libcomposite.ko ./drivers/usb/host/xhci-hcd.ko ./drivers/usb/host/xhci-plat-hcd.ko ./drivers/usb/dwc3/dwc3.ko ./drivers/usb/dwc3/dwc3-exynos.ko ./drivers/usb/dwc3/dwc3-of-simple.ko ./drivers/usb/dwc3/dwc3-keystone.ko
預估收益:啓動時間收益 900ms,內核大小收益 70 kbyte。
使用說明:USB 模塊需要顯性加載後使用。
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Fri Jun 26 16:21:52 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b80000 s40472 r8192 d29160 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129024
[ 0.000000] Kernel command line: mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14668(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.000000] Memory: 492520K/524288K available (5310K kernel code, 290K rwdata, 1596K rodata, 320K init, 275K bss, 27672K reserved, 4096K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 GB)
[ 0.000000] .text : 0xffffff8008080000 - 0xffffff80085b0000 ( 5312 KB)
[ 0.000000] .rodata : 0xffffff80085b0000 - 0xffffff8008750000 ( 1664 KB)
[ 0.000000] .init : 0xffffff8008750000 - 0xffffff80087a0000 ( 320 KB)
[ 0.000000] .data : 0xffffff80087a0000 - 0xffffff80087e8808 ( 291 KB)
[ 0.000000] .bss : 0xffffff80087e8808 - 0xffffff800882d5fc ( 276 KB)
[ 0.000000] fixed : 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffbf00000000 - 0xffffffc000000000 ( 4 GB maximum)
[ 0.000000] 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 MB actual)
[ 0.000000] memory : 0xffffffc004000000 - 0xffffffc024000000 ( 512 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[ 0.000004] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[ 0.000246] Console: colour dummy device 80x25
[ 0.000258] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000)
[ 0.000266] pid_max: default: 32768 minimum: 301
[ 0.000317] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000322] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000809] ASID allocator initialised with 65536 entries
[ 0.001885] Detected VIPT I-cache on CPU1
[ 0.001929] CPU1: Booted secondary processor [410fd034]
[ 0.002190] Detected VIPT I-cache on CPU2
[ 0.002214] CPU2: Booted secondary processor [410fd092]
[ 0.002453] Detected VIPT I-cache on CPU3
[ 0.002464] CPU3: Booted secondary processor [410fd092]
[ 0.002498] Brought up 4 CPUs
[ 0.002516] SMP: Total of 4 processors activated.
[ 0.002522] CPU features: detected feature: 32-bit EL0 Support
[ 0.002529] CPU: All CPU(s) started at EL1
[ 0.002548] alternatives: patching kernel code
[ 0.007063] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.007084] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.007344] pinctrl core: initialized pinctrl subsystem
[ 0.007845] NET: Registered protocol family 16
[ 0.008771] vdso: 2 pages (1 code @ ffffff80085b7000, 1 data @ ffffff80087a4000)
[ 0.008795] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.009293] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.009364] Serial: AMBA PL011 UART driver
[ 0.010701] 12100000.uart: ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0) is a PL011 rev2
[ 0.474982] console [ttyAMA0] enabled
[ 0.478870] 12101000.uart: ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = 0) is a PL011 rev2
[ 0.487770] 12102000.uart: ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = 0) is a PL011 rev2
[ 0.496674] 12103000.uart: ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = 0) is a PL011 rev2
[ 0.505568] 12104000.uart: ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = 0) is a PL011 rev2
[ 0.532055] vgaarb: loaded
[ 0.534948] SCSI subsystem initialized
[ 0.538753] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.545755] ssp-pl022 12120000.spi: mapped registers from 0x0000000012120000 to ffffff8008871000
[ 0.554994] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.561992] ssp-pl022 12121000.spi: mapped registers from 0x0000000012121000 to ffffff8008877000
[ 0.571165] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.578159] ssp-pl022 12122000.spi: mapped registers from 0x0000000012122000 to ffffff800887d000
[ 0.587356] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.594349] ssp-pl022 12123000.spi: mapped registers from 0x0000000012123000 to ffffff8008883000
[ 0.603533] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.610528] ssp-pl022 12124000.spi: mapped registers from 0x0000000012124000 to ffffff8008889000
[ 0.620116] Linux video capture interface: v2.00
[ 0.625413] clocksource: Switched to clocksource arch_sys_counter
[ 0.631645] VFS: Disk quotas dquot_6.6.0
[ 0.635605] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.644860] NET: Registered protocol family 2
[ 0.649556] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.656639] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.663135] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.669519] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.675361] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.681737] NET: Registered protocol family 1
[ 0.686288] RPC: Registered named UNIX socket transport module.
[ 0.692223] RPC: Registered udp transport module.
[ 0.696926] RPC: Registered tcp transport module.
[ 0.701626] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.709383] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.721464] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.727988] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.734301] fuse init (API version 7.26)
[ 0.739107] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.746518] io scheduler noop registered
[ 0.750447] io scheduler deadline registered (default)
[ 0.755603] io scheduler cfq registered
[ 0.765559] pl061_gpio 12140000.gpio_chip: PL061 GPIO chip @0x0000000012140000 registered
[ 0.774046] pl061_gpio 12141000.gpio_chip: PL061 GPIO chip @0x0000000012141000 registered
[ 0.782508] pl061_gpio 12142000.gpio_chip: PL061 GPIO chip @0x0000000012142000 registered
[ 0.790972] pl061_gpio 12143000.gpio_chip: PL061 GPIO chip @0x0000000012143000 registered
[ 0.799451] pl061_gpio 12144000.gpio_chip: PL061 GPIO chip @0x0000000012144000 registered
[ 0.807911] pl061_gpio 12145000.gpio_chip: PL061 GPIO chip @0x0000000012145000 registered
[ 0.816378] pl061_gpio 12146000.gpio_chip: PL061 GPIO chip @0x0000000012146000 registered
[ 0.824828] pl061_gpio 12147000.gpio_chip: PL061 GPIO chip @0x0000000012147000 registered
[ 0.833280] pl061_gpio 12148000.gpio_chip: PL061 GPIO chip @0x0000000012148000 registered
[ 0.841741] pl061_gpio 12149000.gpio_chip: PL061 GPIO chip @0x0000000012149000 registered
[ 0.850208] pl061_gpio 1214a000.gpio_chip: PL061 GPIO chip @0x000000001214a000 registered
[ 0.858676] pl061_gpio 1214b000.gpio_chip: PL061 GPIO chip @0x000000001214b000 registered
[ 0.867141] pl061_gpio 1214c000.gpio_chip: PL061 GPIO chip @0x000000001214c000 registered
[ 0.875604] pl061_gpio 1214d000.gpio_chip: PL061 GPIO chip @0x000000001214d000 registered
[ 0.884064] pl061_gpio 1214e000.gpio_chip: PL061 GPIO chip @0x000000001214e000 registered
[ 0.892529] pl061_gpio 1214f000.gpio_chip: PL061 GPIO chip @0x000000001214f000 registered
[ 0.900993] pl061_gpio 12150000.gpio_chip: PL061 GPIO chip @0x0000000012150000 registered
[ 0.909464] pl061_gpio 12151000.gpio_chip: PL061 GPIO chip @0x0000000012151000 registered
[ 0.917925] pl061_gpio 12152000.gpio_chip: PL061 GPIO chip @0x0000000012152000 registered
[ 0.927030] Unable to detect cache hierarchy from DT for CPU 0
[ 0.936832] brd: module loaded
[ 0.942375] loop: module loaded
[ 0.946533] hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.0
[ 0.952644] hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID
[ 0.958736] hisi-sfc hisi_spi_nor.0: spi nor register fail!
[ 0.964314] hisi-sfc: probe of hisi_spi_nor.0 failed with error -2
[ 0.970634] SPI Nand ID Table Version 2.6
[ 0.975656] Cannot found a valid SPI Nand Device
[ 0.980276] hisi_spi_nand_probe(171): Error: driver probe, result: -19
[ 1.143446] libphy: hisi_gemac_mii_bus: probed
[ 1.305446] libphy: hisi_gemac_mii_bus: probed
[ 1.311727] libphy: Fixed MDIO Bus: probed
[ 1.317445] hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 82:18:0c:2d:17:43
[ 1.389412] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 1.395834] Higmac dma_sg_phy: 0x0000000063c80000
[ 1.400839] ETH: rgmii, phy_addr=1
[ 1.405446] hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): using random MAC address aa:89:14:02:e0:44
[ 1.476410] phy 3 not found
[ 1.480741] mousedev: PS/2 mouse device common for all mice
[ 1.575905] hibvt_rtc 180b0000.rtc: rtc core: registered 180b0000.rtc as rtc0
[ 1.583104] hibvt_rtc 180b0000.rtc: RTC driver for hibvt enabled
[ 1.589236] i2c /dev entries driver
[ 1.592919] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 1.599205] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 1.605498] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 1.611780] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 1.618063] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 1.624345] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 1.630631] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 1.636915] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 1.643198] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 1.649488] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 1.655772] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 1.662145] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 1.668817] sdhci: Secure Digital Host Controller Interface driver
[ 1.674999] sdhci: Copyright(c) Pierre Ossman
[ 1.679363] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.709418] mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit
[ 1.751415] mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit
[ 1.791413] mmc2: SDHCI controller on 10110000.SD [10110000.SD] using ADMA 64-bit
[ 1.824136] NET: Registered protocol family 17
[ 1.849783] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 1.858471] mmc0: new HS400 MMC card at address 0001
[ 1.863677] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 1.868292] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 1.874289] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 1.880292] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 1.880300] hibvt_rtc 180b0000.rtc: setting system clock to 1970-01-01 00:47:12 UTC (2832)
[ 1.894477] uart-pl011 12100000.uart: no DMA platform data
[ 1.894585] mmcblk0: p1(boot) p2(kernel) p3()
[ 1.922337] EXT4-fs (mmcblk0p3): recovery complete
[ 1.927244] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 1.935361] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 1.941466] Freeing unused kernel memory: 320K (ffffffc004750000 - ffffffc0047a0000)
提升了100ms左右
4、保留必要的文件系統支持
只保留必要的文件系統支持,可有效減小內核大小。默認 mini-Kernel 的 config 支持的。
優化方法:修改默認.config 選項裁減其它文件系統。
源碼根目錄下輸入:
make ARCH=arm64 CROSS_COMPILE=aarch64-himix100-linux- menuconfig
1.去除fatfs文件系統支持
File systems --->
DOS/FAT/NT Filesystems --->
<> MSDOS fs Support
2. 去除SPI FLASH上 squashfs 支持。
File systems --->
-*- Miscellaneous filesystems --->
<> SquashFS 4.0 - Squashed file system support
3. 去除jaffs yaffs2支持
File systems --->
-*- Miscellaneous filesystems --->
<> yaffs2 file system support
<> UBIFS FILE SYSTEM SUPPORT
提升不明顯 內核大小減少200k
5、其它選項配置
以下優化點爲 Kernel 特性裁減,均通過配置 config 實現,用戶可根據場景需要考慮是 否配置。
打開 menuconfig 菜單,源碼根目錄下輸入:
make ARCH=arm CROSS_COMPILE=arm-hisiv600-linux- menuconfig
關閉 SWAP 功能,配置路徑:
General setup --->
關閉以下配置:
[ ] Support for paging of anonymous memory (swap)
預估風險:關閉後將無法使用交換分區或者交換文件來做爲虛擬內存。
關閉 GPIO 驅動,配置路徑:
Device Drivers --->
關閉以下配置:
[ ] GPIO Support ----
預估風險:關閉後無法使用 Kernel 默認的 GPIO 驅動。
關閉 input device 部分選項,配置路徑:
Device Drivers --->
Input device support --->
配置完成後,進入以下選項:
Hardware I/O ports --->
關閉下列選項:
< > Serial I/O support < > Gameport support
預估風險:無法使用鼠標接口、Kernel 默認鼠標、鍵盤驅動。無法使用 PS/2 鍵盤或鼠 標、無法使用串口鍵盤或鼠標。
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Fri Jun 26 17:04:39 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b81000 s40472 r8192 d29160 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129024
[ 0.000000] Kernel command line: mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14668(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.000000] Memory: 492844K/524288K available (5054K kernel code, 288K rwdata, 1544K rodata, 320K init, 276K bss, 27348K reserved, 4096K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 GB)
[ 0.000000] .text : 0xffffff8008080000 - 0xffffff8008570000 ( 5056 KB)
[ 0.000000] .rodata : 0xffffff8008570000 - 0xffffff8008700000 ( 1600 KB)
[ 0.000000] .init : 0xffffff8008700000 - 0xffffff8008750000 ( 320 KB)
[ 0.000000] .data : 0xffffff8008750000 - 0xffffff8008798008 ( 289 KB)
[ 0.000000] .bss : 0xffffff8008798008 - 0xffffff80087dd2fc ( 277 KB)
[ 0.000000] fixed : 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffbf00000000 - 0xffffffc000000000 ( 4 GB maximum)
[ 0.000000] 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 MB actual)
[ 0.000000] memory : 0xffffffc004000000 - 0xffffffc024000000 ( 512 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[ 0.000004] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[ 0.000246] Console: colour dummy device 80x25
[ 0.000257] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000)
[ 0.000266] pid_max: default: 32768 minimum: 301
[ 0.000319] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000324] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000808] ASID allocator initialised with 65536 entries
[ 0.001878] Detected VIPT I-cache on CPU1
[ 0.001922] CPU1: Booted secondary processor [410fd034]
[ 0.002179] Detected VIPT I-cache on CPU2
[ 0.002201] CPU2: Booted secondary processor [410fd092]
[ 0.002439] Detected VIPT I-cache on CPU3
[ 0.002451] CPU3: Booted secondary processor [410fd092]
[ 0.002484] Brought up 4 CPUs
[ 0.002503] SMP: Total of 4 processors activated.
[ 0.002508] CPU features: detected feature: 32-bit EL0 Support
[ 0.002515] CPU: All CPU(s) started at EL1
[ 0.002533] alternatives: patching kernel code
[ 0.007104] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.007127] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.007386] pinctrl core: initialized pinctrl subsystem
[ 0.007849] NET: Registered protocol family 16
[ 0.008793] vdso: 2 pages (1 code @ ffffff8008577000, 1 data @ ffffff8008754000)
[ 0.008820] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.009318] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.009398] Serial: AMBA PL011 UART driver
[ 0.010674] 12100000.uart: ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0) is a PL011 rev2
[ 0.475019] console [ttyAMA0] enabled
[ 0.478953] 12101000.uart: ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = 0) is a PL011 rev2
[ 0.487841] 12102000.uart: ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = 0) is a PL011 rev2
[ 0.496720] 12103000.uart: ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = 0) is a PL011 rev2
[ 0.505602] 12104000.uart: ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = 0) is a PL011 rev2
[ 0.531338] vgaarb: loaded
[ 0.534238] SCSI subsystem initialized
[ 0.538051] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.545054] ssp-pl022 12120000.spi: mapped registers from 0x0000000012120000 to ffffff8008821000
[ 0.554302] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.561304] ssp-pl022 12121000.spi: mapped registers from 0x0000000012121000 to ffffff8008827000
[ 0.570518] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.577517] ssp-pl022 12122000.spi: mapped registers from 0x0000000012122000 to ffffff800882d000
[ 0.586735] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.593733] ssp-pl022 12123000.spi: mapped registers from 0x0000000012123000 to ffffff8008833000
[ 0.602927] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.609922] ssp-pl022 12124000.spi: mapped registers from 0x0000000012124000 to ffffff8008839000
[ 0.619494] Linux video capture interface: v2.00
[ 0.624759] clocksource: Switched to clocksource arch_sys_counter
[ 0.630992] VFS: Disk quotas dquot_6.6.0
[ 0.634949] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.644210] NET: Registered protocol family 2
[ 0.648901] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.655983] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.662478] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.668860] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.674700] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.681076] NET: Registered protocol family 1
[ 0.685656] RPC: Registered named UNIX socket transport module.
[ 0.691578] RPC: Registered udp transport module.
[ 0.696280] RPC: Registered tcp transport module.
[ 0.700981] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.708741] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.721078] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.727344] fuse init (API version 7.26)
[ 0.731888] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 0.739285] io scheduler noop registered
[ 0.743204] io scheduler deadline registered (default)
[ 0.748345] io scheduler cfq registered
[ 0.757919] Unable to detect cache hierarchy from DT for CPU 0
[ 0.766104] brd: module loaded
[ 0.770571] loop: module loaded
[ 0.774291] hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.0
[ 0.780392] hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID
[ 0.786477] hisi-sfc hisi_spi_nor.0: spi nor register fail!
[ 0.792046] hisi-sfc: probe of hisi_spi_nor.0 failed with error -2
[ 0.798301] SPI Nand ID Table Version 2.6
[ 0.803312] Cannot found a valid SPI Nand Device
[ 0.807923] hisi_spi_nand_probe(171): Error: driver probe, result: -19
[ 0.971773] libphy: hisi_gemac_mii_bus: probed
[ 1.133765] libphy: hisi_gemac_mii_bus: probed
[ 1.139933] libphy: Fixed MDIO Bus: probed
[ 1.145778] hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address d2:0b:4a:f5:06:53
[ 1.218752] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 1.225069] Higmac dma_sg_phy: 0x0000000063c80000
[ 1.229928] ETH: rgmii, phy_addr=1
[ 1.234773] hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 3a:7f:4d:54:de:c7
[ 1.306751] phy 3 not found
[ 1.310920] mousedev: PS/2 mouse device common for all mice
[ 1.407216] hibvt_rtc 180b0000.rtc: rtc core: registered 180b0000.rtc as rtc0
[ 1.414400] hibvt_rtc 180b0000.rtc: RTC driver for hibvt enabled
[ 1.420456] i2c /dev entries driver
[ 1.424038] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 1.430264] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 1.436489] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 1.442713] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 1.448937] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 1.455155] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 1.461377] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 1.467597] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 1.473819] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 1.480040] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 1.486261] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 1.492571] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 1.499039] sdhci: Secure Digital Host Controller Interface driver
[ 1.505210] sdhci: Copyright(c) Pierre Ossman
[ 1.509562] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.538756] mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit
[ 1.580754] mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit
[ 1.619754] mmc2: SDHCI controller on 10110000.SD [10110000.SD] using ADMA 64-bit
[ 1.659146] NET: Registered protocol family 17
[ 1.690107] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 1.698769] mmc0: new HS400 MMC card at address 0001
[ 1.703912] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 1.708505] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 1.714500] hibvt_rtc 180b0000.rtc: setting system clock to 1970-01-01 01:29:03 UTC (5343)
[ 1.722837] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 1.728824] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 1.734668] uart-pl011 12100000.uart: no DMA platform data
[ 1.734744] mmcblk0: p1(boot) p2(kernel) p3()
[ 1.750512] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 1.758649] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 1.764757] Freeing unused kernel memory: 320K (ffffffc004700000 - ffffffc004750000)
提升明顯,200ms左右,尤其是gpio的優化
6、修改dts 不初始化第二個網口
dts目錄如下:
osdrv/opensource/kernel/linux-4.9.y_multi-core/arch/arm64/boot/dts/hisilicon
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Fri Jun 26 18:29:41 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b82000 s40472 r8192 d29160 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129024
[ 0.000000] Kernel command line: mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14668(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.000000] Memory: 492844K/524288K available (5054K kernel code, 288K rwdata, 1544K rodata, 320K init, 276K bss, 27348K reserved, 4096K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 GB)
[ 0.000000] .text : 0xffffff8008080000 - 0xffffff8008570000 ( 5056 KB)
[ 0.000000] .rodata : 0xffffff8008570000 - 0xffffff8008700000 ( 1600 KB)
[ 0.000000] .init : 0xffffff8008700000 - 0xffffff8008750000 ( 320 KB)
[ 0.000000] .data : 0xffffff8008750000 - 0xffffff8008798008 ( 289 KB)
[ 0.000000] .bss : 0xffffff8008798008 - 0xffffff80087dd2fc ( 277 KB)
[ 0.000000] fixed : 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffbf00000000 - 0xffffffc000000000 ( 4 GB maximum)
[ 0.000000] 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 MB actual)
[ 0.000000] memory : 0xffffffc004000000 - 0xffffffc024000000 ( 512 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[ 0.000003] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[ 0.000243] Console: colour dummy device 80x25
[ 0.000255] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000)
[ 0.000263] pid_max: default: 32768 minimum: 301
[ 0.000315] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000320] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000805] ASID allocator initialised with 65536 entries
[ 0.001868] Detected VIPT I-cache on CPU1
[ 0.001911] CPU1: Booted secondary processor [410fd034]
[ 0.002177] Detected VIPT I-cache on CPU2
[ 0.002198] CPU2: Booted secondary processor [410fd092]
[ 0.002432] Detected VIPT I-cache on CPU3
[ 0.002444] CPU3: Booted secondary processor [410fd092]
[ 0.002478] Brought up 4 CPUs
[ 0.002496] SMP: Total of 4 processors activated.
[ 0.002502] CPU features: detected feature: 32-bit EL0 Support
[ 0.002509] CPU: All CPU(s) started at EL1
[ 0.002529] alternatives: patching kernel code
[ 0.007057] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.007079] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.007336] pinctrl core: initialized pinctrl subsystem
[ 0.007798] NET: Registered protocol family 16
[ 0.008743] vdso: 2 pages (1 code @ ffffff8008577000, 1 data @ ffffff8008754000)
[ 0.008769] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.009266] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.009341] Serial: AMBA PL011 UART driver
[ 0.010617] 12100000.uart: ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0) is a PL011 rev2
[ 0.474954] console [ttyAMA0] enabled
[ 0.478894] 12101000.uart: ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = 0) is a PL011 rev2
[ 0.487779] 12102000.uart: ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = 0) is a PL011 rev2
[ 0.496660] 12103000.uart: ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = 0) is a PL011 rev2
[ 0.505548] 12104000.uart: ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = 0) is a PL011 rev2
[ 0.530981] vgaarb: loaded
[ 0.533879] SCSI subsystem initialized
[ 0.537684] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.544679] ssp-pl022 12120000.spi: mapped registers from 0x0000000012120000 to ffffff8008821000
[ 0.553917] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.560911] ssp-pl022 12121000.spi: mapped registers from 0x0000000012121000 to ffffff8008827000
[ 0.570118] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.577119] ssp-pl022 12122000.spi: mapped registers from 0x0000000012122000 to ffffff800882d000
[ 0.586331] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.593328] ssp-pl022 12123000.spi: mapped registers from 0x0000000012123000 to ffffff8008833000
[ 0.602534] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.609530] ssp-pl022 12124000.spi: mapped registers from 0x0000000012124000 to ffffff8008839000
[ 0.619115] Linux video capture interface: v2.00
[ 0.624402] clocksource: Switched to clocksource arch_sys_counter
[ 0.630606] VFS: Disk quotas dquot_6.6.0
[ 0.634544] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.642503] NET: Registered protocol family 2
[ 0.647074] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.654133] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.660593] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.666956] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.672787] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.679111] NET: Registered protocol family 1
[ 0.683625] RPC: Registered named UNIX socket transport module.
[ 0.689540] RPC: Registered udp transport module.
[ 0.694235] RPC: Registered tcp transport module.
[ 0.698930] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.706150] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.715522] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.721736] fuse init (API version 7.26)
[ 0.726287] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 0.733684] io scheduler noop registered
[ 0.737603] io scheduler deadline registered (default)
[ 0.742743] io scheduler cfq registered
[ 0.752285] Unable to detect cache hierarchy from DT for CPU 0
[ 0.760217] brd: module loaded
[ 0.764658] loop: module loaded
[ 0.768365] hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.0
[ 0.774470] hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID
[ 0.780555] hisi-sfc hisi_spi_nor.0: spi nor register fail!
[ 0.786123] hisi-sfc: probe of hisi_spi_nor.0 failed with error -2
[ 0.792369] SPI Nand ID Table Version 2.6
[ 0.797380] Cannot found a valid SPI Nand Device
[ 0.801990] hisi_spi_nand_probe(171): Error: driver probe, result: -19
[ 0.964413] libphy: hisi_gemac_mii_bus: probed
[ 1.126410] libphy: hisi_gemac_mii_bus: probed
[ 1.130950] libphy: Fixed MDIO Bus: probed
[ 1.136419] hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 42:45:eb:f9:78:74
[ 1.209395] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 1.215711] Higmac dma_sg_phy: 0x0000000063c80000
[ 1.220567] ETH: rgmii, phy_addr=1
[ 1.225398] hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): not find phy-mode
[ 1.234363] hi_gmac_v200: probe of 101e0000.ethernet failed with error -22
[ 1.241370] mousedev: PS/2 mouse device common for all mice
[ 1.337862] hibvt_rtc 180b0000.rtc: rtc core: registered 180b0000.rtc as rtc0
[ 1.345048] hibvt_rtc 180b0000.rtc: RTC driver for hibvt enabled
[ 1.351107] i2c /dev entries driver
[ 1.354696] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 1.360923] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 1.367148] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 1.373373] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 1.379598] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 1.385823] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 1.392045] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 1.398270] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 1.404494] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 1.410716] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 1.416939] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 1.423246] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 1.429711] sdhci: Secure Digital Host Controller Interface driver
[ 1.435882] sdhci: Copyright(c) Pierre Ossman
[ 1.440234] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.470399] mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit
[ 1.512396] mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit
[ 1.551397] mmc2: SDHCI controller on 10110000.SD [10110000.SD] using ADMA 64-bit
[ 1.588786] NET: Registered protocol family 17
[ 1.623739] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 1.632394] mmc0: new HS400 MMC card at address 0001
[ 1.637525] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 1.642122] hibvt_rtc 180b0000.rtc: setting system clock to 1970-01-01 02:54:18 UTC (10458)
[ 1.650683] uart-pl011 12100000.uart: no DMA platform data
[ 1.656189] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 1.662177] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 1.668155] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 1.674096] mmcblk0: p1(boot) p2(kernel) p3()
[ 1.684178] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 1.692284] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 1.698346] Freeing unused kernel memory: 320K (ffffffc004700000 - ffffffc004750000)
7、去掉rtc模塊
Device Drivers --->
[]Real Time Clock
有提升 大約100ms
[ 1.337862] hibvt_rtc 180b0000.rtc: rtc core: registered 180b0000.rtc as rtc0
[ 1.345048] hibvt_rtc 180b0000.rtc: RTC driver for hibvt enabled
8、去掉spi nor/nand flash 模塊
Device Drivers --->
Memory Technology Device (MTD) support --->
[]SPI-NOR device support
[]NAND Device Support
因爲我使用的是emmc,所以不需要spi flash,在內核中去掉,提升100ms左右
[ 0.768365] hisi-sfc hisi_spi_nor.0: SPI Nor ID Table Version 1.0
[ 0.774470] hisi-sfc hisi_spi_nor.0: unrecognized Manufacturer ID
[ 0.780555] hisi-sfc hisi_spi_nor.0: spi nor register fail!
[ 0.786123] hisi-sfc: probe of hisi_spi_nor.0 failed with error -2
[ 0.792369] SPI Nand ID Table Version 2.6
[ 0.797380] Cannot found a valid SPI Nand Device
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Fri Jun 26 22:16:26 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b82000 s40472 r8192 d29160 u77824
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129024
[ 0.000000] Kernel command line: mem=512M initcall_debug printk.time=y console=ttyAMA0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel),-M(rootfs)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14668(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
[ 0.000000] Memory: 492996K/524288K available (4990K kernel code, 266K rwdata, 1512K rodata, 320K init, 274K bss, 27196K reserved, 4096K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
[ 0.000000] vmalloc : 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 GB)
[ 0.000000] .text : 0xffffff8008080000 - 0xffffff8008560000 ( 4992 KB)
[ 0.000000] .rodata : 0xffffff8008560000 - 0xffffff80086e0000 ( 1536 KB)
[ 0.000000] .init : 0xffffff80086e0000 - 0xffffff8008730000 ( 320 KB)
[ 0.000000] .data : 0xffffff8008730000 - 0xffffff8008772808 ( 267 KB)
[ 0.000000] .bss : 0xffffff8008772808 - 0xffffff80087b717c ( 275 KB)
[ 0.000000] fixed : 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 KB)
[ 0.000000] PCI I/O : 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 MB)
[ 0.000000] vmemmap : 0xffffffbf00000000 - 0xffffffc000000000 ( 4 GB maximum)
[ 0.000000] 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 MB actual)
[ 0.000000] memory : 0xffffffc004000000 - 0xffffffc024000000 ( 512 MB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 50.00MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xb8812736b, max_idle_ns: 440795202655 ns
[ 0.000003] sched_clock: 56 bits at 50MHz, resolution 20ns, wraps every 4398046511100ns
[ 0.000243] Console: colour dummy device 80x25
[ 0.000254] Calibrating delay loop (skipped), value calculated using timer frequency.. 100.00 BogoMIPS (lpj=50000)
[ 0.000261] pid_max: default: 32768 minimum: 301
[ 0.000314] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000319] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000814] ASID allocator initialised with 65536 entries
[ 0.001895] Detected VIPT I-cache on CPU1
[ 0.001935] CPU1: Booted secondary processor [410fd034]
[ 0.002194] Detected VIPT I-cache on CPU2
[ 0.002216] CPU2: Booted secondary processor [410fd092]
[ 0.002455] Detected VIPT I-cache on CPU3
[ 0.002467] CPU3: Booted secondary processor [410fd092]
[ 0.002500] Brought up 4 CPUs
[ 0.002518] SMP: Total of 4 processors activated.
[ 0.002524] CPU features: detected feature: 32-bit EL0 Support
[ 0.002531] CPU: All CPU(s) started at EL1
[ 0.002550] alternatives: patching kernel code
[ 0.006983] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[ 0.007018] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.007288] pinctrl core: initialized pinctrl subsystem
[ 0.007760] NET: Registered protocol family 16
[ 0.008697] vdso: 2 pages (1 code @ ffffff8008567000, 1 data @ ffffff8008734000)
[ 0.008722] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.009221] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.009292] Serial: AMBA PL011 UART driver
[ 0.010611] 12100000.uart: ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0) is a PL011 rev2
[ 0.474909] console [ttyAMA0] enabled
[ 0.478794] 12101000.uart: ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = 0) is a PL011 rev2
[ 0.487676] 12102000.uart: ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = 0) is a PL011 rev2
[ 0.496559] 12103000.uart: ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = 0) is a PL011 rev2
[ 0.505444] 12104000.uart: ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = 0) is a PL011 rev2
[ 0.531879] vgaarb: loaded
[ 0.534791] SCSI subsystem initialized
[ 0.538598] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.545596] ssp-pl022 12120000.spi: mapped registers from 0x0000000012120000 to ffffff80087e9000
[ 0.554833] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.561829] ssp-pl022 12121000.spi: mapped registers from 0x0000000012121000 to ffffff8008801000
[ 0.571039] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.578041] ssp-pl022 12122000.spi: mapped registers from 0x0000000012122000 to ffffff8008807000
[ 0.587253] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.594261] ssp-pl022 12123000.spi: mapped registers from 0x0000000012123000 to ffffff800880d000
[ 0.603484] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
[ 0.610489] ssp-pl022 12124000.spi: mapped registers from 0x0000000012124000 to ffffff8008813000
[ 0.620058] Linux video capture interface: v2.00
[ 0.625341] clocksource: Switched to clocksource arch_sys_counter
[ 0.631582] VFS: Disk quotas dquot_6.6.0
[ 0.635538] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.644720] NET: Registered protocol family 2
[ 0.649452] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.656540] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.663034] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.669417] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.675258] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.681642] NET: Registered protocol family 1
[ 0.686228] RPC: Registered named UNIX socket transport module.
[ 0.692160] RPC: Registered udp transport module.
[ 0.696865] RPC: Registered tcp transport module.
[ 0.701568] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.709426] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.721735] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.727948] fuse init (API version 7.26)
[ 0.732358] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[ 0.739765] io scheduler noop registered
[ 0.743684] io scheduler deadline registered (default)
[ 0.748826] io scheduler cfq registered
[ 0.758411] Unable to detect cache hierarchy from DT for CPU 0
[ 0.766367] brd: module loaded
[ 0.770728] loop: module loaded
[ 0.930356] libphy: hisi_gemac_mii_bus: probed
[ 1.092349] libphy: hisi_gemac_mii_bus: probed
[ 1.096883] libphy: Fixed MDIO Bus: probed
[ 1.102361] hi_gmac_v200 101c0000.ethernet (unnamed net_device) (uninitialized): using random MAC address 9e:73:03:15:1c:3f
[ 1.175338] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 1.181658] Higmac dma_sg_phy: 0x0000000063c80000
[ 1.186520] ETH: rgmii, phy_addr=1
[ 1.191340] hi_gmac_v200 101e0000.ethernet (unnamed net_device) (uninitialized): not find phy-mode
[ 1.200304] hi_gmac_v200: probe of 101e0000.ethernet failed with error -22
[ 1.207312] mousedev: PS/2 mouse device common for all mice
[ 1.212971] i2c /dev entries driver
[ 1.216556] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 1.222782] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 1.229003] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 1.235223] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 1.241446] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 1.247668] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 1.253889] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 1.260108] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 1.266328] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 1.272546] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 1.278767] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 1.285070] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 1.291522] sdhci: Secure Digital Host Controller Interface driver
[ 1.297695] sdhci: Copyright(c) Pierre Ossman
[ 1.302047] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.331350] mmc0: SDHCI controller on 100f0000.eMMC [100f0000.eMMC] using ADMA 64-bit
[ 1.372348] mmc1: SDHCI controller on 10100000.SD [10100000.SD] using ADMA 64-bit
[ 1.412345] mmc2: SDHCI controller on 10110000.SD [10110000.SD] using ADMA 64-bit
[ 1.445057] NET: Registered protocol family 17
[ 1.452299] uart-pl011 12100000.uart: no DMA platform data
[ 1.457865] Waiting for root device /dev/mmcblk0p3...
[ 1.475499] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 1.484169] mmc0: new HS400 MMC card at address 0001
[ 1.489426] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 1.494061] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 1.500077] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 1.506090] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 1.512098] mmcblk0: p1(boot) p2(kernel) p3()
[ 1.616703] EXT4-fs (mmcblk0p3): recovery complete
[ 1.621614] EXT4-fs (mmcblk0p3): mounted filesystem with ordered data mode. Opts: (null)
[ 1.629730] VFS: Mounted root (ext4 filesystem) on device 179:3.
[ 1.635832] Freeing unused kernel memory: 320K (ffffffc0046e0000 - ffffffc004730000)
9、串口log優化
對於115200的串口速率來說,一個字符耗時大概1/(115200/10)=0.087ms。所以100個字符大概耗時8.7ms。
在內核初始化的時候,輸出很多串口log是一件恐怖的事情。
雖然不是什麼高深的技巧,但是卻很有效。
在內核中啓動打印時間:make menuconfig ---> Kernel hacking --> show timing information on printks
dmesg -s 131072 > ktime
~ # dmesg -s 131072 > ktime
~ # more ktime
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.37 (xiangang@xiangang-virtual-machine) (gcc version 6.3.0 (HC&C V1R3C00SPC200B005_20190606) ) #1 SMP Fri Jun 26 23:17:44 CST 2020
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] Machine model: Hisilicon HI3559AV100 DEMO Board
[ 0.000000] Memory limited to 512MB
[ 0.000000] cmz zone is not set!
[ 0.000000] cma: Reserved 4 MiB at 0x0000000063c00000
[ 0.000000] On node 0 totalpages: 131072
[ 0.000000] DMA zone: 2048 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
[ 0.000000] DMA zone: 131072 pages, LIFO batch:31
[ 0.000000] psci: probing for conduit method from DT.
[ 0.000000] psci: PSCIv1.0 detected in firmware.
[ 0.000000] psci: Using standard PSCI v0.2 function IDs
[ 0.000000] psci: MIGRATE_INFO_TYPE not supported.
[ 0.000000] percpu: Embedded 19 pages/cpu @ffffffc023b82000 s40472 r8192 d29160 u77824
[ 0.000000] pcpu-alloc: s40472 r8192 d29160 u77824 alloc=19*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
es: 129024 sts in Zone order, mobility grouping on. Total pag--More-- (11% of 11374 bytes)
),-M(rootfs) rw rootwait blkdevparts=mmcblk0:1M(boot),9M(kernel--More-- (12% of 11374 bytes)
[ 0.000000] log_buf_len individual max cpu contribution: 4096 bytes
[ 0.000000] log_buf_len total cpu_extra contributions: 12288 bytes
[ 0.000000] log_buf_len min size: 16384 bytes
[ 0.000000] log_buf_len: 32768 bytes
[ 0.000000] early log buf free: 14688(89%)
[ 0.000000] PID hash table entries: 2048 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes)
, 1488K rodata, 320K init, 274K bss, 27128K reserved, 4096K cma-reserved) rwdata--More-- (18% of 11374 bytes)
[ 0.000000] Virtual kernel memory layout:
B) 0xffffff8000000000 - 0xffffff8008000000 ( 128 M--More-- (19% of 11374 bytes)
B) 0xffffff8008000000 - 0xffffffbebfff0000 ( 250 G--More-- (20% of 11374 bytes)
B) 0xffffff8008080000 - 0xffffff8008550000 ( 4928 K--More-- (21% of 11374 bytes)
B) 0xffffff8008550000 - 0xffffff80086d0000 ( 1536 K--More-- (22% of 11374 bytes)
B) 0xffffff80086d0000 - 0xffffff8008720000 ( 320 K--More-- (22% of 11374 bytes)
B) 0xffffff8008720000 - 0xffffff8008761808 ( 263 K--More-- (23% of 11374 bytes)
B) 0xffffff8008761808 - 0xffffff80087a60fc ( 275 K--More-- (24% of 11374 bytes)
B) 0xffffffbefe7fd000 - 0xffffffbefec00000 ( 4108 K--More-- (25% of 11374 bytes)
B) 0xffffffbefee00000 - 0xffffffbeffe00000 ( 16 M--More-- (25% of 11374 bytes)
B maximum) 0xffffffbf00000000 - 0xffffffc000000000 ( 4 G--More-- (26% of 11374 bytes)
B actual) 0xffffffbf00100000 - 0xffffffbf00900000 ( 8 M--More-- (27% of 11374 bytes)
B) 0xffffffc004000000 - 0xffffffc024000000 ( 512 M--More-- (28% of 11374 bytes)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU debugfs-based tracing is enabled.
[ 0.000000] Build-time adjustment of leaf fanout to 64.
[ 0.000000] RCU restricting CPUs from NR_CPUS=64 to nr_cpu_ids=4.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=4
[ 0.000000] NR_IRQS:64 nr_irqs:64 0
ys). : Architected cp15 timer(s) running at 50.00MHz (ph--More-- (32% of 11374 bytes)
0xb8812736b, max_idle_ns: 440795202655 nser: mask: 0xffffffffffffff max_cycles:--More-- (33% of 11374 bytes)
46511100ns 6 bits at 50MHz, resolution 20ns, wraps every 43980--More-- (34% of 11374 bytes)
[ 0.000243] Console: colour dummy device 80x25
equency.. 100.00 BogoMIPS (lpj=50000) (skipped), value calculated using timer fr--More-- (35% of 11374 bytes)
[ 0.000258] pid_max: default: 32768 minimum: 301
[ 0.000306] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000309] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.000776] ASID allocator initialised with 65536 entries
[ 0.001715] Detected VIPT I-cache on CPU1
[ 0.001758] CPU1: Booted secondary processor [410fd034]
[ 0.002038] Detected VIPT I-cache on CPU2
[ 0.002062] CPU2: Booted secondary processor [410fd092]
[ 0.002302] Detected VIPT I-cache on CPU3
[ 0.002314] CPU3: Booted secondary processor [410fd092]
[ 0.002348] Brought up 4 CPUs
[ 0.002352] SMP: Total of 4 processors activated.
[ 0.002357] CPU features: detected feature: 32-bit EL0 Support
[ 0.002362] CPU: All CPU(s) started at EL1
[ 0.002379] alternatives: patching kernel code
x_idle_ns: 1911260446275000 nsffies: mask: 0xffffffff max_cycles: 0xffffffff, ma--More-- (44% of 11374 bytes)
[ 0.006793] futex hash table entries: 1024 (order: 5, 131072 bytes)
[ 0.006956] pinctrl core: initialized pinctrl subsystem
[ 0.007380] NET: Registered protocol family 16
00) (1 code @ ffffff8008557000, 1 data @ ffffff80087240--More-- (46% of 11374 bytes)
[ 0.008139] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[ 0.008610] DMA: preallocated 256 KiB pool for atomic allocations
[ 0.008652] Serial: AMBA PL011 UART driver
) is a PL011 rev2 ttyAMA0 at MMIO 0x12100000 (irq = 9, base_baud = 0--More-- (49% of 11374 bytes)
[ 0.009974] console [ttyAMA0] enabled
0) is a PL011 rev2 ttyAMA1 at MMIO 0x12101000 (irq = 10, base_baud = --More-- (50% of 11374 bytes)
0) is a PL011 rev2 ttyAMA2 at MMIO 0x12102000 (irq = 11, base_baud = --More-- (51% of 11374 bytes)
0) is a PL011 rev2 ttyAMA3 at MMIO 0x12103000 (irq = 12, base_baud = --More-- (52% of 11374 bytes)
0) is a PL011 rev2 ttyAMA4 at MMIO 0x12104000 (irq = 13, base_baud = --More-- (52% of 11374 bytes)
[ 0.027634] vgaarb: loaded
[ 0.027828] SCSI subsystem initialized
[ 0.027892] ssp-pl022 12120000.spi: ARM PL022 driver, device ID: 0x00800022
to ffffff80087d7000 0000.spi: mapped registers from 0x0000000012120000 --More-- (55% of 11374 bytes)
[ 0.028400] ssp-pl022 12121000.spi: ARM PL022 driver, device ID: 0x00800022
to ffffff80087dd000 1000.spi: mapped registers from 0x0000000012121000 --More-- (56% of 11374 bytes)
[ 0.028826] ssp-pl022 12122000.spi: ARM PL022 driver, device ID: 0x00800022
to ffffff80087f5000 2000.spi: mapped registers from 0x0000000012122000 --More-- (58% of 11374 bytes)
[ 0.029295] ssp-pl022 12123000.spi: ARM PL022 driver, device ID: 0x00800022
to ffffff80087fb000 3000.spi: mapped registers from 0x0000000012123000 --More-- (59% of 11374 bytes)
[ 0.029753] ssp-pl022 12124000.spi: ARM PL022 driver, device ID: 0x00800022
to ffffff8008801000 4000.spi: mapped registers from 0x0000000012124000 --More-- (61% of 11374 bytes)
[ 0.030491] Linux video capture interface: v2.00
[ 0.031065] clocksource: Switched to clocksource arch_sys_counter
[ 0.031141] VFS: Disk quotas dquot_6.6.0
[ 0.031182] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[ 0.033430] NET: Registered protocol family 2
[ 0.033755] TCP established hash table entries: 4096 (order: 3, 32768 bytes)
[ 0.033788] TCP bind hash table entries: 4096 (order: 4, 65536 bytes)
[ 0.033849] TCP: Hash tables configured (established 4096 bind 4096)
[ 0.033879] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.033892] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.033979] NET: Registered protocol family 1
[ 0.034375] RPC: Registered named UNIX socket transport module.
[ 0.034377] RPC: Registered udp transport module.
[ 0.034379] RPC: Registered tcp transport module.
[ 0.034381] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.034388] PCI: CLS 0 bytes, default 128
[ 0.035488] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[ 0.041417] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.041627] fuse init (API version 7.26)
[ 0.041887] yaffs: yaffs Installing.
54) SI generic (bsg) driver version 0.4 loaded (major 2--More-- (73% of 11374 bytes)
[ 0.042481] io scheduler noop registered
[ 0.042483] io scheduler deadline registered (default)
[ 0.042500] io scheduler cfq registered
[ 0.048737] Unable to detect cache hierarchy from DT for CPU 0
[ 0.052827] brd: module loaded
[ 0.055475] loop: module loaded
[ 0.212100] libphy: hisi_gemac_mii_bus: probed
[ 0.370094] libphy: hisi_gemac_mii_bus: probed
[ 0.370288] libphy: Fixed MDIO Bus: probed
d): using random MAC address 9e:c1:14:18:2a:ca(unnamed net_device) (uninitialize--More-- (77% of 11374 bytes)
[ 0.433063] attached PHY 1 to driver Generic PHY, PHY_ID=0x1cc916
[ 0.433373] Higmac dma_sg_phy: 0x0000000063c80000
[ 0.433685] ETH: rgmii, phy_addr=1
d): not find phy-mode 01e0000.ethernet (unnamed net_device) (uninitialize--More-- (80% of 11374 bytes)
[ 0.444067] hi_gmac_v200: probe of 101e0000.ethernet failed with error -22
[ 0.444292] i2c /dev entries driver
[ 0.444473] hibvt-i2c 12110000.i2c: hibvt-i2c0@100000hz registered
[ 0.444581] hibvt-i2c 12111000.i2c: hibvt-i2c1@100000hz registered
[ 0.444682] hibvt-i2c 12112000.i2c: hibvt-i2c2@100000hz registered
[ 0.444782] hibvt-i2c 12113000.i2c: hibvt-i2c3@100000hz registered
[ 0.444883] hibvt-i2c 12114000.i2c: hibvt-i2c4@100000hz registered
[ 0.444983] hibvt-i2c 12115000.i2c: hibvt-i2c5@100000hz registered
[ 0.445097] hibvt-i2c 12116000.i2c: hibvt-i2c6@100000hz registered
[ 0.445198] hibvt-i2c 12117000.i2c: hibvt-i2c7@100000hz registered
[ 0.445297] hibvt-i2c 12118000.i2c: hibvt-i2c8@100000hz registered
[ 0.445400] hibvt-i2c 12119000.i2c: hibvt-i2c9@100000hz registered
[ 0.445501] hibvt-i2c 1211a000.i2c: hibvt-i2c10@100000hz registered
[ 0.445604] hibvt-i2c 1211b000.i2c: hibvt-i2c11@100000hz registered
[ 0.445922] sdhci: Secure Digital Host Controller Interface driver
[ 0.445923] sdhci: Copyright(c) Pierre Ossman
[ 0.445925] sdhci-pltfm: SDHCI platform and OF driver helper
A 64-bit ntroller on 100f0000.eMMC [100f0000.eMMC] using ADM--More-- (91% of 11374 bytes)
-bit ntroller on 10100000.SD [10100000.SD] using ADMA 64--More-- (92% of 11374 bytes)
-bit ntroller on 10110000.SD [10110000.SD] using ADMA 64--More-- (92% of 11374 bytes)
[ 0.561546] NET: Registered protocol family 17
[ 0.564143] uart-pl011 12100000.uart: no DMA platform data
[ 0.564213] Waiting for root device /dev/mmcblk0p3...
[ 0.602416] mmc0: tuning done! valid phase shift [22, 19] Final Phase:4
[ 0.604484] mmc0: new HS400 MMC card at address 0001
[ 0.604784] mmcblk0: mmc0:0001 HAG2e 14.7 GiB
[ 0.604889] mmcblk0boot0: mmc0:0001 HAG2e partition 1 4.00 MiB
[ 0.604986] mmcblk0boot1: mmc0:0001 HAG2e partition 2 4.00 MiB
[ 0.605090] mmcblk0rpmb: mmc0:0001 HAG2e partition 3 4.00 MiB
[ 0.605274] mmcblk0: p1(boot) p2(kernel) p3()
pts: (null) k0p3): mounted filesystem with ordered data mode. O--More-- (98% of 11374 bytes)
[ 0.678974] VFS: Mounted root (ext4 filesystem) on device 179:3.
720000) kernel memory: 320K (ffffffc0046d0000 - ffffffc004--More-- (100% of 11374 bytes)
[ 0.764986] random: fast init done
可以發現,串口優化纔是終極優化,內核啓動時間被優化到了0.76秒,其他優化非常小,可以根據實際情況適當增刪!