发现在uboot在从spi-nor启动时是用1MHZ加载数据的,读取5M kernel 要5秒多 速度太慢了
使用sf probe 0 50000000 不生效,速度没变化
然后看了下代码,将
#define SPI_DEFAULT_SPEED_HZ 50000000
#define CONFIG_SF_DEFAULT_SPEED 50000000
这2个宏都修改了,打印出来速度是设置成50MHZ了,貌似没生效,依然是1MHZ速度加载
uboot新的DM_MODEL太复杂还看不懂,然后不使用DM_DRIVER,又出现
Invalid chip select 0:0 (err=-19)
Failed to initialize SPI flash at 0:0
参考了这一篇文章
https://blog.csdn.net/zhaoxinfan/article/details/79417696
离线
这是启动记录 ,发现有三个地方时间比较长
1.加载内核 5M用了6.4S
[2.210483 0.007721] device 0 offset 0x100000, size 0x500000
[8.621888 6.411405] SF: 5242880 bytes @ 0x100000 Read: OK
2.挂载20M jffs2 rootfs 4.6S
[2.598025 0.274050] [ 1.621659] random: crng init done
[5.579701 2.981676] [ 4.603341] VFS: Mounted root (jffs2 filesystem) on device 31:2.
3.初始化随机数种子 10S
[15.749774 10.148108] Initializing random number generator: OK
[0.000001 0.000001]
[0.312321 0.312320] U-Boot SPL 2020.07 (May 04 2022 - 22:11:07 +0800)
[0.317020 0.004699] DRAM: 64 MiB
[0.327749 0.010729] Trying to boot from sunxi SPI
[0.886271 0.558523]
[0.886478 0.000207]
[0.886560 0.000082] U-Boot 2020.07 (May 04 2022 - 22:11:07 +0800) Allwinner Technology
[0.892310 0.005750]
[0.892433 0.000123] CPU: Allwinner F Series (SUNIV)
[0.895404 0.002971] Model: Allwinner F1C100s Generic Device
[0.898828 0.003425] DRAM: 64 MiB
[1.428792 0.529963] Setting up a 800x480 lcd console (overscan 0x0)
[1.523858 0.095066] In: serial
[1.524756 0.000899] Out: serial
[1.525471 0.000715] Err: serial
[1.530406 0.004935] Hit any key to stop autoboot: 0
[1.539890 0.009483] SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
[1.545825 0.005936] device 0 offset 0x80000, size 0x80000
[2.188511 0.642685] SF: 524288 bytes @ 0x80000 Read: OK
[2.198806 0.010295] gpio: pin 134 (gpio 134) value is 1
[2.201701 0.002896] Booting from SPI-NOR...
[2.202761 0.001060] SF: Detected w25q256 with page size 256 Bytes, erase size 4 KiB, total 32 MiB
[2.210483 0.007721] device 0 offset 0x100000, size 0x500000
[8.621888 6.411405] SF: 5242880 bytes @ 0x100000 Read: OK
[8.624978 0.003090] ## Loading kernel from FIT Image at 81000000 ...
[8.628689 0.003711] Using 'conf@0' configuration
[8.631557 0.002868] Trying 'kernel@0' kernel subimage
[8.635610 0.004053] Description: Linux kernel
[8.638474 0.002863] Type: Kernel Image
[8.641198 0.002725] Compression: uncompressed
[8.644037 0.002839] Data Start: 0x810000cc
[8.646755 0.002717] Data Size: 4924432 Bytes = 4.7 MiB
[8.649986 0.003231] Architecture: ARM
[8.652351 0.002365] OS: Linux
[8.654952 0.002601] Load Address: 0x80000000
[8.656097 0.001145] Entry Point: 0x80000000
[8.658899 0.002802] Hash algo: crc32
[8.661201 0.002303] Hash value: 0a339eef
[8.663858 0.002657] Verifying Hash Integrity ... crc32+ OK
[8.805165 0.141307] ## Loading fdt from FIT Image at 81000000 ...
[8.808371 0.003206] Using 'conf@0' configuration
[8.811141 0.002771] Trying 'fdt@0' fdt subimage
[8.813929 0.002787] Description: Flattened Device Tree blob
[8.818855 0.004926] Type: Flat Device Tree
[8.821654 0.002799] Compression: uncompressed
[8.824597 0.002943] Data Start: 0x814b25c0
[8.827349 0.002753] Data Size: 17251 Bytes = 16.8 KiB
[8.830249 0.002899] Architecture: ARM
[8.832778 0.002529] Hash algo: crc32
[8.835350 0.002572] Hash value: b145fd30
[8.838138 0.002789] Verifying Hash Integrity ... crc32+ OK
[8.841718 0.003580] Booting using the fdt blob at 0x814b25c0
[8.844907 0.003189] Loading Kernel Image
[8.893860 0.048953] Loading Device Tree to 817f8000, end 817ff362 ... OK
[8.915193 0.021333]
[8.915327 0.000134] Starting kernel ...
[0.000514 0.000514]
[1.388993 1.388479] [ 0.000000] Booting Linux on physical CPU 0x0
[1.392876 0.003884] [ 0.000000] Linux version 5.4.99 (xfdr@Latitude-E6530) (gcc version 8.4.0 (Buildroot -g21de572-dirty)) #30 Tue May 3 21:22:16 CST 2022
[1.403568 0.010692] [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[1.411366 0.007798] [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[1.416928 0.005562] [ 0.000000] OF: fdt: Machine model: Widora MangoPi R3
[1.422384 0.005456] [ 0.000000] Memory policy: Data cache writeback
[1.425818 0.003434] [ 0.000000] cma: Reserved 16 MiB at 0x82c00000
[1.431070 0.005252] [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15883
[1.436641 0.005570] [ 0.000000] Kernel command line: console=ttyS0,115200 fbcon=map:1 rootwait init=/linuxrc root=/dev/mtdblock2 rootfstype=jffs2 rw net.ifnames=0 vt.global_cursor_default=0
[1.453128 0.016488] [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[1.458900 0.005771] [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[1.467318 0.008418] [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[1.472735 0.005417] [ 0.000000] Memory: 35004K/64036K available (7168K kernel code, 372K rwdata, 1936K rodata, 1024K init, 277K bss, 12648K reserved, 16384K cma-reserved)
[1.486672 0.013937] [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[1.492238 0.005567] [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[1.497997 0.005759] [ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[1.506332 0.008335] [ 0.000038] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[1.514480 0.008147] [ 0.000118] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[1.522801 0.008321] [ 0.000793] Console: colour dummy device 80x30
[1.528352 0.005551] [ 0.000874] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[1.534091 0.005739] [ 0.070222] pid_max: default: 32768 minimum: 301
[1.539133 0.005042] [ 0.070683] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.547285 0.008152] [ 0.070719] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.553689 0.006403] [ 0.072289] CPU: Testing write buffer coherency: ok
[1.559007 0.005319] [ 0.073878] Setting up static identity map for 0x80100000 - 0x80100058
[1.564719 0.005712] [ 0.074876] devtmpfs: initialized
[1.569613 0.004894] [ 0.086352] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[1.578178 0.008565] [ 0.086408] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[1.586387 0.008210] [ 0.089798] pinctrl core: initialized pinctrl subsystem
[1.591658 0.005270] [ 0.092059] NET: Registered protocol family 16
[1.594707 0.003049] [ 0.095466] DMA: preallocated 256 KiB pool for atomic coherent allocations
[1.602808 0.008101] [ 0.097348] cpuidle: using governor menu
[1.605809 0.003001] [ 0.176504] SCSI subsystem initialized
[1.608827 0.003018] [ 0.176816] usbcore: registered new interface driver usbfs
[1.614522 0.005695] [ 0.176949] usbcore: registered new interface driver hub
[1.620079 0.005557] [ 0.177078] usbcore: registered new device driver usb
[1.625526 0.005447] [ 0.177619] pps_core: LinuxPPS API ver. 1 registered
[1.630836 0.005309] [ 0.177641] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[1.639228 0.008393] [ 0.177698] PTP clock support registered
[1.642351 0.003123] [ 0.178192] Advanced Linux Sound Architecture Driver Initialized.
[1.650277 0.007926] [ 0.180998] clocksource: Switched to clocksource timer
[1.655509 0.005232] [ 0.182436] simple-framebuffer 83e89000.framebuffer: framebuffer at 0x83e89000, 0x177000 bytes, mapped to 0x(ptrval)
[1.664707 0.009198] [ 0.182487] simple-framebuffer 83e89000.framebuffer: format=x8r8g8b8, mode=800x480x32, linelength=3200
[1.675123 0.010416] [ 0.183110] simple-framebuffer 83e89000.framebuffer: fb0: simplefb registered!
[1.681002 0.005879] [ 0.207677] thermal_sys: Registered thermal governor 'step_wise'
[1.686728 0.005726] [ 0.208325] NET: Registered protocol family 2
[1.691934 0.005205] [ 0.209616] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[1.700221 0.008287] [ 0.209685] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.708488 0.008268] [ 0.209740] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[1.714292 0.005804] [ 0.209787] TCP: Hash tables configured (established 1024 bind 1024)
[1.722168 0.007876] [ 0.210022] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[1.727987 0.005819] [ 0.210078] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[1.733802 0.005815] [ 0.210527] NET: Registered protocol family 1
[1.739192 0.005390] [ 0.211892] RPC: Registered named UNIX socket transport module.
[1.744727 0.005536] [ 0.211924] RPC: Registered udp transport module.
[1.750152 0.005424] [ 0.211938] RPC: Registered tcp transport module.
[1.753302 0.003150] [ 0.211952] RPC: Registered tcp NFSv4.1 backchannel transport module.
[1.761297 0.007995] [ 0.214392] NetWinder Floating Point Emulator V0.97 (double precision)
[1.767172 0.005874] [ 0.215886] Initialise system trusted keyrings
[1.772370 0.005199] [ 0.216359] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[1.778056 0.005685] [ 0.238946] NFS: Registering the id_resolver key type
[1.783466 0.005410] [ 0.239084] Key type id_resolver registered
[1.786531 0.003065] [ 0.239103] Key type id_legacy registered
[1.791923 0.005392] [ 0.239149] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[1.797665 0.005742] [ 0.239240] jffs2: version 2.2. (NAND) 2001-2006 Red Hat, Inc.
[1.803279 0.005614] [ 0.350977] Key type asymmetric registered
[1.808545 0.005265] [ 0.351080] Asymmetric key parser 'x509' registered
[1.813941 0.005396] [ 0.351234] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[1.820036 0.006096] [ 0.351257] io scheduler mq-deadline registered
[1.825336 0.005300] [ 0.351273] io scheduler kyber registered
[1.828267 0.002931] [ 0.364293] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[1.836361 0.008094] [ 0.365059] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[1.847266 0.010905] [ 0.386287] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[1.853152 0.005886] [ 0.392268] printk: console [ttyS0] disabled
[1.856466 0.003314] [ 0.412533] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 29, base_baud = 6250000) is a 16550A
[1.866625 0.010159] [ 0.890454] printk: console [ttyS0] enabled
[1.870977 0.004352] [ 0.895596] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[1.903398 0.032421] [ 0.927149] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 30, base_baud = 6250000) is a 16550A
[1.916019 0.012621] [ 0.939727] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[1.936824 0.020806] [ 0.960579] SCSI Media Changer driver v0.25
[1.941579 0.004755] [ 0.966315] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[1.955532 0.013953] [ 0.979236] spi-nor spi0.0: w25q256 (32768 Kbytes)
[1.959153 0.003621] [ 0.984167] 3 fixed-partitions partitions found on MTD device spi0.0
[1.966709 0.007557] [ 0.990511] Creating 3 MTD partitions on "spi0.0":
[1.970320 0.003610] [ 0.995369] 0x000000000000-0x000000080000 : "u-boot"
[1.980064 0.009745] [ 1.003853] 0x000000100000-0x000000600000 : "kernel"
[1.988481 0.008416] [ 1.012251] 0x000000600000-0x000002000000 : "rom"
[1.997382 0.008902] [ 1.021143] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[2.003111 0.005729] [ 1.027669] ehci-platform: EHCI generic platform driver
[2.009201 0.006090] [ 1.033274] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[2.014997 0.005795] [ 1.039486] ohci-platform: OHCI generic platform driver
[2.020879 0.005883] [ 1.045228] usbcore: registered new interface driver usb-storage
[2.027705 0.006825] [ 1.052501] input: 1c23400.lradc as /devices/platform/soc/1c23400.lradc/input/input0
[2.036876 0.009172] [ 1.061221] i2c /dev entries driver
[2.040595 0.003719] [ 1.065334] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[2.056044 0.015449] [ 1.079827] rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.
[2.062724 0.006680] [ 1.087822] rtc-pcf8563 0-0051: registered as rtc0
[2.069653 0.006929] [ 1.094060] IR NEC protocol handler initialized
[2.074758 0.005105] [ 1.098595] IR RC5(x/sz) protocol handler initialized
[2.079069 0.004312] [ 1.104497] Registered IR keymap rc-empty
[2.084461 0.005392] [ 1.108774] rc rc0: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0
[2.090987 0.006526] [ 1.116026] input: sunxi-ir as /devices/platform/soc/1c22c00.cir/rc/rc0/input1
[2.099995 0.009008] [ 1.124121] sunxi-ir 1c22c00.cir: initialized sunXi IR driver
[2.107070 0.007075] [ 1.131467] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[2.117511 0.010441] [ 1.141261] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[2.155205 0.037694] [ 1.178889] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[2.162188 0.006983] [ 1.186879] ledtrig-cpu: registered to indicate activity on CPUs
[2.173243 0.011056] [ 1.197024] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[2.187350 0.014106] [ 1.211127] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[2.202675 0.015326] [ 1.226418] NET: Registered protocol family 17
[2.206585 0.003910] [ 1.231413] Key type dns_resolver registered
[2.213016 0.006430] [ 1.237012] Loading compiled-in X.509 certificates
[2.229556 0.016540] [ 1.253233] sunxi-mmc 1c0f000.mmc: card claims to support voltages below defined range
[2.243477 0.013921] [ 1.267216] rtc-pcf8563 0-0051: low voltage detected, date/time is not reliable.
[2.249735 0.006258] [ 1.274728] rtc-pcf8563 0-0051: hctosys: unable to read the hardware clock
[2.258493 0.008758] [ 1.282299] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[2.275926 0.017433] [ 1.299647] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[2.282217 0.006290] [ 1.306735] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[2.290985 0.008769] [ 1.315464] cfg80211: failed to load regulatory.db
[2.296542 0.005557] [ 1.320628] ALSA device list:
[2.299548 0.003005] [ 1.323720] #0: F1C100s Audio Codec
[2.304204 0.004657] [ 1.329091] random: fast init done
[2.323975 0.019771] [ 1.347659] mmc0: new high speed SDIO card at address 0001
[2.598025 0.274050] [ 1.621659] random: crng init done
[5.579701 2.981676] [ 4.603341] VFS: Mounted root (jffs2 filesystem) on device 31:2.
[5.588810 0.009109] [ 4.612540] devtmpfs: mounted
[5.597997 0.009187] [ 4.621797] Freeing unused kernel memory: 1024K
[5.601666 0.003669] [ 4.626412] Run /linuxrc as init process
[15.749774 10.148108] Initializing random number generator: OK
[15.773156 0.023382] Saving random seed: OK
[15.864465 0.091309] Starting network: OK
[16.226601 0.362136]
[16.226745 0.000144] Welcome to WS
[16.229263 0.002518] mes login:
离线
1.速率这个我记得uboot得设备树还有个配置要改下
2.挂载慢这个问题应该也是jffs扫描,先排查下mtd得性能吧,确认下频率和双线是否打开的
3.随机种子这个是由于中断数量不够glibc在内核头文件较高时会阻塞get_random,三个办法:a.增加中断数量 b.修改crng内核 c.将glibc内核头文件换到3.10前
离线
@shaoxi2010
1.大佬,能指点下设备要怎么改吗,直接改了源码也不行
2.spi是单线,感觉还是SPI速度太慢,不知道内核启动后SPI速度怎么查看
3.启动后我查看熵池在3000左右,好像也不低,然后添加了havged ,时间基本没变,另外2个办法还不知道怎么弄
离线