您尚未登录。

楼主 # 2022-05-09 09:47:30

jack599766257
会员
注册时间: 2022-04-09
已发帖子: 4
积分: 3

V3S SPINAND移植使用主线U-Boot和主线Linux

U-Boot移植的修改
在最新的U-Boot2022.04中已经包含了U-Boot阶段的SPINAND的驱动,但在SPL和ENV阶段只有SPINOR的驱动,这里只修改了SPL阶段,ENV阶段的bootargs可以放在内核设备树里传入。
下载U-Boot源码,添加spl_spinand_sunxi.c到arch/arm/mach-sunxi下,spl_spinand_sunxi.c由https://whycan.com/t_3123.html修改。
修改arch/arm/mach-sunxi/Kconfig,添加

config SPL_SPINAND_SUNXI
	bool "Support for SPI Nand Flash on Allwinner SoCs in SPL"
	depends on MACH_SUN8I_V3S
	help
	  Enable support for SPI Nand Flash. This option allows SPL to read from
	  sunxi SPI Nand Flash. It uses the same method as the boot ROM, so does
	  not need any extra configuration.

修改arch/arm/mach-sunxi/Makefile,添加obj-$(CONFIG_SPL_SPINAND_SUNXI)    += spl_spinand_sunxi.o
修改arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts,添加

&spi0 {
    pinctrl-0 = <&spi0_pins>;
    pinctrl-names = "default";
    status = "okay";
    flash@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "spi-nand";
        reg = <0>;
        spi-max-frequency = <50000000>;
	};
};

修改include/configs/sun8i.h,添加

#define CONFIG_BOOTCOMMAND  "mtd read spi-nand0 0x41800000 0x100000 0x20000; "  \
                            "mtd read spi-nand0 0x41000000 0x120000 0x500000; " \
                            "bootz 0x41000000 - 0x41800000"

 #define CONFIG_BOOTARGS    "console=ttyS0,115200 earlyprintk panic=5 rootwait " \
                            "mtdparts=spi0.0:1M(uboot)ro,128k(dtb)ro,5M(kernel)ro,-(rootfs) ubi.mtd=3 root=ubi0:rootfs rw rootfstype=ubifs"

注: SPINAND使用的是MX35LF1GE4AB,一页2K,故设备树的读取要读取至少1页故修改成0x20000,linux5.2内核编译后大小已经超过了4M,故修改为0x500000。CONFIG_BOOTARGS实际上是不起作用的,由于ENV处没有spinand驱动(懒得写)且可以在内核设备树传入启动参数,这里预留为后续使用。

执行make ARCH=arm LicheePi_Zero_defconfig,再执行make ARCH=arm menuconfig,修改
ARM architecture勾选Support for SPI Nand Flash on Allwinner SoCs in SPL
Boot options取消掉Enable boot arguments
Device Drivers->MTD Support勾选Enable MTD layer   Enable Driver Model for MTD drivers   SPI NAND device Support
Command line interface->Device access commands勾选mtd
Environment取消勾选Environment is in SPI flash
保存,make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j8编译生成u-boot-sunxi-with-spl.bin,但是这个镜像不能直接使用。
使用spl_split_exp 2048 u-boot-sunxi-with-spl.bin生成u-boot-sunxi-with-spl.bin_split_exp,(需要将spl段按每页1k写入,在spl_spinand_sunxi.c已经将uboot payload offset扩大了一倍) 此镜像可用于烧录。

主线Linux5.2内核的移植
使用LicheePi Zero的Linux5.2 github修改。
修改设备树文件arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts
chosen结点:

chosen {
		stdout-path = "serial0:115200n8";
		bootargs = "console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi0.0:1M(uboot)ro,128k(dtb)ro,5M(kernel)ro,-(rootfs) ubi.mtd=3 root=ubi0:rootfs rw rootfstype=ubifs";
	};

增加spi0结点:

&spi0 {
	status ="okay";
	
	spi_nand: spi_nand@0 {
        #address-cells = <1>;
        #size-cells = <1>;
        compatible = "spi-nand";
        reg = <0>;
        spi-max-frequency = <50000000>;

		partition@0 {
			label = "uboot";
			reg = <0x0 0x100000>;
			read-only;
		};

		partition@100000 {
			label = "dtb";
			reg = <0x100000 0x20000>;
			read-only;
		};

		partition@120000 {
			label = "kernel";
			reg = <0x120000 0x500000>;
			read-only;
		};

		partition@620000 {
			label = "rootfs";
			reg = <0x620000 0x79E0000>;
		};
	};
};

运行make ARCH=arm licheepi_zero_defconfig,在运行make ARCH=arm menuconfig,修改
Device Drivers->Memory Technology Device (MTD) support勾选SPI NAND device Support   Enable UBI - Unsorted block images
File Systems->Miscellaneous filesystems勾选UBIFS file system support
保存,make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j8生产zImage和dtb

UBIFS根文件系统的制作
可以自己使用buildroot生成,这里提供一个LicheePi Zero使用的一个mini的文件系统,解压放置于脚本同级目录,先运行make_ubifs.sh再运行make_ubiimg.sh生成ubi.img。

