spi flash 手册: https://www.winbond.com/resource-files/w25n01gv%20revg%20032116.pdf
立创商城链接: https://item.szlcsc.com/90048.html (有点小贵)
离线
同求
离线
主线好像不支持,需要加驱动
离线
全志的sunxi-tools不支持spi nand的烧写吧,你们是怎么把程序烧到flash里面的呢,不用烧片机
离线
晕哥加油,要是2片不够的话我再给你支援几片 ~ ~
离线
话说荔枝群里有位仁兄上传过spi nand flash从sunxitools到kernel的全套驱动支持,我没v3s的板子,你们有移植调试过木有呢
spi flash 手册: https://www.winbond.com/resource-files/w25n01gv%20revg%20032116.pdf
立创商城链接: https://item.szlcsc.com/90048.html (有点小贵)
离线
话说荔枝群里有位仁兄上传过spi nand flash从sunxitools到kernel的全套驱动支持,我没v3s的板子,你们有移植调试过木有呢
awfans 说:spi flash 手册: https://www.winbond.com/resource-files/w25n01gv%20revg%20032116.pdf
立创商城链接: https://item.szlcsc.com/90048.html (有点小贵)
上传到哪了啊?我也想参考参考
离线
就在代码模块里面有
wind 说:话说荔枝群里有位仁兄上传过spi nand flash从sunxitools到kernel的全套驱动支持,我没v3s的板子,你们有移植调试过木有呢
awfans 说:spi flash 手册: https://www.winbond.com/resource-files/w25n01gv%20revg%20032116.pdf
立创商城链接: https://item.szlcsc.com/90048.html (有点小贵)
上传到哪了啊?我也想参考参考
离线
歪朵拉开源硬件: https://widora.cn
淘宝: https://widora.taobao.com/
离线
@晕哥
按照http://nano.lichee.pro/build_sys/build_flash.html里的参考编译出内核
给出的正常的打印信息会有
[ 0.834964] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.839694] spi0.0: parsing partitions cmdlinepart
[ 0.845501] spi0.0: got parser (null)
[ 0.849182] spi0.0: parsing partitions ofpart
[ 0.853652] spi0.0: got parser ofpart
[ 0.857374] spi0.0: parser ofpart: 4
[ 0.860949] 4 ofpart partitions found on MTD device spi0.0
[ 0.866491] Creating 4 MTD partitions on "spi0.0":
[ 0.871304] 0x000000000000-0x000000100000 : "u-boot"
[ 0.878962] 0x000000100000-0x000000110000 : "dtb"
[ 0.886404] 0x000000110000-0x000000510000 : "kernel"
[ 0.894027] 0x000000510000-0x000001000000 : "rootfs"
我自己使用主线4.15.0的内核,从spi-flash 启动出现
[ 0.827100] SCSI Media Changer driver v0.25
后不会出现上面信息,看样子不能正确识别到spiflash里的分区信息。
最终挂在Waiting for root device /dev/mtdblock3
U-Boot SPL 2018.01-05676-g00188782ee-dirty (May 19 2018 - 15:47:49)
DRAM: 32 MiB
SPL: Unsupported Boot Device!
Trying to boot from sunxi SPI
U-Boot 2018.01-05676-g00188782ee-dirty (May 19 2018 - 15:47:49 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
Using default environment
Setting up a 800x480 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
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 64 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 80e4c000, end 80e50f0e ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-rc8-next-20180202-licheepi-nano++ (root@gx-Ubuntu) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #10 Fri Aug 24 17:24:38 CST 2018
[ 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: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] random: fast init done
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 24780K/32768K available (4096K kernel code, 205K rwdata, 1156K rodata, 1024K init, 218K bss, 7988K 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 : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (5088 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 206 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 219 kB)
[ 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.000051] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000120] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000714] Console: colour dummy device 80x30
[ 0.000812] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.070234] pid_max: default: 32768 minimum: 301
[ 0.070545] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070591] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072036] CPU: Testing write buffer coherency: ok
[ 0.073930] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076382] devtmpfs: initialized
[ 0.081822] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.081896] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.082170] pinctrl core: initialized pinctrl subsystem
[ 0.084820] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.086629] cpuidle: using governor menu
[ 0.106993] SCSI subsystem initialized
[ 0.107335] usbcore: registered new interface driver usbfs
[ 0.107483] usbcore: registered new interface driver hub
[ 0.107686] usbcore: registered new device driver usb
[ 0.108175] pps_core: LinuxPPS API ver. 1 registered
[ 0.108204] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.108717] Advanced Linux Sound Architecture Driver Initialized.
[ 0.109052] clocksource: Switched to clocksource timer
[ 0.136835] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.138666] Initialise system trusted keyrings
[ 0.139421] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.152097] jffs2: version 2.2. © 2001-2006 Red Hat, Inc.
[ 0.166488] Key type asymmetric registered
[ 0.166532] Asymmetric key parser 'x509' registered
[ 0.166738] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 0.166770] io scheduler noop registered
[ 0.166786] io scheduler deadline registered
[ 0.167556] io scheduler cfq registered (default)
[ 0.167597] io scheduler mq-deadline registered
[ 0.167616] io scheduler kyber registered
[ 0.168667] sun4i-usb-phy 1c13400.phy: Couldn't request ID GPIO
[ 0.178461] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.355585] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.362605] console [ttyS0] disabled
[ 0.382925] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 22, base_baud = 6250000) is a 16550A
[ 0.774091] console [ttyS0] enabled
[ 0.782422] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc05363d8)
[ 0.790288] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 0.796896] [drm] No driver support for vblank timestamp query.
[ 0.802892] sun4i-drm display-engine: Failed to initialize drm fb helper.
[ 0.809734] sun4i-drm display-engine: Couldn't create our framebuffer
[ 0.816478] sun4i-drm display-engine: master bind failed: -22
[ 0.822615] sun4i-backend: probe of 1e60000.display-backend failed with error -22
[ 0.832319] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.841778] SCSI Media Changer driver v0.25
[ 0.847086] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.853753] ehci-platform: EHCI generic platform driver
[ 0.859343] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 0.865560] ohci-platform: OHCI generic platform driver
[ 0.871239] usbcore: registered new interface driver usb-storage
[ 0.878100] i2c /dev entries driver
[ 0.939172] sunxi-mmc 1c0f000.mmc: base:0xfa88f1b6 irq:18
[ 0.946561] usbcore: registered new interface driver usbhid
[ 0.952278] usbhid: USB HID core driver
[ 0.975320] Loading compiled-in X.509 certificates
[ 0.990022] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.001887] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.007739] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
[ 1.018219] hub 1-0:1.0: USB hub found
[ 1.022654] hub 1-0:1.0: 1 port detected
[ 1.030385] vcc3v3: disabling
[ 1.033379] ALSA device list:
[ 1.036344] #0: Loopback 1
[ 1.040519] Waiting for root device /dev/mtdblock3...
离线
@晕哥
使用Nano_pub_V2里面的编译好的内核,能够正常从spiflash启动,但是编译出来的.ko 文件不能正常insmod
U-Boot SPL 2018.01-05676-g00188782ee-dirty (May 19 2018 - 15:47:49)
DRAM: 32 MiB
SPL: Unsupported Boot Device!
Trying to boot from sunxi SPI
U-Boot 2018.01-05676-g00188782ee-dirty (May 19 2018 - 15:47:49 +0800) Allwinner Technology
CPU: Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM: 32 MiB
Using default environment
Setting up a 800x480 lcd console (overscan 0x0)
In: serial@1c25000
Out: serial@1c25000
Err: serial@1c25000
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 64 KiB, total 16 MiB
device 0 offset 0x100000, size 0x4000
SF: 16384 bytes @ 0x100000 Read: OK
device 0 offset 0x110000, size 0x400000
SF: 4194304 bytes @ 0x110000 Read: OK
## Flattened Device Tree blob at 80c00000
Booting using the fdt blob at 0x80c00000
Loading Device Tree to 80e4c000, end 80e51326 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.0-next-20180202-licheepi-nano+ (biglion@biglion-MRC-WX0) (gcc version 7.2.0 (Ubuntu/Linaro 7.2.0-6ubuntu1)) #107 Sat May 19 11:56:16 CST 2018
[ 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: Lichee Pi Nano
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] random: fast init done
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 8128
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mtdblock3 rw rootfstype=jffs2
[ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Memory: 23752K/32768K available (5120K kernel code, 203K rwdata, 1148K rodata, 1024K init, 227K bss, 9016K 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 : 0xc2800000 - 0xff800000 ( 976 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc2000000 ( 32 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (6112 kB)
[ 0.000000] .init : 0x(ptrval) - 0x(ptrval) (1024 kB)
[ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 204 kB)
[ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 228 kB)
[ 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.000051] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000117] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000727] Console: colour dummy device 80x30
[ 0.000824] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[ 0.070235] pid_max: default: 32768 minimum: 301
[ 0.070674] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.070727] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.072178] CPU: Testing write buffer coherency: ok
[ 0.074032] Setting up static identity map for 0x80100000 - 0x80100058
[ 0.076500] devtmpfs: initialized
[ 0.082938] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.083003] futex hash table entries: 256 (order: -1, 3072 bytes)
[ 0.083316] pinctrl core: initialized pinctrl subsystem
[ 0.085541] NET: Registered protocol family 16
[ 0.087310] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.089152] cpuidle: using governor menu
[ 0.109587] SCSI subsystem initialized
[ 0.109873] pps_core: LinuxPPS API ver. 1 registered
[ 0.109901] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.109971] PTP clock support registered
[ 0.111961] clocksource: Switched to clocksource timer
[ 0.139494] NET: Registered protocol family 2
[ 0.140958] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[ 0.141038] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.141097] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.141142] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.141516] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.141581] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.142296] NET: Registered protocol family 1
[ 0.144053] NetWinder Floating Point Emulator V0.97 (double precision)
[ 0.145951] Initialise system trusted keyrings
[ 0.146546] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[ 0.160477] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[ 0.174402] Key type asymmetric registered
[ 0.174444] Asymmetric key parser 'x509' registered
[ 0.174693] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.174728] io scheduler noop registered
[ 0.174746] io scheduler deadline registered
[ 0.175583] io scheduler cfq registered (default)
[ 0.175622] io scheduler mq-deadline registered
[ 0.175639] io scheduler kyber registered
[ 0.186827] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.359475] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.366534] console [ttyS0] disabled
[ 0.386822] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 25, base_baud = 6250000) is a 16550A
[ 0.806912] console [ttyS0] enabled
[ 0.817624] panel-simple panel: panel supply power not found, using dummy regulator
[ 0.827100] SCSI Media Changer driver v0.25
[ 0.834964] m25p80 spi0.0: w25q128 (16384 Kbytes)
[ 0.839694] spi0.0: parsing partitions cmdlinepart
[ 0.845501] spi0.0: got parser (null)
[ 0.849182] spi0.0: parsing partitions ofpart
[ 0.853652] spi0.0: got parser ofpart
[ 0.857374] spi0.0: parser ofpart: 4
[ 0.860949] 4 ofpart partitions found on MTD device spi0.0
[ 0.866491] Creating 4 MTD partitions on "spi0.0":
[ 0.871304] 0x000000000000-0x000000100000 : "u-boot"
[ 0.878962] 0x000000100000-0x000000110000 : "dtb"
[ 0.886404] 0x000000110000-0x000000510000 : "kernel"
[ 0.894027] 0x000000510000-0x000001000000 : "rootfs"
[ 0.902128] i2c /dev entries driver
[ 0.936637] sunxi-mmc 1c0f000.mmc: base:0x007adfe2 irq:21
[ 0.945378] NET: Registered protocol family 17
[ 0.949936] Key type dns_resolver registered
[ 0.956554] Loading compiled-in X.509 certificates
[ 0.971557] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0633630)
[ 0.979609] sun4i-tcon 1c0c000.lcd-controller: Missing LVDS properties, Please upgrade your DT
[ 0.988294] sun4i-tcon 1c0c000.lcd-controller: LVDS output disabled
[ 0.995507] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc0632848)
[ 1.003299] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.009903] [drm] No driver support for vblank timestamp query.
[ 1.192437] Console: switching to colour frame buffer device 100x30
[ 1.232171] sun4i-drm display-engine: fb0: frame buffer device
[ 1.239382] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[ 1.247953] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1.264379] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1.271157] vcc3v3: disabling
[ 1.275145] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1.283874] cfg80211: failed to load regulatory.db
[ 1.361516] random: crng init done
[ 3.789591] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[ 3.797536] devtmpfs: mounted
[ 3.807051] Freeing unused kernel memory: 1024K
Starting logging: OK
read-only file system detected...done
Welcome to Lichee Pi
gxhost login: root
Password:
# cd /lib/modules/4.15.0-next-20180202-licheepi-nano\+/kernel/drivers/led/
# ls
app misc_led.ko
# insmod misc_led.ko
[ 57.131163] misc_led: loading out-of-tree module taints kernel.
[ 57.137773] misc_led: Unknown symbol __memzero (err 0)
[ 57.145822] misc_led: Unknown symbol __memzero (err 0)
insmod: can't insert 'misc_led.ko': unknown symbol in module, or unknown parameter
#
我的.ko文件工程f1c100s_leds_tar.gz
root@gx-Ubuntu:/git/apps/f1c100s_leds# ls
app Makefile make.sh misc_led.c misc_led.h misc_led.ko
root@gx-Ubuntu:/git/apps/f1c100s_leds# modinfo misc_led.ko
filename: /git/apps/f1c100s_leds/misc_led.ko
alias: platform:f1c100s_led
license: GPL
description: led driver
author: gx
depends:
name: misc_led
vermagic: 4.15.0-next-20180202-licheepi-nano+ mod_unload ARMv5 p2v8
最近编辑记录 include_h (2018-08-26 14:03:15)
离线
在线
@晕哥,今天逛论坛,找到问题了,参考这个 https://whycan.cn/t_1180.html
离线
是的,18楼的
离线
几乎熬了个通宵,终于找到原因了并解决问题了:官网下载的config文件,开错了全志的spi控制器开关,正确的配置是# CONFIG_SPI_SUN4I is not set
CONFIG_SPI_SUN6I=y(看来f1c100s用的是新版本的spi控制器)。修改后内核可以正确识别到spi flash了。另外,官网页面上还有个问题, uboot的bootargs 参数设置中, root=/dev/mtdblock3必须要修改为root=31:3,否则无法正确加载rootfs。修改以上两点后可以正确启动到控制台了。云盘中的sdk包4.13和docker中的4.15版本均是如此修改。
感谢 @三贪猪 坛友分享
在线
附件下载要几分怎么办??
离线