您尚未登录。

楼主 #1 2019-07-18 20:27:15

fan12398
会员
注册时间: 2019-07-09
已发帖子: 34
积分: 33

V3s rootfs挂载失败

板子是lichee pi zero焊接上了16M spi nor flash,按照下面链接的教程搞得。
zero.lichee.pro/spi系统杂谈
rootfs是我自己用buildroot编译的,
启动串口输出如下,看起来是rootfs挂载失败,不知到是不是我的rootfs有问题。

U-Boot SPL 2017.01-rc2-00073-gdd6e8740dc-dirty (Jul 18 2019 - 13:02:19)
DRAM: 64 MiB
Trying to boot from sunxi SPI

U-Boot 2017.01-rc2-00073-gdd6e8740dc-dirty (Jul 18 2019 - 13:02:19 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000


U-Boot 2017.01-rc2-00073-gdd6e8740dc-dirty (Jul 18 2019 - 13:02:19 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
MMC:   SUNXI SD/MMC: 0
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

Setting up a 800x480 lcd console (overscan 0x0)
dotclock: 33000kHz = 33000kHz: (1 * 3MHz * 66) / 6
In:    serial@01c28000
Out:   serial@01c28000
Err:   serial@01c28000
Net:   No ethernet found.
starting USB...
No controllers found
Hit any key to stop autoboot:  0 
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB
device 0 offset 0x100000, size 0x10000
SF: 65536 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dfff2e ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.14-licheepi-zero+ (fantl@fantl-RESCUER-R720-15IKBN) (gcc version 7.4.1 20181213 [linaro-7.4-2019.02 revision 56ec6f6b99cc167ff0c2f8e1a2eed33b1edc85d4] (Linaro GCC 7.4-2019.02)) #2 SMP Thu Jul 18 19
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: Lichee Pi Zero
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] random: fast init done
[    0.000000] percpu: Embedded 16 pages/cpu @c3de6000 s33740 r8192 d23604 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 15883
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Memory: 53512K/64036K available (6144K kernel code, 284K rwdata, 1500K rodata, 1024K init, 265K bss, 10524K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xc4000000 - 0xff800000   ( 952 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xc3e89000   (  62 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0700000   (7136 kB)
[    0.000000]       .init : 0xc0900000 - 0xc0a00000   (1024 kB)
[    0.000000]       .data : 0xc0a00000 - 0xc0a470e0   ( 285 kB)
[    0.000000]        .bss : 0xc0a4e964 - 0xc0a90ee4   ( 266 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Hierarchical RCU implementation.
[    0.000000]  RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000006] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000019] Switching to timer-based delay loop, resolution 41ns
[    0.000186] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000440] Console: colour dummy device 80x30
[    0.000480] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000496] pid_max: default: 32768 minimum: 301
[    0.000625] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000638] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.001289] CPU: Testing write buffer coherency: ok
[    0.001694] /cpus/cpu@0 missing clock-frequency property
[    0.001717] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002189] Setting up static identity map for 0x40100000 - 0x40100060
[    0.002372] Hierarchical SRCU implementation.
[    0.002881] smp: Bringing up secondary CPUs ...
[    0.002896] smp: Brought up 1 node, 1 CPU
[    0.002905] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.002913] CPU: All CPU(s) started in SVC mode.
[    0.003719] devtmpfs: initialized
[    0.007055] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.007366] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.007391] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.007574] pinctrl core: initialized pinctrl subsystem
[    0.008563] NET: Registered protocol family 16
[    0.009053] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.010219] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.010237] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.022261] SCSI subsystem initialized
[    0.022505] usbcore: registered new interface driver usbfs
[    0.022578] usbcore: registered new interface driver hub
[    0.022679] usbcore: registered new device driver usb
[    0.022937] pps_core: LinuxPPS API ver. 1 registered
[    0.022949] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.022971] PTP clock support registered
[    0.023152] Advanced Linux Sound Architecture Driver Initialized.
[    0.024824] clocksource: Switched to clocksource arch_sys_counter
[    0.034488] NET: Registered protocol family 2
[    0.035161] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.035195] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[    0.035218] TCP: Hash tables configured (established 1024 bind 1024)
[    0.035349] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.035397] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.035613] NET: Registered protocol family 1
[    0.036343] RPC: Registered named UNIX socket transport module.
[    0.036364] RPC: Registered udp transport module.
[    0.036370] RPC: Registered tcp transport module.
[    0.036376] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.038304] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.044157] NFS: Registering the id_resolver key type
[    0.044208] Key type id_resolver registered
[    0.044217] Key type id_legacy registered
[    0.044267] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.048608] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    0.048632] io scheduler noop registered
[    0.048640] io scheduler deadline registered
[    0.048937] io scheduler cfq registered (default)
[    0.048948] io scheduler mq-deadline registered
[    0.048955] io scheduler kyber registered
[    0.049554] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.052876] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.053746] pwm-backlight backlight: backlight supply power not found, using dummy regulator
[    0.144294] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.147454] console [ttyS0] disabled
[    0.167733] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 34, base_baud = 1500000) is a U6_16550A
[    0.764128] console [ttyS0] enabled
[    0.770387] panel-simple panel: panel supply power not found, using dummy regulator
[    0.780572] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.786395] libphy: Fixed MDIO Bus: probed
[    0.790935] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    0.797547] ehci-platform: EHCI generic platform driver
[    0.803044] ehci-platform 1c1a000.usb: EHCI Host Controller
[    0.808727] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    0.816685] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[    0.844878] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    0.851979] hub 1-0:1.0: USB hub found
[    0.855915] hub 1-0:1.0: 1 port detected
[    0.860472] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    0.866781] ohci-platform: OHCI generic platform driver
[    0.872335] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    0.879055] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    0.887035] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[    0.959851] hub 2-0:1.0: USB hub found
[    0.963680] hub 2-0:1.0: 1 port detected
[    0.971337] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[    0.981063] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[    0.987963] sun6i-rtc 1c20400.rtc: RTC enabled
[    0.992544] i2c /dev entries driver
[    0.997467] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    1.006460] IR NEC protocol handler initialized
[    1.010996] IR RC5(x/sz) protocol handler initialized
[    1.016135] IR RC6 protocol handler initialized
[    1.020663] IR JVC protocol handler initialized
[    1.025211] IR Sony protocol handler initialized
[    1.029822] IR SANYO protocol handler initialized
[    1.034518] IR Sharp protocol handler initialized
[    1.039231] IR MCE Keyboard/mouse protocol handler initialized
[    1.045068] IR XMP protocol handler initialized
[    1.050291] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.114867] sunxi-mmc 1c0f000.mmc: base:0xc4079000 irq:24
[    1.121786] usbcore: registered new interface driver usbhid
[    1.127472] usbhid: USB HID core driver
[    1.133566] NET: Registered protocol family 17
[    1.138264] Key type dns_resolver registered
[    1.142688] Registering SWP/SWPB emulation handler
[    1.155412] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.166784] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.172547] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.183759] hub 3-0:1.0: USB hub found
[    1.187757] hub 3-0:1.0: 1 port detected
[    1.192825] using random self ethernet address
[    1.197407] using random host ethernet address
[    1.202751] usb0: HOST MAC 8e:c2:f5:ba:3e:7e
[    1.207231] usb0: MAC de:72:f7:d0:36:fc
[    1.211116] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[    1.218639] g_cdc gadget: g_cdc ready
[    1.223638] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 00:50:36 UTC (3036)
[    1.232155] vcc3v0: disabling
[    1.235190] vcc5v0: disabling
[    1.238159] ALSA device list:
[    1.241122]   No soundcards found.
[    1.245499] VFS: Cannot open root device "31:03" or unknown-block(31,3): error -19
[    1.253123] Please append a correct "root=" boot option; here are the available partitions:
[    1.261554] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,3)
[    1.269901] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.14-licheepi-zero+ #2
[    1.277198] Hardware name: Allwinner sun8i Family
[    1.281937] [<c010e894>] (unwind_backtrace) from [<c010b548>] (show_stack+0x10/0x14)
[    1.289679] [<c010b548>] (show_stack) from [<c06868e8>] (dump_stack+0x88/0x9c)
[    1.296900] [<c06868e8>] (dump_stack) from [<c011b848>] (panic+0xdc/0x248)
[    1.303777] [<c011b848>] (panic) from [<c09011dc>] (mount_block_root+0x18c/0x260)
[    1.311256] [<c09011dc>] (mount_block_root) from [<c09013d0>] (mount_root+0x120/0x128)
[    1.319165] [<c09013d0>] (mount_root) from [<c0901528>] (prepare_namespace+0x150/0x194)
[    1.327162] [<c0901528>] (prepare_namespace) from [<c0900e28>] (kernel_init_freeable+0x1c4/0x1d4)
[    1.336026] [<c0900e28>] (kernel_init_freeable) from [<c0698aa0>] (kernel_init+0x8/0x108)
[    1.344197] [<c0698aa0>] (kernel_init) from [<c0107868>] (ret_from_fork+0x14/0x2c)
[    1.351768] Rebooting in 5 seconds..