打包并烧录
将u-boot-sunxi-with-spl.bin_split_exp、sun8i-v3s-licheepi-zero.dtb、zImage、ubi.img和make_flashimg_ubifs.sh放在同一目录下,运行make_flashimg_ubifs.sh生成flashimg.bin。
连接V3s并进入fel模式,下载编译xfel工具,使用xfel spinand write 0 flashimg.bin将镜像烧录至spinand。完成后重启即可。

用到的文件
V3s SPINAND.zip

附:启动日志

U-Boot SPL 2022.04 (May 01 2022 - 12:30:18 +0800)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Found Macronix MX35LF1GE4AB (c212c2)
sunxi SPI-NAND: Loading u-boot from 0x10000
sunxi SPI-NAND: u-boot hcrc OK!


U-Boot 2022.04 (May 01 2022 - 12:30:18 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
Core:  23 devices, 11 uclasses, devicetree: separate
WDT:   Not starting watchdog@1c20ca0
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... Card did not respond to voltage select! : -110
In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
Reading 131072 byte(s) (64 page(s)) at offset 0x00100000
Reading 5242880 byte(s) (2560 page(s)) at offset 0x00120000
Kernel image @ 0x41000000 [ 0x000000 - 0x443c68 ]
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffddf ... OK

Starting kernel ...

  0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero+ (root@ASUS) (gcc version 7.5.0 (Linaro GCC 7.5-2019.12)) #19 SMP Thu May 5 23:54:21 CST 2022
[    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] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi0.0:1M(uboot)ro,128k(dtb)ro,5M(kernel)ro,-(rootfs) ubi.mtd=3 root=ubi0:rootfs rw rootfstype=ubifs
[    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: 54004K/65536K available (7168K kernel code, 308K rwdata, 1736K rodata, 1024K init, 257K bss, 11532K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    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] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[    0.000000] random: get_random_bytes called from start_kernel+0x2f8/0x484 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    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.000198] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000432] Console: colour dummy device 80x30
[    0.000488] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000504] pid_max: default: 32768 minimum: 301
[    0.000663] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000676] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001466] CPU: Testing write buffer coherency: ok
[    0.001975] /cpus/cpu@0 missing clock-frequency property
[    0.001999] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002799] Setting up static identity map for 0x40100000 - 0x40100060
[    0.003013] rcu: Hierarchical SRCU implementation.
[    0.003559] smp: Bringing up secondary CPUs ...
[    0.003581] smp: Brought up 1 node, 1 CPU
[    0.003591] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003597] CPU: All CPU(s) started in HYP mode.
[    0.003601] CPU: Virtualization extensions available.
[    0.004692] devtmpfs: initialized
[    0.008070] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008369] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008400] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.008649] pinctrl core: initialized pinctrl subsystem
[    0.009669] NET: Registered protocol family 16
[    0.010329] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.011562] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.011580] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.039464] SCSI subsystem initialized
[    0.039651] usbcore: registered new interface driver usbfs
[    0.039705] usbcore: registered new interface driver hub
[    0.039808] usbcore: registered new device driver usb
[    0.040023] mc: Linux media interface: v0.10
[    0.040080] videodev: Linux video capture interface: v2.00
[    0.040458] Advanced Linux Sound Architecture Driver Initialized.
[    0.042285] clocksource: Switched to clocksource arch_sys_counter
[    0.053860] NET: Registered protocol family 2
[    0.054694] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.054736] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.054762] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.054784] TCP: Hash tables configured (established 1024 bind 1024)
[    0.054919] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.054971] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.055268] NET: Registered protocol family 1
[    0.057102] Initialise system trusted keyrings
[    0.057469] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.102646] Key type asymmetric registered
[    0.102667] Asymmetric key parser 'x509' registered
[    0.102770] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.102783] io scheduler mq-deadline registered
[    0.102789] io scheduler kyber registered
[    0.103783] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.107458] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.176836] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.179181] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.180279] printk: console [ttyS0] disabled
[    0.200582] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[    0.737032] printk: console [ttyS0] enabled
[    0.766932] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.778370] spi-nand spi0.0: Macronix SPI NAND was found.
[    0.783863] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.792727] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.799084] Creating 4 MTD partitions on "spi0.0":
[    0.803965] 0x000000000000-0x000000100000 : "uboot"
[    0.811399] 0x000000100000-0x000000120000 : "dtb"
[    0.817316] 0x000000120000-0x000000620000 : "kernel"
[    0.824031] random: fast init done
[    0.834894] 0x000000620000-0x000008000000 : "rootfs"
[    1.007031] random: crng init done
[    1.037632] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.044238] ehci-platform: EHCI generic platform driver
[    1.049764] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.055456] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.063424] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    1.092299] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.099495] hub 1-0:1.0: USB hub found
[    1.103439] hub 1-0:1.0: 1 port detected
[    1.108015] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.114328] ohci-platform: OHCI generic platform driver
[    1.119867] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.126608] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.134572] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    1.207324] hub 2-0:1.0: USB hub found
[    1.211158] hub 2-0:1.0: 1 port detected
[    1.218477] usbcore: registered new interface driver usb-storage
[    1.226075] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.231136] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.235846] i2c /dev entries driver
[    1.240685] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    1.250329] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.259001] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.294915] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.302474] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.313816] usbcore: registered new interface driver usbhid
[    1.319392] usbhid: USB HID core driver
[    1.325898] Initializing XFRM netlink socket
[    1.330210] NET: Registered protocol family 17
[    1.335343] Registering SWP/SWPB emulation handler
[    1.341267] Loading compiled-in X.509 certificates
[    1.355330] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.366846] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.372690] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.382050] hub 3-0:1.0: USB hub found
[    1.386049] hub 3-0:1.0: 1 port detected
[    1.391787] ubi0: attaching mtd3
[    2.425271] ubi0: scanning is finished
[    2.444176] ubi0: attached mtd3 (name "rootfs", size 121 MiB)
[    2.449969] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.456907] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.463706] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.470658] ubi0: good PEBs: 973, bad PEBs: 2, corrupted PEBs: 0
[    2.476670] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    2.483894] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 1911005616
[    2.493024] ubi0: available PEBs: 0, total reserved PEBs: 973, PEBs reserved for bad PEB handling: 18
[    2.502308] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:01:05 UTC (65)
[    2.510551] vcc3v0: disabling
[    2.513581] vcc5v0: disabling
[    2.516550] ALSA device list:
[    2.519513]   No soundcards found.
[    2.523588] ubi0: background thread "ubi_bgt0d" started, PID 94
[    2.531835] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    2.540094] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 95
[    2.612482] UBIFS (ubi0:0): recovery needed
[    2.796578] UBIFS (ubi0:0): recovery completed
[    2.801165] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    2.808620] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.818542] UBIFS (ubi0:0): FS size: 100184064 bytes (95 MiB, 789 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[    2.829060] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    2.834899] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID ED8B6288-11AB-406A-A3DB-003DE49155BF, small LPT model
[    2.848255] VFS: Mounted root (ubifs filesystem) on device 0:12.
[    2.858269] devtmpfs: mounted
[    2.862482] Freeing unused kernel memory: 1024K
[    2.867190] Run /sbin/init as init process
Starting logging: OK
Starting mdev...
/etc/init.d/S10mdev: line 21: can't create /proc/sys/kernel/hotplug: nonexistent directory
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network: OK

