我是一步一步按照这个做的:
https://www.kancloud.cn/lichee/lpi0/331844
准备uboot
下载包含spi驱动的体验版本uboot,该驱动目前尚未合并到主线
git clone -b v3s-spi-experimental https://github.com/Lichee-Pi/u-boot.git
执行make ARCH=arm menuconfig打开uboot菜单配置,进入到Device Drivers > SPI Flash Support
注意看一下自己flash的厂家名称,例如选上Macronix SPI flash support用来支持我测试用的flash:MX25L12873F。
上面这些步骤都做好了.然后:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make LicheePi_Zero_800x480LCD_defconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make menuconfig
ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j3
烧录:
sudo sunxi-fel -p spiflash-write 0 u-boot-sunxi-with-spl.bin
上电后串口终端输出这个错误:
U-Boot SPL 2017.01-rc2-00056-ga297a99 (Oct 06 2017 - 11:37:04)
DRAM: 64 MiB
SPL: Unsupported Boot Device!
SPL: failed to boot from all boot devices
### ERROR ### Please RESET the board ###
最近编辑记录 basicdev (2017-10-06 11:44:29)
离线
非常感谢楼上的朋友, 你提醒了我.
刚刚git 升级到最新版本:
git pull origin v3s-spi-experimental
然后再选择启用SPI总线
SPI Support --->
[ * ] Enable Driver Model for SPI drivers
[ * ] Allwinner SPI driver
搞定:
U-Boot 2017.01-rc2-00073-gdd6e874-dirty (Oct 06 2017 - 15:29:00 +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 environmentSetting 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: 2 1 0
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
=>
离线
好开心, 可以继续Hack Linux 了.
离线
发现根本不引导Linux
Environment size: 4297/32764 bytes
=> sf probe 0; sf read 0x41800000 0x100000 0x10000; sf read 0x41000000 0x110000 0x600000; bootz 0x41000000 - 0x41800000
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
=>
离线
basicdev 说:发现根本不引导Linux
Environment size: 4297/32764 bytes
=> sf probe 0; sf read 0x41800000 0x100000 0x10000; sf read 0x41000000 0x110000 0x600000; bootz 0x41000000 - 0x41800000
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
Unknown command 'sf' - try 'help'
=>貌似不支持sf命令,去看看是不是编译sf编译开关没开启。
还真是这个问题,感谢大神.把sf选上就可以了。
Command line interface --->
Device access commands --->
[ * ] sf
[ * ] sspi
最近编辑记录 basicdev (2017-10-06 16:37:03)
离线
配合这个bootcmd
sf probe 0; sf read 0x41800000 0x100000 0x10000; sf read 0x41000000 0x110000 0x600000; bootz 0x41000000 - 0x41800000
烧写命令就是:
sudo sunxi-fel -p spiflash-write 0 uboot/u-boot-sunxi-with-spl.bin
sudo sunxi-fel -p spiflash-write 0x100000 linux/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dtb
sudo sunxi-fel -p spiflash-write 0x110000 linux/arch/arm/boot/zImage
至此全部搞定, Linux跑起来了.
离线