在uboot里printenv如下,

=> printenv
arch=arm
baudrate=115200
board=sunxi
board_name=sunxi
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=fel mmc0 usb0 pxe dhcp 
bootargs=console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi32766.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 rw rootfstype=jffs2
bootcmd=sf probe 0; sf read 0x41800000 0x100000 0x10000; sf read 0x41000000 0x110000 0x400000; bootz 0x41000000 - 0x41800000
bootcmd_dhcp=run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver;
bootcmd_fel=if test -n ${fel_booted} && test -n ${fel_scriptaddr}; then echo '(FEL boot)'; source ${fel_scriptaddr}; fi
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=2
bootm_size=0x2e00000
console=ttyS0,115200
cpu=armv7
dfu_alt_info_ram=kernel ram 0x41000000 0x800000;fdt ram 0x41800000 0x100000;ramdisk ram 0x41B00000 0x1000000
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
fdt_addr_r=0x41800000
fdtcontroladdr=43b57388
fdtfile=sun8i-v3s-licheepi-zero.dtb
kernel_addr_r=0x41000000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
preboot=usb start
pxefile_addr_r=0x41A00000
ramdisk_addr_r=0x41B00000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scane
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_booe
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; e
scriptaddr=0x41900000
serial#=12c00001e4d75909
soc=sunxi
stderr=serial@01c28000
stdin=serial@01c28000
stdout=serial@01c28000
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi

Environment size: 4295/32764 bytes

最近编辑记录 fan12398 (2019-07-18 20:27:45)

离线

楼主 #3 2019-07-19 09:36:17

fan12398
会员
注册时间: 2019-07-09
已发帖子: 34
积分: 33

Re: V3s rootfs挂载失败

晕哥 说:

根据log你没有生成 /dev/mtd 分区, 导致没有 /dev/mtdblockX

所以根文件系统没有跑起来

晕哥,生成 /dev/mtd 分区是在 dts文件里加上partition吗?
我按照 lichee zero 教程里通过bootargs传递给内核就是上面的结果了

离线

楼主 #10 2019-07-26 12:42:57

fan12398
会员
注册时间: 2019-07-09
已发帖子: 34
积分: 33

Re: V3s rootfs挂载失败

学习 说:
fan12398 说:
晕哥 说:

根据log你没有生成 /dev/mtd 分区, 导致没有 /dev/mtdblockX

所以根文件系统没有跑起来

晕哥,生成 /dev/mtd 分区是在 dts文件里加上partition吗?
我按照 lichee zero 教程里通过bootargs传递给内核就是上面的结果了

我也有这样的问题,请问你解决了吗?


我使用的是16M SPI flash,主线 linux,
最终试验的结果是,参考 http://nano.lichee.pro/build_sys/build_flash.html 修改设备树dts,
然后 include/configs/sun8i.h,加入如下宏,就可以挂载上去了。注意 root=31:03。

tf卡的话 参考晕哥的这篇帖子 https://whycan.cn/t_547.html ,我照着做的,一次成功。注意dd时 of=/dev/sdb,是你自己的tf卡,别写到硬盘上去了

#define CONFIG_BOOTCOMMAND   "sf probe 0; "                           \
                             "sf read 0x41800000 0x100000 0x10000; "  \
                             "sf read 0x41000000 0x110000 0x400000; " \
                             "bootz 0x41000000 - 0x41800000"

 #define CONFIG_BOOTARGS      "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
                             "root=31:03 rw rootfstype=jffs2"

最近编辑记录 fan12398 (2019-07-26 12:49:00)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn