页次: 1
目前先解决uboot加载内核慢的问题,经过排查发现SPI频率设置不对,默认是1Mhz,经过对AI的不断鞭策,AI还是给我干了点像样的活,终于有所获
1. SPI设备树节点没有设置频率,导致驱动无法获取到频率使用默认频率,驱动中的默认频率就是1Mhz
2. uboot的SPI驱动里面限制了SPI最大速度为24Mhz
解决办法
a)先解决设备树SPI节点没有设置频率的问题,在suniv-f1c100s-generic.dts文件中修改
&spi0 {
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins_a>;
spi-max-frequency = <100000000>;
status = "okay";
b)修改uboot驱动,路径在这output/build/uboot-2020.07/drivers/spi/spi-sunxi.c,修改如下:
//主要修改这个最大频率就可以
#define SUN4I_SPI_MAX_RATE 100000000
目前修改后uboot加载内核(5MByte)的速度2s这样,应该是使用FIFO的问题。
后续再优化应该是SPI速度,内核大小裁剪的问题了。
最近用LCPI-F1C200S开发板,用Buildroot-tiny200 sdk,spi nand flash,启动速度超级慢,特别是从spi_nand加载内核的时候,居然要6-7s,整个开机过程要30s这样,体验太差了,但是我看有网友可以优化到几s以内的,但是没有看到有具体的方法。
下面是启动日志,不知道有没有大佬出手帮忙看下如何优化?在网上找了几天,完全没有头绪。
14:55:05.532 -> U-Boot SPL 2020.07 (Jul 24 2025 - 11:32:13 +0800)
14:55:05.536 -> DRAM: 64 MiB
14:55:05.550 -> Trying to boot from MMC1
14:55:05.563 -> Card did not respond to voltage select!
14:55:05.564 -> spl: mmc init failed with error: -95
14:55:05.566 -> Trying to boot from MMC2
14:55:05.582 -> Card did not respond to voltage select!
14:55:05.603 -> spl: mmc init failed with error: -95
14:55:05.603 -> Trying to boot from sunxi SPI
14:55:05.603 -> SPI-NAND: GigaDevice GD5F1GQ5UEYIG
14:55:05.603 -> SPI-NAND: U-Boot address: 53248
14:55:06.312 -> U-Boot 2020.07 (Jul 24 2025 - 11:32:13 +0800) Allwinner Technology
14:55:06.317 -> CPU: Allwinner F Series (SUNIV)
14:55:06.320 -> Model: Allwinner F1C100s Generic Device
14:55:06.335 -> DRAM: 64 MiB
14:55:06.851 -> MMC:
14:55:06.870 -> Setting up a 1024x600 lcd console (overscan 0x0)
14:55:06.957 -> In: serial
14:55:06.957 -> Out: serial
14:55:06.957 -> Err: serial
14:55:06.964 -> Allwinner mUSB OTG (Peripheral)
14:55:06.968 -> Hit any key to stop autoboot: 0
14:55:06.973 -> No MMC device available
14:55:06.973 -> No MMC device available
14:55:06.995 -> unrecognized JEDEC id bytes: ff, c8, 51
14:55:06.995 -> Failed to initialize SPI flash at 0:0 (error -2)
14:55:06.995 -> List of MTD devices:
14:55:06.995 -> * spi-nand0
14:55:06.995 -> - device: spi-nand@1
14:55:06.995 -> - parent: spi@1c05000
14:55:06.995 -> - driver: spi_nand
14:55:06.997 -> - type: NAND flash
14:55:06.997 -> - block size: 0x20000 bytes
14:55:06.999 -> - min I/O: 0x800 bytes
14:55:07.002 -> - OOB size: 128 bytes
14:55:07.005 -> - OOB available: 4 bytes
14:55:07.008 -> - 0x000000000000-0x000008000000 : "spi-nand0"
14:55:07.011 -> =========================
14:55:07.014 -> Boot Device: spi
14:55:07.016 -> Boot Slot 0: empty
14:55:07.016 -> Boot Slot 1: spi-nand
14:55:07.032 -> =========================
14:55:07.032 -> Reading 524288 byte(s) (256 page(s)) at offset 0x00080000
14:55:07.654 -> Unknown command 'bmp' - try 'help'
14:55:07.657 -> gpio: pin 134 (gpio 134) value is 1
14:55:07.660 -> Booting from SPI-NAND...
14:55:07.663 -> Reading 5242880 byte(s) (2560 page(s)) at offset 0x00100000
14:55:13.967 -> ## Loading kernel from FIT Image at 81000000 ...
14:55:13.969 -> Using 'conf@0' configuration
14:55:13.972 -> Trying 'kernel@0' kernel subimage
14:55:13.974 -> Description: Linux kernel
14:55:13.977 -> Type: Kernel Image
Compression: uncompressed
Data Start: 0x810000cc
Data Size: 4309824 Bytes = 4.1 MiB
14:55:14.004 -> Architecture: ARM
14:55:14.004 -> OS: Linux
14:55:14.004 -> Load Address: 0x80000000
14:55:14.004 -> Entry Point: 0x80000000
14:55:14.004 -> Hash algo: crc32
14:55:14.004 -> Hash value: 43cbf38a
14:55:14.005 -> Verifying Hash Integrity ... crc32+ OK
14:55:14.099 -> ## Loading fdt from FIT Image at 81000000 ...
14:55:14.102 -> Using 'conf@0' configuration
14:55:14.105 -> Trying 'fdt@0' fdt subimage
14:55:14.108 -> Description: Flattened Device Tree blob
14:55:14.129 -> Type: Flat Device Tree
14:55:14.129 -> Compression: uncompressed
14:55:14.129 -> Data Start: 0x8141c4f0
14:55:14.129 -> Data Size: 15674 Bytes = 15.3 KiB
14:55:14.129 -> Architecture: ARM
14:55:14.129 -> Hash algo: crc32
14:55:14.129 -> Hash value: afd1b6d0
14:55:14.132 -> Verifying Hash Integrity ... crc32+ OK
14:55:14.135 -> Booting using the fdt blob at 0x8141c4f0
14:55:14.138 -> Loading Kernel Image
14:55:14.191 -> Loading Device Tree to 817f9000, end 817ffd39 ... OK
14:55:14.209 -> Starting kernel ...
14:55:15.327 -> [ 0.000000] Booting Linux on physical CPU 0x0
14:55:15.329 -> [ 0.000000] Linux version 5.4.99 (ubt20@ubt20-Vbox) (gcc version
8.4.0 (Buildroot -g21de572-dirty)) #1 Tue Jul 22 21:15:58 CST 2025
14:55:15.341 -> [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=
0005317f
14:55:15.359 -> [ 0.000000] CPU: VIVT data cache, VIVT instruction cache
14:55:15.359 -> [ 0.000000] OF: fdt: Machine model: Widora MangoPi R3
14:55:15.359 -> [ 0.000000] Memory policy: Data cache writeback
14:55:15.362 -> [ 0.000000] cma: Reserved 16 MiB at 0x82c00000
14:55:15.367 -> [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages
: 15660
14:55:15.373 -> [ 0.000000] Kernel command line: console=ttyS1,115200 rootwait in
it=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3 net.
ifnames=0 vt.global_cursor_default=0
14:55:15.396 -> [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 3276
8 bytes, linear)
14:55:15.398 -> [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384
bytes, linear)
14:55:15.403 -> [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:o
ff
14:55:15.412 -> [ 0.000000] Memory: 36332K/63136K available (6144K kernel code, 2
48K rwdata, 1676K rodata, 1024K init, 225K bss, 10420K reserved, 16384K cma-reserved
)
14:55:15.438 -> [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, No
des=1
14:55:15.438 -> [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
14:55:15.438 -> [ 0.000000] random: get_random_bytes called from start_kernel+0x2
54/0x444 with crng_init=0
14:55:15.445 -> [ 0.000048] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps
every 89478484971ns
14:55:15.454 -> [ 0.000131] clocksource: timer: mask: 0xffffffff max_cycles: 0xff
ffffff, max_idle_ns: 79635851949 ns
14:55:15.462 -> [ 0.000754] Console: colour dummy device 80x30
14:55:15.478 -> [ 0.000849] Calibrating delay loop... 298.59 BogoMIPS (lpj=149299
2)
14:55:15.478 -> [ 0.070201] pid_max: default: 32768 minimum: 301
14:55:15.478 -> [ 0.070619] Mount-cache hash table entries: 1024 (order: 0, 4096
bytes, linear)
14:55:15.484 -> [ 0.070660] Mountpoint-cache hash table entries: 1024 (order: 0,
4096 bytes, linear)
14:55:15.493 -> [ 0.072341] CPU: Testing write buffer coherency: ok
14:55:15.498 -> [ 0.074365] Setting up static identity map for 0x80100000 - 0x801
00058
14:55:15.503 -> [ 0.075632] devtmpfs: initialized
14:55:15.520 -> [ 0.084854] clocksource: jiffies: mask: 0xffffffff max_cycles: 0x
ffffffff, max_idle_ns: 19112604462750000 ns
14:55:15.520 -> [ 0.084913] futex hash table entries: 256 (order: -1, 3072 bytes,
linear)
14:55:15.523 -> [ 0.088631] pinctrl core: initialized pinctrl subsystem
14:55:15.539 -> [ 0.091190] NET: Registered protocol family 16
14:55:15.539 -> [ 0.093960] DMA: preallocated 256 KiB pool for atomic coherent al
locations
14:55:15.539 -> [ 0.095815] cpuidle: using governor menu
14:55:15.542 -> [ 0.131480] SCSI subsystem initialized
14:55:15.560 -> [ 0.131821] usbcore: registered new interface driver usbfs
14:55:15.560 -> [ 0.131959] usbcore: registered new interface driver hub
14:55:15.560 -> [ 0.132103] usbcore: registered new device driver usb
14:55:15.562 -> [ 0.132533] mc: Linux media interface: v0.10
14:55:15.568 -> [ 0.132641] videodev: Linux video capture interface: v2.00
14:55:15.573 -> [ 0.132745] pps_core: LinuxPPS API ver. 1 registered
14:55:15.578 -> [ 0.132760] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 R
odolfo Giometti <giometti@linux.it>
14:55:15.603 -> [ 0.132811] PTP clock support registered
14:55:15.603 -> [ 0.133786] ion_parse_dt_heap_common: id 4 type 4 name cma align
1000
14:55:15.603 -> [ 0.134646] Advanced Linux Sound Architecture Driver Initialized.
14:55:15.604 -> [ 0.136758] clocksource: Switched to clocksource timer
14:55:15.609 -> [ 0.138426] simple-framebuffer 83da8000.framebuffer: framebuffer
at 0x83da8000, 0x258000 bytes, mapped to 0x(ptrval)
14:55:15.620 -> [ 0.138478] simple-framebuffer 83da8000.framebuffer: format=x8r8g
8b8, mode=1024x600x32, linelength=4096
14:55:15.636 -> [ 0.167593] Console: switching to colour frame buffer device 128x
37
14:55:15.636 -> [ 0.194941] simple-framebuffer 83da8000.framebuffer: fb0: simplef
b registered!
14:55:15.643 -> [ 0.222941] thermal_sys: Registered thermal governor 'step_wise'
14:55:15.648 -> [ 0.223607] NET: Registered protocol family 2
14:55:15.650 -> [ 0.224969] tcp_listen_portaddr_hash hash table entries: 512 (ord
er: 0, 4096 bytes, linear)
14:55:15.659 -> [ 0.225045] TCP established hash table entries: 1024 (order: 0, 4
096 bytes, linear)
14:55:15.667 -> [ 0.225103] TCP bind hash table entries: 1024 (order: 0, 4096 byt
es, linear)
14:55:15.678 -> [ 0.225141] TCP: Hash tables configured (established 1024 bind 10
24)
14:55:15.682 -> [ 0.225449] UDP hash table entries: 256 (order: 0, 4096 bytes, li
near)
14:55:15.686 -> [ 0.225511] UDP-Lite hash table entries: 256 (order: 0, 4096 byte
s, linear)
14:55:15.695 -> [ 0.226025] NET: Registered protocol family 1
14:55:15.698 -> [ 0.228456] NetWinder Floating Point Emulator V0.97 (double preci
sion)
14:55:15.706 -> [ 0.230023] Initialise system trusted keyrings
14:55:15.715 -> [ 0.230558] workingset: timestamp_bits=30 max_order=14 bucket_ord
er=0
14:55:15.718 -> [ 0.248050] squashfs: version 4.0 (2009/01/31) Phillip Lougher
14:55:15.723 -> [ 0.248578] jffs2: version 2.2. (NAND) (SUMMARY) .. 2001-2006 Re
d Hat, Inc.
14:55:15.728 -> [ 0.324145] Key type asymmetric registered
14:55:15.734 -> [ 0.324182] Asymmetric key parser 'x509' registered
14:55:15.740 -> [ 0.324346] Block layer SCSI generic (bsg) driver version 0.4 loa
ded (major 249)
14:55:15.752 -> [ 0.324374] io scheduler mq-deadline registered
14:55:15.752 -> [ 0.324386] io scheduler kyber registered
14:55:15.754 -> [ 0.337088] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized su
nXi PIO driver
14:55:15.763 -> [ 0.357256] Serial: 8250/16550 driver, 8 ports, IRQ sharing disab
led
14:55:15.767 -> [ 0.362844] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctr
l supply vcc-pe not found, using dummy regulator
14:55:15.782 -> [ 0.384334] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 26, ba
se_baud = 6250000) is a 16550A
14:55:15.787 -> [ 0.385446] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctr
l supply vcc-pa not found, using dummy regulator
14:55:15.800 -> [ 0.407127] 1c25400.serial: ttyS1 at MMIO 0x1c25400 (irq = 27, ba
se_baud = 6250000) is a 16550A
14:55:15.806 -> [ 0.888592] printk: console [ttyS1] enabled
14:55:15.820 -> [ 0.901299] SCSI Media Changer driver v0.25
14:55:15.826 -> [ 0.907161] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctr
l supply vcc-pc not found, using dummy regulator
14:55:15.840 -> [ 0.919851] spi-nand spi0.0: GigaDevice SPI NAND was found.
14:55:15.844 -> [ 0.925446] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page s
ize: 2048, OOB size: 128
14:55:15.854 -> [ 0.935264] 4 fixed-partitions partitions found on MTD device spi
0.0
14:55:15.860 -> [ 0.941744] Creating 4 MTD partitions on "spi0.0":
14:55:15.865 -> [ 0.946558] 0x000000000000-0x000000100000 : "u-boot"
14:55:15.884 -> [ 0.958900] 0x000000100000-0x000000600000 : "kernel"
14:55:15.884 -> [ 0.964770] random: fast init done
14:55:15.907 -> [ 0.988667] 0x000000600000-0x000003000000 : "rom"
14:55:16.063 -> [ 1.143511] 0x000003000000-0x000004000000 : "overlay"
14:55:16.129 -> [ 1.208937] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) D
river
14:55:16.133 -> [ 1.215469] ehci-platform: EHCI generic platform driver
14:55:16.139 -> [ 1.221104] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Drive
r
14:55:16.144 -> [ 1.227421] ohci-platform: OHCI generic platform driver
14:55:16.151 -> [ 1.233111] usbcore: registered new interface driver usb-storage
14:55:16.157 -> [ 1.240142] usb_phy_generic usb_phy_generic.0.auto: usb_phy_gener
ic.0.auto supply vcc not found, using dummy regulator
14:55:16.172 -> [ 1.253713] i2c /dev entries driver
14:55:16.175 -> [ 1.257960] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctr
l supply vcc-pd not found, using dummy regulator
14:55:16.190 -> [ 1.271390] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin PE0 alread
y requested by 1c25000.serial; cannot claim for 1cb0000.csi
14:55:16.201 -> [ 1.282726] suniv-f1c100s-pinctrl 1c20800.pinctrl: pin-128 (1cb00
00.csi) status -22
14:55:16.210 -> [ 1.290435] suniv-f1c100s-pinctrl 1c20800.pinctrl: could not requ
est pin 128 (PE0) from group PE0 on device 1c20800.pinctrl
14:55:16.218 -> [ 1.301654] sun4i-csi 1cb0000.csi: Error applying setting, revers
e things back
14:55:16.226 -> [ 1.308946] sun4i-csi: probe of 1cb0000.csi failed with error -22
14:55:16.235 -> [ 1.316518] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout
=16 sec, nowayout=0)
14:55:16.251 -> [ 1.326310] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctr
l supply vcc-pf not found, using dummy regulator
14:55:16.283 -> [ 1.364554] sunxi-mmc 1c0f000.mmc: initialized, max. request size
: 16384 KB
14:55:16.295 -> [ 1.373775] usbcore: registered new interface driver usbhid
14:55:16.298 -> [ 1.379476] usbhid: USB HID core driver
14:55:16.301 -> [ 1.383610] sunxi-cedar 1c0e000.video-codec: sunxi cedar version
0.01alpha
14:55:16.307 -> [ 1.390915] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq
is 19
14:55:16.321 -> [ 1.402596] debugfs: Directory '1c23c00.codec' with parent 'F1C10
0s Audio Codec' already present!
14:55:16.335 -> [ 1.416552] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec ma
pping ok
14:55:16.355 -> [ 1.431305] NET: Registered protocol family 17
14:55:16.355 -> [ 1.435857] Key type dns_resolver registered
14:55:16.359 -> [ 1.441229] Loading compiled-in X.509 certificates
14:55:16.376 -> [ 1.457324] cfg80211: Loading compiled-in X.509 certificates for
regulatory database
14:55:16.391 -> [ 1.472747] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9
cea7'
14:55:16.397 -> [ 1.479596] ALSA device list:
14:55:16.409 -> [ 1.482584] #0: F1C100s Audio Codec
14:55:16.409 -> [ 1.487020] platform regulatory.0: Direct firmware load for regul
atory.db failed with error -2
14:55:16.412 -> [ 1.495676] cfg80211: failed to load regulatory.db
14:55:16.430 -> [ 1.511724] VFS: Mounted root (squashfs filesystem) readonly on d
evice 31:2.
14:55:16.458 -> [ 1.529298] devtmpfs: mounted
14:55:16.458 -> [ 1.538303] Freeing unused kernel memory: 1024K
14:55:16.460 -> [ 1.542946] Run /preinit as init process
14:55:16.483 -> [ 1.565000] random: crng init done
14:55:18.762 -> [ 3.843500] jffs2: Empty flash at 0x00c812f0 ends at 0x00c81800
14:55:18.813 -> [ 3.894858] jffs2: Empty flash at 0x00c82af0 ends at 0x00c83000
14:55:18.862 -> [ 3.943796] jffs2: Empty flash at 0x00c842f0 ends at 0x00c84800
14:55:18.916 -> [ 3.990475] jffs2: Empty flash at 0x00c85af0 ends at 0x00c86000
14:55:18.959 -> [ 4.034693] jffs2: Empty flash at 0x00c872f0 ends at 0x00c87800
14:55:19.001 -> [ 4.075984] jffs2: Empty flash at 0x00c892f0 ends at 0x00c89800
14:55:19.040 -> [ 4.114859] jffs2: Empty flash at 0x00c8aaf0 ends at 0x00c8b000
14:55:19.232 -> [ 4.313067] overlayfs: upper fs does not support tmpfile.
14:55:19.234 -> [ 4.318614] overlayfs: upper fs does not support xattr, falling b
ack to index=off and metacopy=off.
14:55:19.563 -> Starting test log: Naisu is coming!!!
14:55:19.594 -> Starting syslogd: OK
14:55:19.672 -> Starting klogd: OK
14:55:19.758 -> Running sysctl: OK
14:55:19.981 -> Populating /dev using udev: [ 5.638914] udevd[92]: starting versi
on 3.2.9
14:55:20.998 -> [ 6.078942] udevd[93]: starting eudev-3.2.9
14:55:23.473 -> [ 8.554907] Goodix-TS 0-005d: 0-005d supply AVDD28 not found, usi
ng dummy regulator
14:55:23.479 -> [ 8.562932] Goodix-TS 0-005d: 0-005d supply VDDIO not found, usin
g dummy regulator
14:55:23.551 -> [ 8.632264] ov2640 0-0030: Product ID error fa:fa
14:55:23.668 -> [ 8.748944] Goodix-TS 0-005d: ID 911, version: 1060
14:55:23.724 -> [ 8.806151] input: Goodix Capacitive TouchScreen as /devices/plat
form/soc/1c27000.i2c/i2c-0/0-005d/input/input0
14:55:24.551 -> done
14:55:24.710 -> Initializing random number generator: OK
14:55:24.753 -> Saving random seed: OK
14:55:24.841 -> Starting haveged: haveged: listening socket at 3
14:55:25.505 -> [ 10.587823] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00ed1ed0: read 0x927a2d51, calculated 0x6c8586b8.
14:55:25.607 -> [ 10.688560] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c8bacc: read 0xf583919c, calculated 0xd54850c.
14:55:25.643 -> [ 10.719076] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c8a2cc: read 0xf583919c, calculated 0xd54850c.
14:55:25.667 -> [ 10.749069] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c88acc: read 0xf583919c, calculated 0xd54850c.
14:55:25.697 -> [ 10.779074] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c86acc: read 0xf583919c, calculated 0xd54850c.
14:55:25.727 -> [ 10.809113] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c852cc: read 0xf583919c, calculated 0xd54850c.
14:55:25.764 -> [ 10.838219] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c83acc: read 0xf583919c, calculated 0xd54850c.
14:55:25.778 -> [ 10.859822] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c822cc: read 0xf583919c, calculated 0xd54850c.
14:55:25.807 -> [ 10.889116] jffs2: notice: (74) check_node_data: wrong data CRC i
n data node at 0x00c80acc: read 0xf583919c, calculated 0xd54850c.
14:55:26.412 -> OK
14:55:26.524 -> Starting network: OK
14:55:26.967 -> Starting uMTPrd: [ 12.199589] file system registered
14:55:27.632 -> [ 12.709906] read descriptors
14:55:27.632 -> [ 12.712856] read strings
14:55:28.200 -> D:thread create succeed!
积分不够,特地花了5元来体验,好像不能识别我板子上的nand flash
另外上传文件居然不支持PNP图片
开发板的nand flash信息如下:
Setting up a 1024x600 lcd console (overscan 0x0)
In: serial
Out: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot: 0
Card did not respond to voltage select!
Card did not respond to voltage select!
unrecognized JEDEC id bytes: ff, c8, f1
Failed to initialize SPI flash at 0:0 (error -2)
List of MTD devices:
* spi-nand0
- device: spi-nand@1
- parent: spi@1c05000
- driver: spi_nand
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 64 bytes
- OOB available: 31 bytes
- 0x000000000000-0x000008000000 : "spi-nand0"
已经解决无法亮屏幕的问题,总结一下:
屏幕参数配置中的:sync:0,vmode:0 这2个不用管。
在以下参数中,
CONFIG_VIDEO_LCD_MODE="x:1024,y:600,depth:18,pclk_khz:30000,le:16,ri:209,up:22,lo:22,hs:30,vs:1,sync:0,vmode:0"
一个不同分辨率的屏幕,可以尝试只修改x:1024,y:600的值,如果不行再尝试修改其他值。
fbset
mode "1024x600-0"
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
geometry 1024 600 1024 600 32
timings 0 0 0 0 0 0 0
accel false
rgba 8/16,8/8,8/0,0/0
endmode
上面这个是对的。要测试屏幕可以使用fb-test指令,也可以在命令行输入fb然后按2次tab键,会弹出支持的指令。
然后总结一下我的屏幕为什么没有起来,因为我的用的SD卡启动,而我的板子原本还有spi nand flash,flash中还有一个完整的系统。
buildroot-tiny200刚clone下来时只,启动参数在board/widora/mangopi/r3/devicetree/linux/devicetree.dts中,只有一个。
bootargs = "console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
上面这个启动参数可以让uboot,内核,设备树等从SD卡中加载。但是根文件系统是从spi flash中加载的。我的问题就出现在根文件系统没有正确加载上。
而如果要从SD卡启动,要设置参数如下
bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";
下面把2个启动参数一起贴出来。
//for NAND or Nor
//bootargs = "console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3";
//for sd-card
bootargs = "console=ttyS0,115200 earlyprintk rootwait init=/preinit root=/dev/mmcblk0p3";
这个方法我是从这个帖子上找到的:
https://whycan.com/t_9403.html
其实对于我这个板子来说,只需要修改屏幕参数中的,x y的分辨率,然后从SD卡启动就修改启动参数就可以了。如果仍然要把程序烧录到spi flash中的启动参数都不用修改。
我的这个屏幕也没有起来,我用的是cherry pi的,用的是buildroot_tiny200这个SDK,屏幕是1024*600的RGB屏,但是都没有亮屏,我用板子原来自带的img可以亮屏,只是分辨率不对。然后不知道从哪里下手了。
U-Boot SPL 2020.07 (Apr 01 2024 - 17:21:31 +0800)
DRAM: 64 MiB
Trying to boot from MMC1
U-Boot 2020.07 (Apr 01 2024 - 17:21:31 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Allwinner F1C100s Generic Device
DRAM: 64 MiB
MMC: mmc@1c0f000: 0, mmc@1c10000: 1
Setting up a 1024x600 lcd console (overscan 0x0)
In: serial
Out: serial
Err: serial
Allwinner mUSB OTG (Peripheral)
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Card did not respond to voltage select!
unrecognized JEDEC id bytes: ff, c8, f1
Failed to initialize SPI flash at 0:0 (error -2)
List of MTD devices:
* spi-nand0
- device: spi-nand@1
- parent: spi@1c05000
- driver: spi_nand
- type: NAND flash
- block size: 0x20000 bytes
- min I/O: 0x800 bytes
- OOB size: 64 bytes
- OOB available: 31 bytes
- 0x000000000000-0x000008000000 : "spi-nand0"
=========================
Boot Device: mmc0
Boot Slot 0: mmc0
Boot Slot 1: spi-nand
=========================
## Error: "splash_mmc0" not defined
Unknown command 'bmp' - try 'help'
gpio: pin 134 (gpio 134) value is 1
switch to partitions #0, OK
mmc0 is current device
Booting from MMC0...
4326664 bytes read in 700 ms (5.9 MiB/s)
## Loading kernel from FIT Image at 81000000 ...
Using 'conf@0' configuration
Trying 'kernel@0' kernel subimage
Description: Linux kernel
Type: Kernel Image
Compression: uncompressed
Data Start: 0x810000cc
Data Size: 4309200 Bytes = 4.1 MiB
Architecture: ARM
OS: Linux
Load Address: 0x80000000
Entry Point: 0x80000000
Hash algo: crc32
Hash value: 14001dca
Verifying Hash Integrity ... crc32+ OK
## Loading fdt from FIT Image at 81000000 ...
Using 'conf@0' configuration
Trying 'fdt@0' fdt subimage
Description: Flattened Device Tree blob
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x8141c280
Data Size: 15666 Bytes = 15.3 KiB
Architecture: ARM
Hash algo: crc32
Hash value: 61472816
Verifying Hash Integrity ... crc32+ OK
Booting using the fdt blob at 0x8141c280
Loading Kernel Image
Loading Device Tree to 817f9000, end 817ffd31 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 5.4.99 (jasher@ubuntu-20-04) (gcc version 8.4.0 (Buildroot -g21de572-dirty)) #2 Mon Apr 1 17:24:31 CST 2024
[ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
[ 0.000000] CPU: VIVT data cache, VIVT instruction cache
[ 0.000000] OF: fdt: Machine model: Widora MangoPi R3
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] cma: Reserved 16 MiB at 0x82800000
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 15660
[ 0.000000] Kernel command line: console=ttyS0,115200 rootwait init=/preinit root=/dev/mtdblock2 rootfstype=squashfs overlayfsdev=/dev/mtdblock3 net.ifnames=0 vt.global_cursor_default=0
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 36332K/63136K available (6144K kernel code, 248K rwdata, 1676K rodata, 1024K init, 225K bss, 10420K reserved, 16384K cma-reserved)
[ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] random: get_random_bytes called from start_kernel+0x254/0x444 with crng_init=0
[ 0.000050] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000147] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000904] Console: colour dummy device 80x30
[ 0.001014] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[ 0.070272] pid_max: default: 32768 minimum: 301
[ 0.070800] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.070849] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.072787] CPU: Testing write buffer coherency: ok
[ 0.074973] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076201] devtmpfs: initialized
[ 0.088106] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.088173] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.092937] pinctrl core: initialized pinctrl subsystem
[ 0.095594] NET: Registered protocol family 16
[ 0.100925] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.103139] cpuidle: using governor menu
[ 0.143965] SCSI subsystem initialized
[ 0.144385] usbcore: registered new interface driver usbfs
[ 0.144562] usbcore: registered new interface driver hub
[ 0.144725] usbcore: registered new device driver usb
[ 0.145178] mc: Linux media interface: v0.10
[ 0.145299] videodev: Linux video capture interface: v2.00
[ 0.145419] pps_core: LinuxPPS API ver. 1 registered
[ 0.145438] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.145499] PTP clock support registered
[ 0.146576] ion_parse_dt_heap_common: id 4 type 4 name cma align 1000
[ 0.147527] Advanced Linux Sound Architecture Driver Initialized.
[ 0.149977] clocksource: Switched to clocksource timer
[ 0.152069] simple-framebuffer 83da8000.framebuffer: framebuffer at 0x83da8000, 0x258000 bytes, mapped to 0x(ptrval)
[ 0.152128] simple-framebuffer 83da8000.framebuffer: format=x8r8g8b8, mode=1024x600x32, linelength=4096
[ 0.193823] Console: switching to colour frame buffer device 128x37
[ 0.233631] simple-framebuffer 83da8000.framebuffer: fb0: simplefb registered!
[ 0.263932] thermal_sys: Registered thermal governor 'step_wise'
[ 0.264694] NET: Registered protocol family 2
[ 0.266274] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.266364] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.266424] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.266475] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.266790] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.266860] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.267415] NET: Registered protocol family 1
[ 0.270277] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.272072] Initialise system trusted keyrings
[ 0.272711] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.294824] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.295463] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
[ 0.416041] Key type asymmetric registered
[ 0.416079] Asymmetric key parser 'x509' registered
[ 0.416253] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.416280] io scheduler mq-deadline registered
[ 0.416296] io scheduler kyber registered
[ 0.431574] suniv-f1c100s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.455343] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.461622] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pa not found, using dummy regulator
[ 0.462958] printk: console [ttyS0] disabled
[ 0.483293] 1c25400.serial: ttyS0 at MMIO 0x1c25400 (irq = 26, base_baud = 6250000) is a 16550A
[ 0.950675] printk: console [ttyS0] enabled
[ 0.965746] SCSI Media Changer driver v0.25
[ 0.971761] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[ 0.984856] spi-nand spi0.0: GigaDevice SPI NAND was found.
[ 0.990580] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[ 1.000506] 5 fixed-partitions partitions found on MTD device spi0.0
[ 1.006867] Creating 5 MTD partitions on "spi0.0":
[ 1.011810] 0x000000000000-0x000000100000 : "u-boot"
[ 1.023765] 0x000000100000-0x000000600000 : "kernel"
[ 1.029321] random: fast init done
[ 1.055731] 0x000000600000-0x000003000000 : "rom"
[ 1.228622] 0x000003000000-0x000004000000 : "vendor"
[ 1.299953] 0x000004000000-0x000007000000 : "overlay"
[ 1.495509] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 1.502182] ehci-platform: EHCI generic platform driver
[ 1.507794] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.514120] ohci-platform: OHCI generic platform driver
[ 1.519894] usbcore: registered new interface driver usb-storage
[ 1.526963] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.541010] i2c /dev entries driver
[ 1.545147] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pd not found, using dummy regulator
[ 1.558988] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pe not found, using dummy regulator
[ 1.570174] sun4i-csi 1cb0000.csi: Packed (RAW) format enabled.
[ 1.578077] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.588079] suniv-f1c100s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[ 1.626525] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[ 1.636106] usbcore: registered new interface driver usbhid
[ 1.641808] usbhid: USB HID core driver
[ 1.646018] sunxi-cedar 1c0e000.video-codec: sunxi cedar version 0.01alpha
[ 1.653379] sunxi-cedar 1c0e000.video-codec: cedar-ve the get irq is 19
[ 1.665481] debugfs: Directory '1c23c00.codec' with parent 'F1C100s Audio Codec' already present!
[ 1.680766] sun4i-codec 1c23c00.codec: Codec <-> 1c23c00.codec mapping ok
[ 1.696932] NET: Registered protocol family 17
[ 1.701633] Key type dns_resolver registered
[ 1.707224] Loading compiled-in X.509 certificates
[ 1.725195] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.743649] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.750505] ALSA device list:
[ 1.753495] #0: F1C100s Audio Codec
[ 1.757860] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1.766614] cfg80211: failed to load regulatory.db
[ 1.781227] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[ 1.799487] devtmpfs: mounted
[ 1.808637] Freeing unused kernel memory: 1024K
[ 1.813429] Run /preinit as init process
[ 1.821793] random: crng init done
[ 1.827366] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.923850] mmc0: new high speed SDHC card at address 211d
[ 1.931679] mmcblk0: mmc0:211d APPSD 7.50 GiB
[ 2.061352] mmcblk0: p1 p2 p3
[ 4.217523] jffs2: Empty flash at 0x0083c6ac ends at 0x0083c800
[ 4.227962] jffs2: Empty flash at 0x0083dc18 ends at 0x0083e000
[ 4.235989] jffs2: Empty flash at 0x0083f424 ends at 0x0083f800
[ 4.575055] jffs2: Empty flash at 0x00fe0c18 ends at 0x00fe1000
[ 4.630890] jffs2: Empty flash at 0x00fe2418 ends at 0x00fe2800
[ 4.684284] jffs2: Empty flash at 0x00fe3c18 ends at 0x00fe4000
[ 4.732680] jffs2: Empty flash at 0x00fe6880 ends at 0x00fe7000
[ 4.778417] jffs2: Empty flash at 0x00fe84d8 ends at 0x00fe8800
[ 4.821923] jffs2: Empty flash at 0x00fe9cd8 ends at 0x00fea000
[ 4.860439] jffs2: Empty flash at 0x00fec94c ends at 0x00fed000
[ 4.967520] overlayfs: upper fs does not support tmpfile.
[ 4.973105] overlayfs: upper fs does not support xattr, falling back to index=off and metacopy=off.
Starting syslogd: OK
Starting klogd: OK
Running sysctl: OK
Populating /dev using udev: [ 6.218369] udevd[91]: starting version 3.2.9
[ 6.458319] udevd[92]: starting eudev-3.2.9
done
[ 9.711082] jffs2: notice: (57) check_node_data: wrong data CRC in data node at 0x00feda88: read 0x1b0ad847, calculated 0xa81b08bd.
Initializing random number generator: OK
Saving random seed: [ 10.148232] jffs2: notice: (57) check_node_data: wrong data CRC in data node at 0x00febf74: read 0x1b0ad847, calculated 0xa80a68d8.
OK
Starting network: OK
Starting uMTPrd: [ 11.795507] file system registered
[ 12.085871] read descriptors
[ 12.088823] read strings
OK
Welcome to Widora MangoPi R3
mangopi-r3 login: [ 13.498014] configfs-gadget gadget: high-speed config #1: c
fbset 指令显示如下:
# fbset
mode "1024x600-0"
# D: 0.000 MHz, H: 0.000 kHz, V: 0.000 Hz
geometry 1024 600 1024 600 32
timings 0 0 0 0 0 0 0
accel false
rgba 8/16,8/8,8/0,0/0
endmode
/usr/include/libfdt_env.h:27:30: error: conflicting types for ‘fdt64_t’ 错误
这是u-boot在编译本机程序(使用 HOSTCC)时出现的,出现这个问题是因为你的系统版本太新了, 然后系统中的 libfdt 是比较新的,u-boot 版本比较老,而 libfdt 库改动过,u-boot 调用该库时出现兼容问题,实际上 u-boot 内置有libfdt,你把系统新的 libfdt-dev 删除,u-boot 就会调用源代码自带的旧的 libfdt, 所以只需下面命令然后重新编译:
sudo apt-get remove libfdt-dev
后面想重新安装只需:
sudo apt-get install libfdt-dev
原文链接:https://www.jianshu.com/p/ad3619db9b3d
@BlinkWee
解决了因为这个板子的SPI NAND Flash还不被sunxi-fel支持,因为我用xfel烧录时提示不支持这个nor flash,所以无法下载到spiflash中,另外我目前所用的fel是xboot的xfel,感觉好用一点,我用xboot的烧录ddr指令:sudo xfel ddr; sudo xfel write 0x80000000 f1c200s_library.bin; sudo xfel exec 0x80000000;这个指令测试了代码,是OK的,串口有输出:
F1C200S demo test!
---------------------------
其他功能还没有测试,只是初步跑起来。
页次: 1