Welcome to Lichee Pi
Lichee login: 

最近编辑记录 jack599766257 (2022-05-09 20:33:48)

离线

#1 2022-05-09 11:58:54

zhang235hai
会员
注册时间: 2020-04-06
已发帖子: 212
积分: 165

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

感谢楼主分享,我试试看能不能成功

离线

#2 2022-05-09 14:54:56

zhang235hai
会员
注册时间: 2020-04-06
已发帖子: 212
积分: 165

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

按照楼主的操作编译后报错如下
arch/arm/mach-sunxi/spl_spinand_sunxi.o: In function `spl_spi_load_image':
/home/zhang/u-boot-2202.04-rc5/arch/arm/mach-sunxi/spl_spinand_sunxi.c:624: undefined reference to `spl_parse_image_header'
Makefile:1801: recipe for target 'u-boot' failed
make: *** [u-boot] Error 1

离线

楼主 #3 2022-05-09 20:11:02

jack599766257
会员
注册时间: 2022-04-09
已发帖子: 4
积分: 3

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

@zhang235hai
看一下defconfig文件中是否有CONFIG_SPL=y

离线

#4 2022-05-10 08:21:57

zhang235hai
会员
注册时间: 2020-04-06
已发帖子: 212
积分: 165

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

jack599766257 说:

@zhang235hai
看一下defconfig文件中是否有CONFIG_SPL=y


/configs/LicheePi_Zero_defconfig 文件中有CONFIG_SPL=y
文件内容如下
CONFIG_ARM=y
CONFIG_ARCH_SUNXI=y
CONFIG_DEFAULT_DEVICE_TREE="sun8i-v3s-licheepi-zero"
CONFIG_SPL=y
CONFIG_MACH_SUN8I_V3S=y
CONFIG_DRAM_CLK=360
# CONFIG_NETDEVICES is not set

离线

#5 2022-05-11 20:51:04

shawn.d
会员
注册时间: 2020-09-12
已发帖子: 164
积分: 95

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

SPI NAND好是好,但听说比较容易坏。

离线

#6 2022-05-11 21:16:43

cube
会员
注册时间: 2021-03-11
已发帖子: 288
积分: 202.5

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

shawn.d 说:

SPI NAND好是好,但听说比较容易坏。

nand只读分区都有机会挂,用了nand就要做好接收返修机的准备,或者给客户一个重新刷机的机会。

离线

#7 2022-07-13 13:53:01

ronz
会员
注册时间: 2021-11-19
已发帖子: 31
积分: 31

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

@zhang235hai
我刚刚也试了试,确实一样的错

离线

#8 2022-07-14 09:11:52

ronz
会员
注册时间: 2021-11-19
已发帖子: 31
积分: 31

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

ronz 说:

@zhang235hai
我刚刚也试了试,确实一样的错

解决了

楼主这句话:
修改arch/arm/mach-sunxi/Makefile,添加obj-$(CONFIG_SPL_SPINAND_SUNXI)    += spl_spinand_sunxi.o

修改下
修改arch/arm/mach-sunxi/Makefile,

ifdef CONFIG_SPL_BUILD
里添加
obj-$(CONFIG_SPL_SPINAND_SUNXI)    += spl_spinand_sunxi.o

示例

# SPDX-License-Identifier: GPL-2.0+
#
# (C) Copyright 2012 Henrik Nordstrom <henrik@henriknordstrom.net>
#
# Based on some other Makefile
# (C) Copyright 2000-2003
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.

obj-y	+= board.o
obj-y	+= clock.o
obj-y	+= cpu_info.o
obj-y	+= dram_helpers.o
obj-y	+= pinmux.o
obj-$(CONFIG_SUN6I_PRCM)	+= prcm.o
obj-$(CONFIG_AXP_PMIC_BUS)	+= pmic_bus.o
obj-$(CONFIG_MACH_SUNIV)	+= clock_sun6i.o
obj-$(CONFIG_MACH_SUN4I)	+= clock_sun4i.o
obj-$(CONFIG_MACH_SUN5I)	+= clock_sun4i.o
obj-$(CONFIG_MACH_SUN6I)	+= clock_sun6i.o
obj-$(CONFIG_MACH_SUN7I)	+= clock_sun4i.o
obj-$(CONFIG_MACH_SUN50I)	+= clock_sun6i.o
ifdef CONFIG_MACH_SUN8I_A83T
obj-y				+= clock_sun8i_a83t.o
else
obj-$(CONFIG_MACH_SUN8I)	+= clock_sun6i.o
endif
obj-$(CONFIG_MACH_SUN9I)	+= clock_sun9i.o gtbus_sun9i.o
obj-$(CONFIG_SUN50I_GEN_H6)	+= clock_sun50i_h6.o
ifndef CONFIG_ARM64
obj-y	+= timer.o
endif

ifdef CONFIG_SPL_BUILD
obj-$(CONFIG_MACH_SUNIV)	+= dram_suniv.o
obj-$(CONFIG_DRAM_SUN4I)	+= dram_sun4i.o
obj-$(CONFIG_DRAM_SUN6I)	+= dram_sun6i.o
obj-$(CONFIG_DRAM_SUN8I_A23)	+= dram_sun8i_a23.o
obj-$(CONFIG_DRAM_SUN8I_A33)	+= dram_sun8i_a33.o
obj-$(CONFIG_DRAM_SUN8I_A83T)	+= dram_sun8i_a83t.o
obj-$(CONFIG_DRAM_SUN9I)	+= dram_sun9i.o
obj-$(CONFIG_SPL_SPI_SUNXI)	+= spl_spi_sunxi.o
obj-$(CONFIG_SUNXI_DRAM_DW)	+= dram_sunxi_dw.o
obj-$(CONFIG_SUNXI_DRAM_DW)	+= dram_timings/
obj-$(CONFIG_DRAM_SUN50I_H6)	+= dram_sun50i_h6.o
obj-$(CONFIG_DRAM_SUN50I_H6)	+= dram_timings/
obj-$(CONFIG_DRAM_SUN50I_H616)	+= dram_sun50i_h616.o
obj-$(CONFIG_DRAM_SUN50I_H616)	+= dram_timings/
obj-$(CONFIG_SPL_SPINAND_SUNXI)    += spl_spinand_sunxi.o
endif

最近编辑记录 ronz (2022-07-14 09:13:40)

离线

#11 2022-10-27 16:47:55

gyushi
会员
注册时间: 2022-09-26
已发帖子: 3
积分: 0

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

按照楼主的方式修改后,启动kernel出现错误。麻烦大佬给看下问题;

[    3.565118] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.579899] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.595157] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.610462] ubi0 error: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read 61 bytes

U-Boot SPL 2022.04-dirty (Oct 27 2022 - 17:26:33 +0800)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Found Winbond W25N01GVxxIG (efaa21)
sunxi SPI-NAND: Loading u-boot from 0x10000
sunxi SPI-NAND: u-boot hcrc OK!


U-Boot 2022.04-dirty (Oct 27 2022 - 17:26:33 +0800) Allwinner Technology

CPU:   Allwinner V3s (SUN8I 1681)
Model: Lichee Pi Zero
DRAM:  64 MiB
Core:  23 devices, 11 uclasses, devicetree: separate
WDT:   Not starting watchdog@1c20ca0
MMC:   mmc@1c0f000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... 
In:    serial@1c28000
Out:   serial@1c28000
Err:   serial@1c28000
Net:   No ethernet found.
Hit any key to stop autoboot:  0 
Reading 131072 byte(s) (64 page(s)) at offset 0x00100000
Reading 5242880 byte(s) (2560 page(s)) at offset 0x00120000
Kernel image @ 0x41000000 [ 0x000000 - 0x4448a0 ]
## Flattened Device Tree blob at 41800000
   Booting using the fdt blob at 0x41800000
   Loading Device Tree to 42dfa000, end 42dffddf ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.2.0-licheepi-zero+ (gys@gys) (gcc version 6.3.1 20170109 (Linaro GCC 6.3-2017.02)) #3 SMP Thu Oct 27 16:12:34 CST 2022
