您尚未登录。

#1 Re: 全志 SOC » buildroot选择外部编译器的时候,貌似警告说linaro工具链只支持Cortex A的处理器。。。是这个意思吗? » 2018-09-16 17:12:58

@晕哥,试了下你的代码, 在我的上面出现 gpio: can't request region for resource [mem 0x01c208a0-0x01c208a3]报错,可以正常卸载,dts可能有问题。

  
login[181]: root login on 'console'
# cd /lib/modules/4.15.0-rc8-licheepi-nano\+/kernel/drivers/led/
# ls
app          misc_led.ko
# insmod misc_led.ko 
[   36.286371] misc_led: loading out-of-tree module taints kernel.
[   36.293438] Initializing the Custom LEDs module
[   36.298300] leds_probe enter
[   36.301399] Custom LEDs Driver 1c208a0.gpio: can't request region for resource [mem 0x01c208a0-0x01c208a3]
[   36.311033] leds_probe bad exit :(
[   36.314544] Custom LEDs Driver: probe of 1c208a0.gpio failed with error -16
[   36.321733] Custom LEDs module successfully initialized!
# lsmod
Module                  Size  Used by    Tainted: G  
misc_led               16384  0 
# rmmod misc_led.ko 
[  204.783776] Custom LEDs module exit
[  204.787448] Custom LEDs module successfully unregistered
# 

我使用的dts
led: gpio@0x01c208A0{
                compatible = "dev,custom-leds";
                label = "gxled";
            reg = <0x01c208A0 0x04>;
            clocks = <&ccu CLK_BUS_PIO>;
            gpio-controller;
        };

#2 Re: 全志 SOC » buildroot选择外部编译器的时候,貌似警告说linaro工具链只支持Cortex A的处理器。。。是这个意思吗? » 2018-09-15 16:46:09

@晕哥,现在根文件系统能启动,自己编译的.ko点灯不行

U-Boot SPL 2018.01 (Sep 15 2018 - 16:38:45)
DRAM: 32 MiB
Trying to boot from sunxi SPI


U-Boot 2018.01 (Sep 15 2018 - 16:38:45 +1400) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM:  32 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)
In:    serial
Out:   vga
Err:   vga
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 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 80e60000, end 80e64da2 ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.15.0-rc8-licheepi-nano+ (root@gx) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #41 Sat Sep 15 22:18:28 LINT 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 earlyprintk panic=5 rootwait mtdparts=spi0.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 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: 24808K/32768K available (4096K kernel code, 189K rwdata, 1052K rodata, 1024K init, 216K bss, 7960K 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)   ( 190 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 217 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.000053] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000123] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000735] Console: colour dummy device 80x30
[    0.000832] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070246] pid_max: default: 32768 minimum: 301
[    0.070572] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070622] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072229] CPU: Testing write buffer coherency: ok
[    0.074108] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076751] devtmpfs: initialized
[    0.083143] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.083213] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.083500] pinctrl core: initialized pinctrl subsystem
[    0.085455] NET: Registered protocol family 16
[    0.087352] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.089301] cpuidle: using governor menu
[    0.108346] SCSI subsystem initialized
[    0.108623] pps_core: LinuxPPS API ver. 1 registered
[    0.108651] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.110497] clocksource: Switched to clocksource timer
[    0.139542] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.141705] Initialise system trusted keyrings
[    0.142293] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.156798] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.172139] Key type asymmetric registered
[    0.172184] Asymmetric key parser 'x509' registered
[    0.172408] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.172443] io scheduler noop registered
[    0.172460] io scheduler deadline registered
[    0.172968] io scheduler cfq registered (default)
[    0.173002] io scheduler mq-deadline registered
[    0.173022] io scheduler kyber registered
[    0.183285] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.371289] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.378461] console [ttyS0] disabled
[    0.398744] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[    0.770996] console [ttyS0] enabled
[    0.781733] panel-simple panel: panel supply power not found, using dummy regulator
[    0.791335] SCSI Media Changer driver v0.25 
[    0.799229] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.804124] 4 cmdlinepart partitions found on MTD device spi0.0
[    0.810042] Creating 4 MTD partitions on "spi0.0":
[    0.814931] 0x000000000000-0x000000100000 : "uboot"
[    0.821233] 0x000000100000-0x000000110000 : "dtb"
[    0.826946] 0x000000110000-0x000000510000 : "kernel"
[    0.833082] 0x000000510000-0x000001000000 : "rootfs"
[    0.839624] i2c /dev entries driver
[    0.848205] Loading compiled-in X.509 certificates
[    0.862394] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0535f98)
[    0.871266] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc053527c)
[    0.878932] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.885624] [drm] No driver support for vblank timestamp query.
[    0.939417] Console: switching to colour frame buffer device 60x34
[    0.962795] sun4i-drm display-engine: fb0:  frame buffer device
[    0.969884] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    0.978392] vcc3v3: disabling
[    1.079639] random: crng init done
[    2.312327] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[    2.320393] devtmpfs: mounted
[    2.328151] Freeing unused kernel memory: 1024K
Starting logging: OK
Initializing random number generator... done.
Starting network: ip: can't find device 'lo'
ip: socket: Address family not supported by protocol
FAIL

