板子上使用xr819,v3s 与 xr819的连接关系为:
PE23 - reset
PE24 - WIRQ
驱动使用 https://github.com/fifteenhex/xradio ,也成功编好了,到v3s insmod xr819.ko
然后在ifconfig -a 里并没有新增加一个网卡
目前有点束手无策,不知道从哪里下手
请大佬帮忙看看可能是什么地方有问题
kernel 版本是4.14
设备树为:
/dts-v1/;
#include "sun8i-v3s.dtsi"
#include "sunxi-common-regulators.dtsi"
/ {
model = "Lichee Pi Zero";
compatible = "licheepi,licheepi-zero", "allwinner,sun8i-v3s";
aliases {
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
spi0 = &spi0;
ethernet1 = &xr819;
};
chosen {
stdout-path = "serial0:115200n8";
};
pwrseq_wifi: pwrseq_wifi@0 {
compatible = "mmc-pwrseq-simple";
pinctrl-names = "default";
pinctrl-0 = <&wifi_rst>;
reset-gpios = <&pio 4 23 GPIO_ACTIVE_LOW>;
post-power-on-delay-ms = <50>;
};
leds {
compatible = "gpio-leds";
blue_led {
label = "licheepi:blue:usr";
gpios = <&pio 6 1 GPIO_ACTIVE_LOW>; /* PG1 */
};
green_led {
label = "licheepi:green:usr";
gpios = <&pio 6 0 GPIO_ACTIVE_LOW>; /* PG0 */
default-state = "on";
};
red_led {
label = "licheepi:red:usr";
gpios = <&pio 6 2 GPIO_ACTIVE_LOW>; /* PG2 */
};
};
};
&ehci0 {
status = "okay";
};
&mmc0 {
pinctrl-0 = <&mmc0_pins_a>;
pinctrl-names = "default";
broken-cd;
bus-width = <4>;
vmmc-supply = <®_vcc3v3>;
status = "okay";
};
&mmc1 {
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
vmmc-supply = <®_vcc3v3>;
vqmmc-supply = <®_vcc1v8>;
mmc-pwrseq = <&pwrseq_wifi>;
bus-width = <4>;
max-frequency = <16000000>;
non-removable;
status = "okay";
/*
* Explicitly define the sdio device, so that we can add an ethernet
* alias for it (which e.g. makes u-boot set a mac-address).
*/
xr819: sdio_wifi@1 {
reg = <1>;
compatible = "xradio,xr819";
pinctrl-names = "default";
pinctrl-0 = <&wifi_wake>;
interrupt-parent = <&pio>;
interrupts = <4 24 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "host-wake";
local-mac-address = [dc 44 6d c0 ff ee];
};
};
&i2c0 {
status = "okay";
ns2009: ns2009@48 {
compatible = "nsiway,ns2009";
reg = <0x48>;
};
};
&ohci0 {
status = "okay";
};
&uart0 {
pinctrl-0 = <&uart0_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart1 {
pinctrl-0 = <&uart1_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&uart2 {
pinctrl-0 = <&uart2_pins_a>;
pinctrl-names = "default";
status = "okay";
};
&usb_otg {
dr_mode = "otg";
status = "okay";
};
&usbphy {
usb0_id_det-gpio = <&pio 5 6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&pio {
spi0_cs_pins: spi0_cs_pins {
pins = "PC2", "PB3","PE16","PE15";
function = "gpio_out";
};
wifi_wake: wifi_wake {
pins = "PE24";
function = "gpio_in";
};
wifi_rst: wifi_rst {
pins = "PE23";
function = "gpio_out";
};
};
&spi0 {
status ="okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pins &spi0_cs_pins>;
cs-gpios = <&pio 2 2 GPIO_ACTIVE_HIGH>, <&pio 1 3 GPIO_ACTIVE_HIGH>,<&pio 4 16 GPIO_ACTIVE_HIGH>,<&pio 4 15 GPIO_ACTIVE_HIGH>;
mx25l25635e:mx25l25635e@0 {
compatible = "jedec,spi-nor";
reg = <0x0>;
spi-max-frequency = <50000000>;
#address-cells = <1>;
#size-cells = <1>;
};
spidev: spidevxxx@1 {
compatible = "rohm,dh2228fv";
reg = <0x1>;
spi-max-frequency = <5000000>;
};
gowin: gowin@1{
compatible = "rohm,dh2228fv";
reg = <0x2>;
spi-max-frequency = <5000000>;
};
fakegowin: gowin@2{
compatible = "rohm,dh2228fv";
reg = <0x3>;
spi-max-frequency = <5000000>;
};
};
&ccu {
assigned-clocks = <&ccu 18>;
assigned-clock-parents = <&ccu 9>;
assigned-clock-rates = <60000000>;
};
离线
可能需要固件, 看下日志.
固件放到/lib/firmware 下面了,用的是这几个文件: https://github.com/armbian/firmware/tree/master/xr819
日志在这里,请晕哥帮忙看看
dmesg
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.14-licheepi-zero+ (ncer@ncer-CW65S) (gcc version 6.3.1 20170404 (Linaro GCC 6.3-2017.05)) #10 SMP Fri Jul 15 19:05: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 with Dock
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 16384
[ 0.000000] free_area_init_node: node 0, pgdat c0a46800, node_mem_map c3f7a000
[ 0.000000] Normal zone: 128 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 16384 pages, LIFO batch:3
[ 0.000000] random: fast init done
[ 0.000000] percpu: Embedded 16 pages/cpu @c3f5d000 s33740 r8192 d23604 u65536
[ 0.000000] pcpu-alloc: s33740 r8192 d23604 u65536 alloc=16*4096
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 16256
[ 0.000000] Kernel command line: console=ttyS0,115200 panic=5 rootwait root=/dev/mmcblk0p2 earlyprintk rw vt.global_cursor_default=0
[ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Memory: 55012K/65536K available (6144K kernel code, 285K rwdata, 1500K rodata, 1024K init, 263K bss, 10524K reserved, 0K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
[ 0.000000] vmalloc : 0xc4800000 - 0xff800000 ( 944 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
[ 0.000000] pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
[ 0.000000] modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
[ 0.000000] .text : 0xc0008000 - 0xc0700000 (7136 kB)
[ 0.000000] .init : 0xc0900000 - 0xc0a00000 (1024 kB)
[ 0.000000] .data : 0xc0a00000 - 0xc0a47460 ( 286 kB)
[ 0.000000] .bss : 0xc0a4e754 - 0xc0a9036c ( 264 kB)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] RCU event tracing is enabled.
[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[ 0.000000] arch_timer: cp15 timer(s) running at 24.00MHz (virt).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x588fe9dc0, max_idle_ns: 440795202592 ns
[ 0.000007] sched_clock: 56 bits at 24MHz, resolution 41ns, wraps every 4398046511097ns
[ 0.000019] Switching to timer-based delay loop, resolution 41ns
[ 0.000193] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000448] Console: colour dummy device 80x30
[ 0.000485] Calibrating delay loop (skipped), value calculated using timer frequency.. 48.00 BogoMIPS (lpj=240000)
[ 0.000500] pid_max: default: 32768 minimum: 301
[ 0.000635] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.000651] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.001314] CPU: Testing write buffer coherency: ok
[ 0.001701] /cpus/cpu@0 missing clock-frequency property
[ 0.001725] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
[ 0.002170] Setting up static identity map for 0x40100000 - 0x40100060
[ 0.002347] Hierarchical SRCU implementation.
[ 0.002857] smp: Bringing up secondary CPUs ...
[ 0.002874] smp: Brought up 1 node, 1 CPU
[ 0.002883] SMP: Total of 1 processors activated (48.00 BogoMIPS).
[ 0.002889] CPU: All CPU(s) started in SVC mode.
[ 0.003682] devtmpfs: initialized
[ 0.007283] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.007576] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.007603] futex hash table entries: 256 (order: 2, 16384 bytes)
[ 0.007784] pinctrl core: initialized pinctrl subsystem
[ 0.008784] NET: Registered protocol family 16
[ 0.009227] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.010400] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.010416] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.023246] SCSI subsystem initialized
[ 0.023480] usbcore: registered new interface driver usbfs
[ 0.023559] usbcore: registered new interface driver hub
[ 0.023655] usbcore: registered new device driver usb
[ 0.023890] pps_core: LinuxPPS API ver. 1 registered
[ 0.023901] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[ 0.023922] PTP clock support registered
[ 0.024110] Advanced Linux Sound Architecture Driver Initialized.
[ 0.025756] clocksource: Switched to clocksource arch_sys_counter
[ 0.034950] NET: Registered protocol family 2
[ 0.035537] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.035575] TCP bind hash table entries: 1024 (order: 1, 8192 bytes)
[ 0.035600] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.035804] UDP hash table entries: 256 (order: 1, 8192 bytes)
[ 0.035851] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[ 0.036109] NET: Registered protocol family 1
[ 0.036804] RPC: Registered named UNIX socket transport module.
[ 0.036825] RPC: Registered udp transport module.
[ 0.036830] RPC: Registered tcp transport module.
[ 0.036836] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.038673] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[ 0.044382] NFS: Registering the id_resolver key type
[ 0.044440] Key type id_resolver registered
[ 0.044447] Key type id_legacy registered
[ 0.048392] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[ 0.048415] io scheduler noop registered
[ 0.048423] io scheduler deadline registered
[ 0.048702] io scheduler cfq registered (default)
[ 0.048714] io scheduler mq-deadline registered
[ 0.048721] io scheduler kyber registered
[ 0.049283] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
[ 0.052633] sun8i-v3s-pinctrl 1c20800.pinctrl: initialized sunXi PIO driver
[ 0.114485] Serial: 8250/16550 driver, 8 ports, IRQ sharing disabled
[ 0.117599] console [ttyS0] disabled
[ 0.137858] 1c28000.serial: ttyS0 at MMIO 0x1c28000 (irq = 36, base_baud = 3750000) is a U6_16550A
[ 0.722118] console [ttyS0] enabled
[ 0.747181] 1c28400.serial: ttyS1 at MMIO 0x1c28400 (irq = 37, base_baud = 3750000) is a U6_16550A
[ 0.777790] 1c28800.serial: ttyS2 at MMIO 0x1c28800 (irq = 38, base_baud = 3750000) is a U6_16550A
[ 0.791535] m25p80 spi0.0: unrecognized JEDEC id bytes: ff, ff, ff
[ 0.797969] m25p80: probe of spi0.0 failed with error -2
[ 0.805386] libphy: Fixed MDIO Bus: probed
[ 0.810219] dwmac-sun8i 1c30000.ethernet: PTP uses main clock
[ 0.816185] dwmac-sun8i 1c30000.ethernet: No regulator found
[ 0.821995] dwmac-sun8i 1c30000.ethernet: Will use internal PHY
[ 0.928184] dwmac-sun8i 1c30000.ethernet: EMAC reset timeout
[ 0.934011] dwmac-sun8i: probe of 1c30000.ethernet failed with error -12
[ 0.941155] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 0.947830] ehci-platform: EHCI generic platform driver
[ 0.953384] ehci-platform 1c1a000.usb: EHCI Host Controller
[ 0.959135] ehci-platform 1c1a000.usb: new USB bus registered, assigned bus number 1
[ 0.967189] ehci-platform 1c1a000.usb: irq 26, io mem 0x01c1a000
[ 0.995753] ehci-platform 1c1a000.usb: USB 2.0 started, EHCI 1.00
[ 1.002981] hub 1-0:1.0: USB hub found
[ 1.006981] hub 1-0:1.0: 1 port detected
[ 1.011583] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[ 1.017984] ohci-platform: OHCI generic platform driver
[ 1.023611] ohci-platform 1c1a400.usb: Generic Platform OHCI controller
[ 1.030436] ohci-platform 1c1a400.usb: new USB bus registered, assigned bus number 2
[ 1.038496] ohci-platform 1c1a400.usb: irq 27, io mem 0x01c1a400
[ 1.110766] hub 2-0:1.0: USB hub found
[ 1.114652] hub 2-0:1.0: 1 port detected
[ 1.122382] udc-core: couldn't find an available UDC - added [g_cdc] to list of pending drivers
[ 1.132075] input: 1c22800.lradc as /devices/platform/soc/1c22800.lradc/input/input0
[ 1.141190] sun6i-rtc 1c20400.rtc: rtc core: registered rtc-sun6i as rtc0
[ 1.148202] sun6i-rtc 1c20400.rtc: RTC enabled
[ 1.152845] i2c /dev entries driver
[ 1.157940] input: ns2009_ts as /devices/platform/soc/1c2ac00.i2c/i2c-0/0-0048/input/input1
[ 1.167022] IR NEC protocol handler initialized
[ 1.171629] IR RC5(x/sz) protocol handler initialized
[ 1.176837] IR RC6 protocol handler initialized
[ 1.181434] IR JVC protocol handler initialized
[ 1.186054] IR Sony protocol handler initialized
[ 1.190736] IR SANYO protocol handler initialized
[ 1.195503] IR Sharp protocol handler initialized
[ 1.200285] IR MCE Keyboard/mouse protocol handler initialized
[ 1.206209] IR XMP protocol handler initialized
[ 1.211495] sunxi-wdt 1c20ca0.watchdog: Watchdog enabled (timeout=16 sec, nowayout=0)
[ 1.275794] sunxi-mmc 1c0f000.mmc: base:0xc4987000 irq:23
[ 1.282352] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[ 1.342759] mmc0: host does not support reading read-only switch, assuming write-enable
[ 1.354968] mmc0: new high speed SD card at address 1388
[ 1.360977] mmcblk0: mmc0:1388 CS004 482 MiB
[ 1.366944] mmcblk0: p1 p2
[ 1.415797] sunxi-mmc 1c10000.mmc: base:0xc498b000 irq:24
[ 1.422233] usbcore: registered new interface driver usbhid
[ 1.427978] usbhid: USB HID core driver
[ 1.433495] sun4i-codec 1c22c00.codec: ASoC: /soc/codec-analog@01c23000 not registered
[ 1.441664] sun4i-codec 1c22c00.codec: Failed to register our card
[ 1.449372] NET: Registered protocol family 17
[ 1.454018] Key type dns_resolver registered
[ 1.458607] Registering SWP/SWPB emulation handler
[ 1.472287] usb_phy_generic usb_phy_generic.0.auto: usb_phy_generic.0.auto supply vcc not found, using dummy regulator
[ 1.483906] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
[ 1.489841] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 3
[ 1.498979] hub 3-0:1.0: USB hub found
[ 1.502906] hub 3-0:1.0: 1 port detected
[ 1.508186] using random self ethernet address
[ 1.512738] using random host ethernet address
[ 1.518239] usb0: HOST MAC 5e:4d:a2:dc:75:bf
[ 1.522677] usb0: MAC 8a:65:bb:48:f8:58
[ 1.526715] g_cdc gadget: CDC Composite Gadget, version: King Kamehameha Day 2008
[ 1.534305] g_cdc gadget: g_cdc ready
[ 1.540622] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping ok
[ 1.549559] sun6i-rtc 1c20400.rtc: setting system clock to 1970-01-01 01:14:23 UTC (4463)
[ 1.558213] vcc5v0: disabling
[ 1.561235] ALSA device list:
[ 1.564245] #0: V3s Audio Codec
[ 1.570602] EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
[ 1.580032] EXT4-fs (mmcblk0p2): couldn't mount as ext2 due to feature incompatibilities
[ 1.601151] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 1.609579] VFS: Mounted root (ext4 filesystem) on device 179:2.
[ 1.618453] devtmpfs: mounted
[ 1.622656] Freeing unused kernel memory: 1024K
[ 1.690545] musb-hdrc musb-hdrc.1.auto: VBUS_ERROR in b_idle (80, <SessEnd), retry #0, port1 00000100
[ 1.754568] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
[ 1.995954] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 2.064274] usbcore: registered new interface driver ath9k_htc
[ 7.195764] usb 1-1: device descriptor read/64, error -110
[ 7.538402] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[ 7.547848] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[ 7.556762] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[ 7.848887] usb 1-1: ath9k_htc: Transferred FW: htc_9271.fw, size: 50980
[ 8.088394] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[ 10.389013] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.3
[ 10.394646] ath9k_htc 1-1:1.0: FW RMW support: Off
[ 10.399565] ath: EEPROM regdomain: 0x60
[ 10.399570] ath: EEPROM indicates we should expect a direct regpair map
[ 10.399578] ath: Country alpha2 being used: 00
[ 10.399581] ath: Regpair used: 0x60
[ 10.405632] ieee80211 phy0: Atheros AR9271 Rev:1
[ 14.328590] wlan0: authenticate with 3c:06:a7:89:f5:bc
[ 14.625479] wlan0: send auth to 3c:06:a7:89:f5:bc (try 1/3)
[ 14.724394] wlan0: authenticated
[ 14.736192] wlan0: associate with 3c:06:a7:89:f5:bc (try 1/3)
[ 14.786298] wlan0: RX AssocResp from 3c:06:a7:89:f5:bc (capab=0x1411 status=0 aid=2)
[ 14.801663] wlan0: associated
[ 14.923340] wlan0: Limiting TX power to 20 (20 - 0) dBm as advertised by 3c:06:a7:89:f5:bc
[ 34.609873] xradio_wlan: loading out-of-tree module taints kernel.
[ 121.107540] random: crng init done
离线
首先确认硬件有没有问题?
如果硬件没问题, 看下 dts 里面 该 sdc 有没有启用?
硬件问题不太好确认是不是OK的,因为感觉外围电路比较简单就直接打板了,手头也没有成品的xr819模块来对比,头疼
原理图:
https://github.com/AutopilotPi/XR819_Module/blob/master/XR819.pdf
dts是启用的,启动日志下看到有
[ 1.282352] sunxi-mmc 1c10000.mmc: allocated mmc-pwrseq
[ 1.415797] sunxi-mmc 1c10000.mmc: base:0xc498b000 irq:24
离线
仔细检查了一下,发现使用主板使用该模块的原理图符号画错了,导致信号线连接错误了,令人汗颜,只能另外打板测试了
离线
@ncer
硬件问题确认方法:
1. 万用表测量供电是否正常
2.wifi都有时钟的,需要看看时钟是否正常,和软件配置的时钟是否一致
3. 如果要测试连接,可以看看接口上是否有对应的波形。
离线
@ncer
硬件问题确认方法:
1. 万用表测量供电是否正常
2.wifi都有时钟的,需要看看时钟是否正常,和软件配置的时钟是否一致
3. 如果要测试连接,可以看看接口上是否有对应的波形。
谢谢,学习了
离线
请问XR819的外围硬件连接图可以分享下嘛
离线