[    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] psci: probing for conduit method from DT.
[    0.000000] psci: Using PSCI v0.1 Function IDs from DT
[    0.000000] percpu: Embedded 16 pages/cpu s34508 r8192 d22836 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 earlyprintk panic=5 rootwait mtdparts=spi0.0:1M(uboot)ro,128k(dtb)ro,5M(kernel)ro,-(rootfs) ubi.mtd=3 root=ubi0:rootfs rw rootfstype=ubifs
[    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: 54008K/65536K available (7168K kernel code, 308K rwdata, 1736K rodata, 1024K init, 257K bss, 11528K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    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] GIC: GICv2 detected, but range too small and irqchip.gicv2_force_probe not set
[    0.000000] random: get_random_bytes called from start_kernel+0x300/0x48c with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[    0.000008] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[    0.000020] Switching to timer-based delay loop, resolution 41ns
[    0.000199] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000434] Console: colour dummy device 80x30
[    0.000489] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.000506] pid_max: default: 32768 minimum: 301
[    0.000666] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.000683] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.001490] CPU: Testing write buffer coherency: ok
[    0.001990] /cpus/cpu@0 missing clock-frequency property
[    0.002016] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[    0.002768] Setting up static identity map for 0x40100000 - 0x40100060
[    0.002984] rcu: Hierarchical SRCU implementation.
[    0.003512] smp: Bringing up secondary CPUs ...
[    0.003531] smp: Brought up 1 node, 1 CPU
[    0.003541] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[    0.003548] CPU: All CPU(s) started in HYP mode.
[    0.003553] CPU: Virtualization extensions available.
[    0.004627] devtmpfs: initialized
[    0.008060] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[    0.008360] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.008392] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.008654] pinctrl core: initialized pinctrl subsystem
[    0.009658] NET: Registered protocol family 16
[    0.010319] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.011576] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[    0.011593] hw-breakpoint: maximum watchpoint size is 8 bytes.
[    0.038551] SCSI subsystem initialized
[    0.038731] usbcore: registered new interface driver usbfs
[    0.038786] usbcore: registered new interface driver hub
[    0.038890] usbcore: registered new device driver usb
[    0.039114] mc: Linux media interface: v0.10
[    0.039175] videodev: Linux video capture interface: v2.00
[    0.039374] Advanced Linux Sound Architecture Driver Initialized.
[    0.040933] clocksource: Switched to clocksource arch_sys_counter
[    0.052716] NET: Registered protocol family 2
[    0.053532] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.053574] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.053599] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.053623] TCP: Hash tables configured (established 1024 bind 1024)
[    0.053766] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.053817] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.054115] NET: Registered protocol family 1
[    0.055961] Initialise system trusted keyrings
[    0.056326] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.094438] Key type asymmetric registered
[    0.094459] Asymmetric key parser 'x509' registered
[    0.094560] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.094575] io scheduler mq-deadline registered
[    0.094583] io scheduler kyber registered
[    0.095575] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[    0.099261] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.168004] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.170351] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pb not found, using dummy regulator
[    0.171539] printk: console [ttyS0] disabled
[    0.191826] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 33, base_baud = 1500000) is a U6_16550A
[    0.728873] printk: console [ttyS0] enabled
[    0.757684] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pc not found, using dummy regulator
[    0.769119] spi-nand spi0.0: Winbond SPI NAND was found.
[    0.774522] spi-nand spi0.0: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.783365] 4 fixed-partitions partitions found on MTD device spi0.0
[    0.789722] Creating 4 MTD partitions on "spi0.0":
[    0.794610] 0x000000000000-0x000000100000 : "uboot"
[    0.802442] 0x000000100000-0x000000120000 : "dtb"
[    0.808166] 0x000000120000-0x000000620000 : "kernel"
[    0.814793] random: fast init done
[    0.828085] 0x000000620000-0x000008000000 : "rootfs"
[    1.005439] random: crng init done
[    1.092462] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.098998] ehci-platform: EHCI generic platform driver
[    1.104613] ehci-platform 1c1a000.usb: EHCI Host Controller
[    1.110250] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[    1.118245] ehci-platform 1c1a000.usb: irq 25, io mem 0x01c1a000
[    1.150942] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[    1.158114] hub 1-0:1.0: USB hub found
[    1.162063] hub 1-0:1.0: 1 port detected
[    1.166649] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.172971] ohci-platform: OHCI generic platform driver
[    1.178506] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[    1.185227] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[    1.193180] ohci-platform 1c1a400.usb: irq 26, io mem 0x01c1a400
[    1.265949] hub 2-0:1.0: USB hub found
[    1.269773] hub 2-0:1.0: 1 port detected
[    1.277090] usbcore: registered new interface driver usb-storage
[    1.284706] sun6i-rtc 1c20400.rtc: registered as rtc0
[    1.289769] sun6i-rtc 1c20400.rtc: RTC enabled
[    1.294476] i2c /dev entries driver
[    1.299317] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input0
[    1.308933] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[    1.317632] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pf not found, using dummy regulator
[    1.353598] sunxi-mmc 1c0f000.mmc: initialized, max. request size: 16384 KB
[    1.361166] sun8i-v3s-pinctrl 1c20800.pinctrl: 1c20800.pinctrl supply vcc-pg not found, using dummy regulator
[    1.372509] usbcore: registered new interface driver usbhid
[    1.378086] usbhid: USB HID core driver
[    1.384636] Initializing XFRM netlink socket
[    1.388945] NET: Registered protocol family 17
[    1.394080] Registering SWP/SWPB emulation handler
[    1.399980] Loading compiled-in X.509 certificates
[    1.414098] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[    1.425613] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[    1.431465] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[    1.440802] hub 3-0:1.0: USB hub found
[    1.444806] hub 3-0:1.0: 1 port detected
[    1.450579] ubi0: attaching mtd3
[    1.479896] mmc0: host does not support reading read-only switch, assuming write-enable
[    1.492964] mmc0: new high speed SD card at address 2117
[    1.504120] mmcblk0: mmc0:2117 APPSD 239 MiB 
[    1.515337]  mmcblk0: p1
[    2.096264] ubi0: scanning is finished
[    2.141684] ubi0: volume 0 ("rootfs") re-sized from 826 to 951 LEBs
[    2.148804] ubi0: attached mtd3 (name "rootfs", size 121 MiB)
[    2.154636] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.161527] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.168306] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.175269] ubi0: good PEBs: 975, bad PEBs: 0, corrupted PEBs: 0
[    2.181280] ubi0: user volume: 1, internal volumes: 1, max. volumes count: 128
[    2.188493] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 630478368
[    2.197536] ubi0: available PEBs: 0, total reserved PEBs: 975, PEBs reserved for bad PEB handling: 20
[    2.206825] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:08:42 UTC (522)
[    2.215181] vcc3v0: disabling
[    2.218157] vcc5v0: disabling
[    2.221172] ALSA device list:
[    2.224139]   No soundcards found.
[    2.228084] ubi0: background thread "ubi_bgt0d" started, PID 96
[    2.245454] UBIFS (ubi0:0): Mounting in unauthenticated mode
[    2.254482] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 97
[    2.455129] UBIFS (ubi0:0): UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[    2.462604] UBIFS (ubi0:0): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[    2.472529] UBIFS (ubi0:0): FS size: 100184064 bytes (95 MiB, 789 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs)
[    2.483064] UBIFS (ubi0:0): reserved for root: 0 bytes (0 KiB)
[    2.488895] UBIFS (ubi0:0): media format: w4/r0 (latest is w5/r0), UUID 4811226A-CD64-4A45-BABB-96C0111F9C3C, small LPT model
[    2.513345] VFS: Mounted root (ubifs filesystem) on device 0:12.
[    2.531658] devtmpfs: mounted
[    2.537938] Freeing unused kernel memory: 1024K
[    2.545152] Run /sbin/init as init process
[    3.565118] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.579899] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.595157] ubi0 warning: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read only 61 bytes, retry
[    3.610462] ubi0 error: ubi_io_read: error -74 (ECC error) while reading 61 bytes from PEB 30:61440, read 61 bytes
[    3.620912] CPU: 0 PID: 1 Comm: init Not tainted 5.2.0-licheepi-zero+ #3
[    3.627604] Hardware name: Allwinner sun8i Family
[    3.632334] [<c010ed14>] (unwind_backtrace) from [<c010b72c>] (show_stack+0x10/0x14)
[    3.640076] [<c010b72c>] (show_stack) from [<c0718cb0>] (dump_stack+0x84/0x98)
[    3.647298] [<c0718cb0>] (dump_stack) from [<c04e8314>] (ubi_io_read+0x154/0x344)
[    3.654781] [<c04e8314>] (ubi_io_read) from [<c04e609c>] (ubi_eba_read_leb+0x98/0x428)
[    3.662692] [<c04e609c>] (ubi_eba_read_leb) from [<c04e4dc0>] (ubi_leb_read+0x74/0xb4)
[    3.670608] [<c04e4dc0>] (ubi_leb_read) from [<c0304fec>] (ubifs_leb_read+0x2c/0x78)
[    3.678348] [<c0304fec>] (ubifs_leb_read) from [<c0306860>] (ubifs_read_node+0x94/0x250)
[    3.686438] [<c0306860>] (ubifs_read_node) from [<c0323128>] (ubifs_tnc_read_node+0x48/0x10c)
[    3.694958] [<c0323128>] (ubifs_tnc_read_node) from [<c03088d4>] (tnc_read_hashed_node+0x138/0x1b8)
[    3.703996] [<c03088d4>] (tnc_read_hashed_node) from [<c0309ae0>] (ubifs_tnc_locate+0x1a4/0x1dc)
[    3.712772] [<c0309ae0>] (ubifs_tnc_locate) from [<c030a240>] (ubifs_tnc_lookup_nm+0x38/0x13c)
[    3.721375] [<c030a240>] (ubifs_tnc_lookup_nm) from [<c02fe11c>] (ubifs_lookup+0x21c/0x32c)
[    3.729725] [<c02fe11c>] (ubifs_lookup) from [<c0220d48>] (__lookup_slow+0x8c/0x154)
[    3.737465] [<c0220d48>] (__lookup_slow) from [<c0220e40>] (lookup_slow+0x30/0x44)
[    3.745029] [<c0220e40>] (lookup_slow) from [<c0222de4>] (walk_component+0x1d0/0x310)
[    3.752851] [<c0222de4>] (walk_component) from [<c02234dc>] (path_lookupat+0x68/0x1f4)
[    3.760761] [<c02234dc>] (path_lookupat) from [<c0225790>] (filename_lookup+0x9c/0x10c)
[    3.768760] [<c0225790>] (filename_lookup) from [<c0212868>] (do_faccessat+0xac/0x22c)
[    3.776672] [<c0212868>] (do_faccessat) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[    3.784490] Exception stack(0xc3833fa8 to 0xc3833ff0)
[    3.789539] 3fa0:                   00000063 00000008 000b1b72 00000006 00000000 00000000
[    3.797708] 3fc0: 00000063 00000008 00000000 00000021 00000000 00000063 b6f64000 00000000
[    3.805873] 3fe0: 000c24a0 becc1ac4 0008e980 b6ed80c6
Starting logging: OK
Starting mdev...
/etc/init.d/S10mdev: line 21: can't create /proc/sys/kernel/hotplug: nonexistent directory
modprobe: can't change directory to '/lib/modules': No such file or directory
Initializing random number generator... done.
Starting network: OK