Welcome to Buildroot for gx
gx login: root
Password: 
login[181]: root login on 'console'
# cd /
# cd /lib/modules/4.15.0-rc8-licheepi-nano\+/kernel/drivers/led/
# ls
app          misc_led.ko
# insmod misc_led.ko 
[   40.341249] misc_led: loading out-of-tree module taints kernel.
[   40.348276] ---led init---
# lsmod 
Module                  Size  Used by    Tainted: G  
misc_led               16384  0 
# ls /dev/misc*
ls: /dev/misc*: No such file or directory
# ls /dev/led*
/dev/led_misc
# ./app /dev/led_misc led_on
Segmentation fault
# ./app /dev/led_misc led_off
Segmentation fault
# ./app /dev/led_misc 
Segmentation fault

我的.ko文件工程[url=https://whycan.cn/files/members/1063/f1c100s_leds_tar.gz]f1c100s_leds_tar.gz[/url]

ko文件信息
modinfo /git/apps/f1c100s_leds/misc_led.ko
filename:       /git/apps/f1c100s_leds/misc_led.ko
alias:          platform:f1c100s_led
license:        GPL
description:    led driver
author:         gx
srcversion:     4E214EA6B0221E22AFA4DB2
depends:        
name:           misc_led
vermagic:       4.15.0-rc8-licheepi-nano+ mod_unload ARMv5 p2v8 

insmod时会提示loading out-of-tree module taints kernel.
运行时提示Segmentation fault

我编译app .ko  和内核 用的是 arm-linux-gnueabi-gcc,编译根文件系统用的是 Sourcery CodeBench ARM 2014.05
这样有问题吗?还是其他问题。

#3 Re: 全志 SOC » licheepi nano 内核启动 无法识别spiflash » 2018-08-28 22:56:02

准备先换一个高版本的buildroot,改一下buildroot的Toolchain选项,没辙了就照8楼那样搞了。

#4 Re: 全志 SOC » licheepi nano 内核启动 无法识别spiflash » 2018-08-28 22:28:16

这个关闭了原先,我刚刚测试一下,

这个版本的buildroot最大选择内核头文件选4.12.x, 但实际上内核头文件版本用的是4.15.x , 这里会有问题吗?
External toolchain kernel headers series (4.12.x)  --->

#5 Re: 全志 SOC » licheepi nano 内核启动 无法识别spiflash » 2018-08-28 22:18:57

@EddyZhan @晕哥 我的buildroot配置如下

buildroot1.jpg

buildroot2.png
[ ] Enable VFP extension support 我关闭了

buildroot3.png

#6 Re: 全志 SOC » licheepi nano 内核启动 无法识别spiflash » 2018-08-28 22:01:30

@EddyZhan 大神,能否共享一下你的根文件系统,您是参考 https://whycan.cn/t_1017.html
这种方式修改的根文件系统吗?我使用自己编译的根文件系统出现下面这种情况,怀疑是上面的链接所说的不能使用Linaro工具链编译nano的根文件系统:

U-Boot 2018.01 (Aug 28 2018 - 00:30:52 +0800) Allwinner Technology

CPU:   Allwinner F Series (SUNIV)
Model: Lichee Pi Nano
DRAM:  32 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)
In:    serial
Out:   vga
Err:   vga
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 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 80e60000, end 80e64da2 ... OK
Cannot setup simplefb: node not found

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.15.0-rc8-licheepi-nano+ (root@gx-Ubuntu) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #27 Tue Aug 28 20:47:59 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 earlyprintk panic=5 rootwait mtdparts=spi0.0:1M(uboot)ro,64k(dtb)ro,4M(kernel)ro,-(rootfs) root=31:03 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: 24808K/32768K available (4096K kernel code, 189K rwdata, 1052K rodata, 1024K init, 216K bss, 7960K 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)   ( 190 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 217 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.000052] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000123] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000731] Console: colour dummy device 80x30
[    0.000830] Calibrating delay loop... 203.16 BogoMIPS (lpj=1015808)
[    0.070243] pid_max: default: 32768 minimum: 301
[    0.070570] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070619] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.072222] CPU: Testing write buffer coherency: ok
[    0.074117] Setting up static identity map for 0x80100000 - 0x80100058
[    0.076715] devtmpfs: initialized
[    0.083113] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.083183] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.083469] pinctrl core: initialized pinctrl subsystem
[    0.085416] NET: Registered protocol family 16
[    0.087326] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.089296] cpuidle: using governor menu
[    0.108269] SCSI subsystem initialized
[    0.108538] pps_core: LinuxPPS API ver. 1 registered
[    0.108565] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.110409] clocksource: Switched to clocksource timer
[    0.139640] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.141765] Initialise system trusted keyrings
[    0.142346] workingset: timestamp_bits=30 max_order=13 bucket_order=0
[    0.156943] jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
[    0.172302] Key type asymmetric registered
[    0.172344] Asymmetric key parser 'x509' registered
[    0.172568] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.172604] io scheduler noop registered
[    0.172623] io scheduler deadline registered
[    0.173114] io scheduler cfq registered (default)
[    0.173152] io scheduler mq-deadline registered
[    0.173171] io scheduler kyber registered
[    0.183498] suniv-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[    0.371217] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[    0.378439] console [ttyS0] disabled
[    0.398714] 1c25000.serial: ttyS0 at MMIO 0x1c25000 (irq = 23, base_baud = 6250000) is a 16550A
[    0.771468] console [ttyS0] enabled
[    0.782207] panel-simple panel: panel supply power not found, using dummy regulator
[    0.791783] SCSI Media Changer driver v0.25 
[    0.799571] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.804466] 4 cmdlinepart partitions found on MTD device spi0.0
[    0.810443] Creating 4 MTD partitions on "spi0.0":
[    0.815285] 0x000000000000-0x000000100000 : "uboot"
[    0.821538] 0x000000100000-0x000000110000 : "dtb"
[    0.827259] 0x000000110000-0x000000510000 : "kernel"
[    0.833393] 0x000000510000-0x000001000000 : "rootfs"
[    0.839972] i2c /dev entries driver
[    0.848679] Loading compiled-in X.509 certificates
[    0.862816] sun4i-drm display-engine: bound 1e60000.display-backend (ops 0xc0535f98)
[    0.871670] sun4i-drm display-engine: bound 1c0c000.lcd-controller (ops 0xc053527c)
[    0.879335] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    0.886042] [drm] No driver support for vblank timestamp query.
[    0.939836] Console: switching to colour frame buffer device 60x34
[    0.963217] sun4i-drm display-engine: fb0:  frame buffer device
[    0.970322] [drm] Initialized sun4i-drm 1.0.0 20150629 for display-engine on minor 0
[    0.978826] vcc3v3: disabling
[    1.080018] random: crng init done
[    3.174519] VFS: Mounted root (jffs2 filesystem) on device 31:3.
[    3.182722] devtmpfs: mounted
[    3.190347] Freeing unused kernel memory: 1024K
[    5.407615] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    5.407615] 
[    5.416762] CPU: 0 PID: 1 Comm: init Not tainted 4.15.0-rc8-licheepi-nano+ #27
[    5.423964] Hardware name: Allwinner suniv Family
[    5.428745] [<c010e550>] (unwind_backtrace) from [<c010b6a8>] (show_stack+0x10/0x14)
[    5.436501] [<c010b6a8>] (show_stack) from [<c0116878>] (panic+0xb8/0x230)
[    5.443380] [<c0116878>] (panic) from [<c0118034>] (do_exit+0x96c/0x9a4)
[    5.450081] [<c0118034>] (do_exit) from [<c0118bb8>] (do_group_exit+0x3c/0xb4)
[    5.457297] [<c0118bb8>] (do_group_exit) from [<c0121758>] (get_signal+0x144/0x558)
[    5.464956] [<c0121758>] (get_signal) from [<c010a934>] (do_signal+0xc4/0x404)
[    5.472182] [<c010a934>] (do_signal) from [<c010ae3c>] (do_work_pending+0xb8/0xcc)
[    5.479752] [<c010ae3c>] (do_work_pending) from [<c0107d48>] (slow_work_pending+0xc/0x20)
[    5.487917] Rebooting in 5 seconds..
[   11.467151] Reboot failed -- System halted

#10 Re: 全志 SOC » 有没有朋友用V3s 主线 linux 驱动华邦 spi nand ---- w25n01gvzeig » 2018-08-26 13:57:29

@晕哥

使用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

#11 Re: 全志 SOC » 有没有朋友用V3s 主线 linux 驱动华邦 spi nand ---- w25n01gvzeig » 2018-08-26 13:25:51

@晕哥
按照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...

#12 Re: 全志 SOC » 写一个非常简单的 V3s@linux4.13-y 中断驱动 » 2018-08-08 23:35:43

@晕哥 ,能贴出将它编译成.ko文件的脚本吗?
友善的A9 4412是Makefile这样的,现在换到全志我转不过来,

FILE =  key_poll
INC =   key_poll.h

obj-m = $(FILE).o

KDIR = /works/linux/linux-3.5/

all:
	make -C $(KDIR)  M=$(PWD)  modules

页脚

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

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