Welcome to Lichee Pi
Lichee login: 

最近编辑记录 gyushi (2022-10-27 17:54:08)

离线

#12 2022-11-10 13:43:32

ronz
会员
注册时间: 2021-11-19
已发帖子: 31
积分: 31

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

擦下flash 再烧写试试

离线

#13 2022-12-08 09:23:36

hd_xyz
会员
注册时间: 2022-12-04
已发帖子: 25
积分: 21

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

@jack599766257
按照大佬的方法一步步配置uboot时,进入make menuconfig,但是找不到“SPI NAND device Support Command line interface->Device access commands勾选mtd”这个选项,是我眼花了嘛,其他选项都可以找到,uboot版本也跟大佬是一致的

下面是大佬配置方法原文:
执行make ARCH=arm LicheePi_Zero_defconfig,再执行make ARCH=arm menuconfig,修改
ARM architecture勾选Support for SPI Nand Flash on Allwinner SoCs in SPL
Boot options取消掉Enable boot arguments
Device Drivers->MTD Support勾选Enable MTD layer   Enable Driver Model for MTD drivers   SPI NAND device Support
Command line interface->Device access commands勾选mtd
Environment取消勾选Environment is in SPI flash
保存,make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j8编译生成u-boot-sunxi-with-spl.bin,但是这个镜像不能直接使用。

离线

#14 2023-02-08 09:45:33

zj
会员
注册时间: 2023-02-08
已发帖子: 6
积分: 2

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

想请问下 spl_split_exp 这个应用是在哪里下载?

离线

#15 2023-02-14 21:37:25

senjet
会员
注册时间: 2023-02-12
已发帖子: 11
积分: 1

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

感谢楼主雪中送碳!

离线

#16 2023-02-21 00:01:52

小王子&木头人
会员
注册时间: 2018-05-08
已发帖子: 72
积分: 4

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

挂载根文件系统失败了

[    1.410000] musb-hdrc musb-hdrc.2.auto: MUSB HDRC host driver
[    1.420000] musb-hdrc musb-hdrc.2.auto: new USB bus registered, assigned bus number 3
[    1.420000] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    1.430000] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.440000] usb usb3: Product: MUSB HDRC host driver
[    1.450000] usb usb3: Manufacturer: Linux 5.4.213 musb-hcd
[    1.450000] usb usb3: SerialNumber: musb-hdrc.2.auto
[    1.460000] hub 3-0:1.0: USB hub found
[    1.460000] hub 3-0:1.0: 1 port detected
[    1.470000] using random self ethernet address
[    1.470000] using random host ethernet address
[    1.480000] usb0: HOST MAC 42:90:99:e4:7b:25
[    1.480000] usb0: MAC 7a:49:54:a3:6c:d4
[    1.480000] using random self ethernet address
[    1.490000] using random host ethernet address
[    1.490000] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
[    1.500000] g_ether gadget: g_ether ready
[    1.510000] ubi0: default fastmap pool size: 50
[    1.510000] ubi0: default fastmap WL pool size: 25
[    1.520000] ubi0: attaching mtd1
[    2.540000] ubi0: scanning is finished
[    2.550000] ubi0: attached mtd1 (name "ubi0", size 127 MiB)
[    2.560000] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    2.570000] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    2.570000] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    2.580000] ubi0: good PEBs: 1016, bad PEBs: 0, corrupted PEBs: 0
[    2.590000] ubi0: user volume: 5, internal volumes: 1, max. volumes count: 128
[    2.590000] ubi0: max/mean erase counter: 1/0, WL threshold: 128, image sequence number: 1676903150
[    2.600000] ubi0: available PEBs: 0, total reserved PEBs: 1016, PEBs reserved for bad PEB handling: 20
[    2.610000] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01T00:19:03 UTC (1143)
[    2.620000] ALSA device list:
[    2.620000]   No soundcards found.
[    2.630000] ubi0: background thread "ubi_bgt0d" started, PID 773
[    2.640000] List of all partitions:
[    2.640000] 1f00            1024 mtdblock0
[    2.640000]  (driver?)
[    2.650000] 1f01          130048 mtdblock1
[    2.650000]  (driver?)
[    2.660000] No filesystem could mount root, tried:
[    2.660000]  ubifs
[    2.660000]
[    2.660000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    2.660000] CPU: 0 PID: 1 Comm: swapper Not tainted 5.4.213 #0
[    2.660000] Hardware name: Allwinner sun8i Family
[    2.660000] [<c010dd28>] (unwind_backtrace) from [<c010afe4>] (show_stack+0x10/0x14)
[    2.660000] [<c010afe4>] (show_stack) from [<c011b3b0>] (panic+0xf4/0x314)
[    2.660000] [<c011b3b0>] (panic) from [<c0a01608>] (mount_block_root+0x260/0x284)
[    2.660000] [<c0a01608>] (mount_block_root) from [<c0a017b0>] (prepare_namespace+0x9c/0x190)
[    2.660000] [<c0a017b0>] (prepare_namespace) from [<c07b07f4>] (kernel_init+0x8/0x110)
[    2.660000] [<c07b07f4>] (kernel_init) from [<c01010e8>] (ret_from_fork+0x14/0x2c)
[    2.660000] Exception stack(0xc3437fb0 to 0xc3437ff8)
[    2.660000] 7fa0:                                     00000000 00000000 00000000 00000000
[    2.660000] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.660000] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.660000] Rebooting in 5 seconds..

离线

#17 2023-04-10 17:34:56

billymc
会员
注册时间: 2020-05-26
已发帖子: 23
积分: 12.5

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

请问楼主用的哪个版本的Linux编译,我用Ubuntu16.04编译报错

离线

#18 2023-04-10 20:09:02

19chan19
会员
注册时间: 2023-04-07
已发帖子: 12
积分: 12

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

@hd_xyz
还要打开 Device drives 下的 SPI Support 才可以打开
SPI NAND device Support

离线

#20 2023-09-03 20:11:12

sliver_cyh
会员
注册时间: 2021-12-07
已发帖子: 7
积分: 7

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

为啥我按照楼主的流程配置后,uboot启动出现:
U-Boot SPL 2022.04 (Sep 03 2023 - 19:42:38 +0800)
DRAM: 64 MiB
Trying to boot from sunxi SPI-NAND
sunxi SPI-NAND: Found Macronix MX35LF1GE4AB (c212c2)
sunxi SPI-NAND: Loading u-boot from 0x20000
sunxi SPI-NAND: u-boot hcrc ERROR!
麻烦楼上大佬们帮忙看下,感谢

离线

#21 2023-09-08 12:21:08

wukongAlston
会员
注册时间: 2023-08-26
已发帖子: 1
积分: 1

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

请问下编译成功后,怎么下载到SPI-NAND里,还是用sudo sunxi-fel -p spiflash-write 0x0 u-boot/u-boot-sunxi-with-spl.bin这个么?

离线

#22 2023-09-08 14:48:56

jinlong631
会员
注册时间: 2021-05-22
已发帖子: 44
积分: 13

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

楼主您好 spinand flash是多大容量的?

离线

#23 2023-09-16 21:15:51

march1993
会员
注册时间: 2023-05-19
已发帖子: 6
积分: 11

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

还以为 u-boot 主线已经支持 nand 启动了,哭哭,先下载楼主的 patch 试试看吧

离线

#24 2023-09-28 11:03:43

newb_learner
会员
注册时间: 2023-09-27
已发帖子: 4
积分: 4

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

积分还不够,从另外一个哥们的github上下了spinand补丁放到最新的uboot代码中,发现编译报错,先攒点积分,再下这个看看

离线

#25 2023-12-11 16:56:18

nalaby
会员
注册时间: 2023-11-15
已发帖子: 7
积分: 2

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

有没有F1C100S的移植

离线

#26 2023-12-22 14:54:04

hameyou
会员
注册时间: 2018-04-15
已发帖子: 193
积分: 15.5

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

我还是用的linux3.4的bsp来开发

离线

#27 2024-01-01 15:11:27

a32425262
会员
注册时间: 2018-05-06
已发帖子: 103
积分: 400

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

移植后液晶屏不显示,背光也不亮了

离线

#28 2024-03-25 09:58:01

wonrowl
会员
注册时间: 2020-05-08
已发帖子: 97
积分: 73

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

这么久了,这片子会不会停产了,主线的驱动还不齐啊?

离线

#29 2024-03-25 09:58:53

wonrowl
会员
注册时间: 2020-05-08
已发帖子: 97
积分: 73

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

a32425262 说:

移植后液晶屏不显示,背光也不亮了

背光都不亮,你供电有问题吧,猜的

离线

#30 2024-04-10 11:13:14

a32425262
会员
注册时间: 2018-05-06
已发帖子: 103
积分: 400

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

wonrowl 说:
a32425262 说:

移植后液晶屏不显示,背光也不亮了

背光都不亮,你供电有问题吧,猜的

没有问题我用4.13测试是正常使用的,我只是想换成nand

离线

#32 2024-06-26 18:48:20

wonrowl
会员
注册时间: 2020-05-08
已发帖子: 97
积分: 73

Re: V3S SPINAND移植使用主线U-Boot和主线Linux

这个uboot和kernel怎么添加以太网支持啊,跑倒是跑起来了,没网络,调试贼麻烦,2017版的uboot倒是有网络,但是nand好像又不行:(:(:(:(:(

离线

页脚

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

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