1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 【迅为iMX6Q】开发板 Linux 5.15.71 RTL8211E 以太网驱动适配

【迅为iMX6Q】开发板 Linux 5.15.71 RTL8211E 以太网驱动适配

时间:2020-04-18 17:23:15

相关推荐

【迅为iMX6Q】开发板 Linux 5.15.71 RTL8211E 以太网驱动适配

相关参考

【迅为iMX6Q】开发板 u-boot .04 SD卡 启动

【迅为iMX6Q】开发板 u-boot .04 RTL8211E 以太网驱动适配

【迅为iMX6Q】开发板 Linux 5.15.71 SD卡 启动

开发环境

win10 64位

VMware Workstation Pro 16

ubuntu 22.04

-【迅为imx6q】开发板, 2G DDR

TF 16G SD卡,用于迅为imx6q SD 卡启动

RTL8211E

通过迅为imx6q 开发板原理图了解到,网卡 PHY 芯片是 RTL8211E,

在 u-boot .04 上,通过使能CONFIG_PHY_REALTEK配置,使能 RTL8211E 网络 PHY 芯片的支持,再配置设备树,增加PHY 复位延时,u-boot 下的网络就正常工作了。

这里有个选项:#define CONFIG_FEC_MXC_PHYADDR 0,也就是 迅为imx6q 开发板上的 RTL8211E 网络 PHY 地址是 0。

适配方法

一、Linux 上开启 REALTEK

使用 menuconfig 图形配置,使能[*] Realtek devices

.config - Linux/arm 5.15.71 Kernel Configuration> Device Drivers > Network device support > Ethernet driver support> [*] Realtek devices<*>RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support<*>RealTek RTL-8129/8130/8139 PCI Fast Ethernet Adapter support[ ] Use PIO instead of MMIO[ ] Support for uncommon RTL-8139 rev. K (automatic channel equalization) [ ] Support for older RTL-8129/8130 boards[ ] Use older RX-reset method<*>Realtek 8169/8168/8101/8125 ethernet support

RTL8211E与其他的 PHY 类似,所以可以同时使能其他的PHY 芯片的支持,当前 RTL8211E 还需要在设备树文件中定义一些参数。

二、修改设备树

设备树文件,可以自己复制一份

$ cp arch/arm/boot/dts/imx6q-sabresd.dts arch/arm/boot/dts/imx6q-topeet.dts

$ cp arch/arm/boot/dts/imx6qdl-sabresd.dtsi arch/arm/boot/dts/imx6qdl-topeet.dtsi

修改arch/arm/boot/dts/Makefile,增加 生成imx6q-topeet.dtb

修改arch/arm/boot/dts/imx6qdl-topeet.dtsi,改动点有两处:

(1)是reg = <0>;,因为 迅为imx6q 开发板 PHY 地址是 0(2)增加PHY 复位的延时reset-assert-us = <10000>;reset-deassert-us = <150000>;

&fec {pinctrl-names = "default";pinctrl-0 = <&pinctrl_enet>;phy-mode = "rgmii-id";phy-handle = <&phy>;fsl,magic-packet;status = "okay";mdio {#address-cells = <1>;#size-cells = <0>;phy: ethernet-phy@0 {reg = <0>;qca,clk-out-frequency = <125000000>;reset-gpios = <&gpio1 25 GPIO_ACTIVE_LOW>;reset-assert-us = <10000>;reset-deassert-us = <150000>;};};};

调试经验

开始只改了 PHY 支持与 增加 PHY 芯片的复位时间,发现工作不正常,提示信息如下

[ 1.826654] mdio_bus 2188000.ethernet-1: MDIO device at address 1 is missing.[ 1.834410] fec 2188000.ethernet eth0: registered PHC device 0

mdio_bus 2188000.ethernet-1: MDIO device at address 1 is missing.这个信息不能忽略,通过搜索Linux 内核代码,找到了这个信息的位置,初步认为是 PHY 地址有问题,通过增加LOG继续排查,发现从设备树读取的PHY 地址是 1,而 u-boot 下 PHY 地址设置的是 0。 文件drivers/net/mdio/of_mdio.cof_mdiobus_register函数中

int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np){struct device_node *child;bool scanphys = false;int addr, rc;if (!np)return mdiobus_register(mdio);/* Do not continue if the node is disabled */if (!of_device_is_available(np))return -ENODEV;/* Mask out all PHYs from auto probing. Instead the PHYs listed in* the device tree are populated after the bus has been registered */mdio->phy_mask = ~0;device_set_node(&mdio->dev, of_fwnode_handle(np));/* Get bus level PHY reset GPIO details */mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY;of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us);mdio->reset_post_delay_us = 0;of_property_read_u32(np, "reset-post-delay-us", &mdio->reset_post_delay_us);/* Register the MDIO bus */rc = mdiobus_register(mdio);if (rc)return rc;/* Loop over the child nodes and register a phy_device for each phy */for_each_available_child_of_node(np, child) {addr = of_mdio_parse_addr(&mdio->dev, child); /* #### 这里地址加了LOG,读取为 1 */if (addr < 0) {scanphys = true;continue;}if (of_mdiobus_child_is_phy(child))rc = of_mdiobus_register_phy(mdio, child, addr);elserc = of_mdiobus_register_device(mdio, child, addr);if (rc == -ENODEV) /* #### 这里应该是没有找到设备 */dev_err(&mdio->dev,"MDIO device at address %d is missing.\n",addr);else if (rc)goto unregister;}

解决方法就是修改设备树,把reg = <1>;改为reg = <0>;

其他修改

开发板的默认配置,编译烧写到 SD卡后,发现不断提示 触摸屏 读取错误,应该是触摸屏芯片驱动不匹配造成的,可以关闭触摸屏,后续在适配LCD 时一起适配好

烧写运行

这里使用 SD 卡启动,编译生成的产物为 :

arch/arm/boot/zImagearch/arm/boot/dts/imx6q-topeet.dtb

烧写的方法,参考前面 文章 【迅为iMX6Q】开发板 Linux 5.15.71 SD卡 启动,其实就是复制到 SD 卡的 某个分区,然后设置 u-boot bootcmd,加载 内核 zImage 与 设备树 dtb 文件,然后 bootz 启动

/* 设置 bootargs,注意根文件系统 放置的分区, mmcblk1p3, blk1 表示 sd 卡设备号 1, 3代表 第三个分区 */setenv bootargs 'console=ttymxc0,115200 root=/dev/mmcblk1p3 rootwait rw'/* 设置 bootcmd ,注意linux zImage 与 设备树 dtb 存放的分区 mmc 1:1 */setenv bootcmd 'ext4load mmc 1:1 0x18000000 imx6q-topeet.dtb; ext4load mmc 1:1 0x12000000 zImage; bootz 0x12000000 - 0x18000000'/* 保存 env */saveenv/* 重启 */reset

运行信息

U-Boot .04-gd80220a2ff-dirty (Jan 08 - 17:51:15 +0800)CPU: i.MX6Q rev1.3 996 MHz (running at 792 MHz)CPU: Extended Commercial temperature grade (-20C to 105C) at 19CReset cause: PORModel: i.MX6 Quad Topeet Smart Device BoardDRAM: 2 GiBCore: 81 devices, 20 uclasses, devicetree: separateMMC: FSL_SDHC: 1, FSL_SDHC: 2, FSL_SDHC: 3Loading Environment from MMC... OKNo panel detected: default to Hannstar-XGADisplay: Hannstar-XGA (1024x768)In: serialOut: serialErr: serialSEC0: RNG instantiatedswitch to partitions #0, OKmmc1 is current deviceflash target is MMC:1Net: eth0: ethernet@2188000 [PRIME]Fastboot: NormalNormal BootHit any key to stop autoboot: 053442 bytes read in 5 ms (10.2 MiB/s)9496680 bytes read in 458 ms (19.8 MiB/s)Kernel image @ 0x12000000 [ 0x000000 - 0x90e868 ]## Flattened Device Tree blob at 18000000Booting using the fdt blob at 0x18000000Using Device Tree in place at 18000000, end 180100c1Starting kernel ...[ 0.000000] Booting Linux on physical CPU 0x0[ 0.000000] Linux version 5.15.71-g7a2936559146 (zhangsz@zhangsz-virtual-machine) (arm-none-linux-gnueabihf-gcc (GNU Toolchain forthe A-profile Architecture 9.2-.12 (arm-9.10)) 9.2.1 1025, GNU ld (GNU Toolchain for the A-profile Architecture 9.2-.12(arm-9.10)) 2.33.1.1209) #1 SMP PREEMPT Wed Jan 11 00:17:17 CST [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c5387d[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache[ 0.000000] OF: fdt: Machine model: Freescale i.MX6 Quad Topeet Smart Device Board[ 0.000000] Memory policy: Data cache writealloc[ 0.000000] Reserved memory: created CMA memory pool at 0x6c000000, size 320 MiB[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool[ 0.000000] Zone ranges:[ 0.000000] Normal [mem 0x0000000010000000-0x000000007fffffff][ 0.000000] HighMem [mem 0x0000000080000000-0x000000008fffffff][ 0.000000] Movable zone start for each node[ 0.000000] Early memory node ranges[ 0.000000] node 0: [mem 0x0000000010000000-0x000000008fffffff][ 0.000000] Initmem setup node 0 [mem 0x0000000010000000-0x000000008fffffff][ 0.000000] percpu: Embedded 12 pages/cpu s17164 r8192 d23796 u49152[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 520256[ 0.000000] Kernel command line: console=ttymxc0,115200 root=/dev/mmcblk1p3 rootwait rw[ 0.000000] Dentry cache hash table entries: 262144 (order: 8, 1048576 bytes, linear)[ 0.000000] Inode-cache hash table entries: 131072 (order: 7, 524288 bytes, linear)[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off[ 0.000000] Memory: 1728212K/2097152K available (12288K kernel code, 1337K rwdata, 4408K rodata, 1024K init, 433K bss, 41260K rese rved, 327680K cma-reserved, 262144K highmem)[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1[ 0.000000] rcu: Preemptible hierarchical RCU implementation.[ 0.000000] rcu:RCU event tracing is enabled.[ 0.000000] Trampoline variant of Tasks RCU enabled.[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.[ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16[ 0.000000] L2C-310 errata 752271 769419 enabled[ 0.000000] L2C-310 enabling early BRESP for Cortex-A9[ 0.000000] L2C-310 full line of zeros enabled for Cortex-A9[ 0.000000] L2C-310 ID prefetch enabled, offset 16 lines[ 0.000000] L2C-310 dynamic clock gating enabled, standby mode enabled[ 0.000000] L2C-310 cache controller enabled, 16 ways, 1024 kB[ 0.000000] L2C-310: CACHE_ID 0x410000c7, AUX_CTRL 0x76470001[ 0.000000] Switching to timer-based delay loop, resolution 333ns[ 0.000001] sched_clock: 32 bits at 3000kHz, resolution 333ns, wraps every 715827882841ns[ 0.000032] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 637086815595 ns[ 0.001616] Console: colour dummy device 80x30[ 0.001667] Calibrating delay loop (skipped), value calculated using timer frequency.. 6.00 BogoMIPS (lpj=30000)[ 0.001689] pid_max: default: 32768 minimum: 301[ 0.001932] Mount-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)[ 0.001972] Mountpoint-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)[ 0.002785] CPU: Testing write buffer coherency: ok[ 0.002837] CPU0: Spectre v2: using BPIALL workaround[ 0.003104] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000[ 0.004164] Setting up static identity map for 0x10100000 - 0x10100060[ 0.004340] rcu: Hierarchical SRCU implementation.[ 0.004975] smp: Bringing up secondary CPUs ...[ 0.005799] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001[ 0.005814] CPU1: Spectre v2: using BPIALL workaround[ 0.006710] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002[ 0.006726] CPU2: Spectre v2: using BPIALL workaround[ 0.007601] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003[ 0.007615] CPU3: Spectre v2: using BPIALL workaround[ 0.007734] smp: Brought up 1 node, 4 CPUs[ 0.007753] SMP: Total of 4 processors activated (24.00 BogoMIPS).[ 0.007768] CPU: All CPU(s) started in SVC mode.[ 0.008281] devtmpfs: initialized[ 0.017539] VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4[ 0.017785] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns[ 0.017818] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)[ 0.037233] pinctrl core: initialized pinctrl subsystem[ 0.039000] NET: Registered PF_NETLINK/PF_ROUTE protocol family[ 0.047678] DMA: preallocated 256 KiB pool for atomic coherent allocations[ 0.048814] thermal_sys: Registered thermal governor 'step_wise'[ 0.049110] cpuidle: using governor menu[ 0.049319] CPU identified as i.MX6Q, silicon rev 1.5[ 0.067097] vdd3p0: supplied by regulator-dummy[ 0.068582] mxs_phy 20c9000.usbphy: supply phy-3p0 not found, using dummy regulator[ 0.069169] mxs_phy 20ca000.usbphy: supply phy-3p0 not found, using dummy regulator[ 0.080225] platform 21dc000.mipi: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu2_csi1_mux[ 0.080311] platform 21dc000.mipi: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi0_mux[ 0.081610] platform 2400000.ipu: Fixing up cyclic dependency with ldb[ 0.081699] platform 2400000.ipu: Fixing up cyclic dependency with 21e0000.mipi[ 0.081777] platform 2400000.ipu: Fixing up cyclic dependency with 21dc000.mipi[ 0.081855] platform 2400000.ipu: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu1_csi0_mux[ 0.084060] platform 2800000.ipu: Fixing up cyclic dependency with ldb[ 0.084154] platform 2800000.ipu: Fixing up cyclic dependency with 21e0000.mipi[ 0.084242] platform 2800000.ipu: Fixing up cyclic dependency with 20e0000.iomuxc-gpr:ipu2_csi1_mux[ 0.084322] platform 2800000.ipu: Fixing up cyclic dependency with 21dc000.mipi[ 0.090590] No ATAGs?[ 0.090740] hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.[ 0.090758] hw-breakpoint: maximum watchpoint size is 4 bytes.[ 0.091747] imx6q-pinctrl 20e0000.pinctrl: initialized IMX pinctrl driver[ 0.094546] imx mu driver is registered.[ 0.095046] imx rpmsg driver is registered.[ 0.109548] Kprobes globally optimized[ 0.128460] vgaarb: loaded[ 0.129356] SCSI subsystem initialized[ 0.129862] usbcore: registered new interface driver usbfs[ 0.129919] usbcore: registered new interface driver hub[ 0.129978] usbcore: registered new device driver usb[ 0.130112] usb_phy_generic usbphynop1: supply vcc not found, using dummy regulator[ 0.130264] usb_phy_generic usbphynop1: dummy supplies not allowed for exclusive requests[ 0.130418] usb_phy_generic usbphynop2: supply vcc not found, using dummy regulator[ 0.130548] usb_phy_generic usbphynop2: dummy supplies not allowed for exclusive requests[ 0.131715] gpio-155 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file[ 0.132827] i2c i2c-0: IMX I2C adapter registered[ 0.133604] gpio-108 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file[ 0.135490] i2c i2c-1: IMX I2C adapter registered[ 0.136150] gpio-3 (scl): enforced open drain please flag it properly in DT/ACPI DSDT/board file[ 0.137286] i2c i2c-2: IMX I2C adapter registered[ 0.138030] mc: Linux media interface: v0.10[ 0.138094] videodev: Linux video capture interface: v2.00[ 0.138193] pps_core: LinuxPPS API ver. 1 registered[ 0.138205] pps_core: Software ver. 5.3.6 - Copyright - Rodolfo Giometti <giometti@linux.it>[ 0.138232] PTP clock support registered[ 0.167680] imx-ipuv3 2400000.ipu: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)[ 0.197672] imx-ipuv3 2800000.ipu: IPU DMFC NORMAL mode: 1(0~1), 5B(4,5), 5F(6,7)[ 0.199295] mxc_vdoa 21e4000.vdoa: i.MX Video Data Order Adapter(VDOA) driver probed[ 0.200047] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 driver probed[ 0.200064] mxc_mipi_csi2 21dc000.mipi: i.MX MIPI CSI2 dphy version is 0x3130302a[ 0.48] MIPI CSI2 driver module loaded[ 0.01] Advanced Linux Sound Architecture Driver Initialized.[ 0.16] Bluetooth: Core ver 2.22[ 0.65] NET: Registered PF_BLUETOOTH protocol family[ 0.77] Bluetooth: HCI device and connection manager initialized[ 0.96] Bluetooth: HCI socket layer initialized[ 0.20] Bluetooth: L2CAP socket layer initialized[ 0.33] Bluetooth: SCO socket layer initialized[ 0.202619] clocksource: Switched to clocksource mxc_timer1[ 0.202816] VFS: Disk quotas dquot_6.6.0[ 0.202907] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)[ 0.211547] NET: Registered PF_INET protocol family[ 0.212235] IP idents hash table entries: 32768 (order: 6, 262144 bytes, linear)[ 0.214180] tcp_listen_portaddr_hash hash table entries: 1024 (order: 1, 12288 bytes, linear)[ 0.214286] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)[ 0.214312] TCP established hash table entries: 16384 (order: 4, 65536 bytes, linear)[ 0.214479] TCP bind hash table entries: 16384 (order: 5, 131072 bytes, linear)[ 0.214782] TCP: Hash tables configured (established 16384 bind 16384)[ 0.215019] UDP hash table entries: 1024 (order: 3, 32768 bytes, linear)[ 0.215111] UDP-Lite hash table entries: 1024 (order: 3, 32768 bytes, linear)[ 0.215372] NET: Registered PF_UNIX/PF_LOCAL protocol family[ 0.216061] RPC: Registered named UNIX socket transport module.[ 0.216079] RPC: Registered udp transport module.[ 0.216090] RPC: Registered tcp transport module.[ 0.216102] RPC: Registered tcp NFSv4.1 backchannel transport module.[ 0.217064] PCI: CLS 0 bytes, default 64[ 0.217420] armv7-pmu pmu: hw perfevents: no interrupt-affinity property, guessing.[ 0.217666] hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available[ 0.220269] Bus freq driver module loaded[ 0.221270] Initialise system trusted keyrings[ 0.221607] workingset: timestamp_bits=14 max_order=19 bucket_order=5[ 0.227174] NFS: Registering the id_resolver key type[ 0.227227] Key type id_resolver registered[ 0.227240] Key type id_legacy registered[ 0.227325] nfs4filelayout_init: NFSv4 File Layout Driver Registering...[ 0.227340] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...[ 0.227382] jffs2: version 2.2. (NAND) © 2001- Red Hat, Inc.[ 0.227885] fuse: init (API version 7.34)[ 0.327717] Key type asymmetric registered[ 0.327737] Asymmetric key parser 'x509' registered[ 0.327837] bounce: pool size: 64 pages[ 0.327874] io scheduler mq-deadline registered[ 0.327889] io scheduler kyber registered[ 0.333154] pwm-backlight backlight-lvds: supply power not found, using dummy regulator[ 0.337706] mxc_mipi_dsi 21e0000.mipi: i.MX MIPI DSI driver probed[ 0.339639] mxc_hdmi 20e0000.hdmi_video: supply HDMI not found, using dummy regulator[ 0.342171] mxc_sdc_fb fb@0: registered mxc display driver ldb[ 0.372698] imx-ipuv3 2800000.ipu: IPU DMFC DP HIGH RESOLUTION: 1(0,1), 5B(2~5), 5F(6,7)[ 0.440299] Console: switching to colour frame buffer device 128x48[ 0.476818] mxc_hdmi 20e0000.hdmi_video: Detected HDMI controller 0x13:0xa:0xa0:0xc1[ 0.476872] fbcvt: 1920x1080@60: CVT Name - 2.073M9[ 0.476979] mxc_sdc_fb fb@1: registered mxc display driver hdmi[ 0.518247] mxc_sdc_fb fb@2: registered mxc display driver lcd[ 0.518267] mxc_sdc_fb fb@2: ipu0-di0 already in use[ 0.518283] mxc_sdc_fb: probe of fb@2 failed with error -16[ 0.518356] mxc_sdc_fb fb@3: registered mxc display driver ldb[ 0.532659] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2[ 0.532683] imx-sdma 20ec000.sdma: Falling back to sysfs fallback for: imx/sdma/sdma-imx6q.bin[ 0.534309] mxs-dma 110000.dma-apbh: initialized[ 0.538097] pfuze100-regulator 1-0008: unrecognized pfuze chip ID![ 0.539734] 000.serial: ttymxc0 at MMIO 0x000 (irq = 31, base_baud = 5000000) is a IMX[ 1.637288] printk: console [ttymxc0] enabled[ 1.643621] imx sema4 driver is registered.[ 1.662776] brd: module loaded[ 1.673811] loop: module loaded[ 1.678543] ahci-imx 2200000.sata: fsl,transmit-level-mV not specified, using 00000024[ 1.686520] ahci-imx 2200000.sata: fsl,transmit-boost-mdB not specified, using 00000480[ 1.694552] ahci-imx 2200000.sata: fsl,transmit-atten-16ths not specified, using 00002000[ 1.702753] ahci-imx 2200000.sata: fsl,receive-eq-mdB not specified, using 05000000[ 1.710494] ahci-imx 2200000.sata: supply ahci not found, using dummy regulator[ 1.717995] ahci-imx 2200000.sata: supply phy not found, using dummy regulator[ 1.725308] ahci-imx 2200000.sata: supply target not found, using dummy regulator[ 1.737206] ahci-imx 2200000.sata: SSS flag set, parallel bus scan disabled[ 1.744226] ahci-imx 2200000.sata: AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl platform mode[ 1.753053] ahci-imx 2200000.sata: flags: ncq sntf stag pm led clo only pmp pio slum part ccc apst[ 1.763911] scsi host0: ahci-imx[ 1.767459] ata1: SATA max UDMA/133 mmio [mem 0x02200000-0x02203fff] port 0x100 irq 85[ 1.775631] imx ahci driver is registered.[ 1.783788] spi-nor spi0.0: found w25q32, expected m25p32[ 1.789215] spi-nor spi0.0: w25q32 (4096 Kbytes)[ 1.797300] tun: Universal TUN/TAP device driver, 1.6[ 1.802547] CAN device driver interface[ 1.808534] pps pps0: new PPS source ptp0[ 2.104117] ata1: SATA link down (SStatus 0 SControl 300)[ 2.109572] ahci-imx 2200000.sata: no device found, disabling link.[ 2.115875] ahci-imx 2200000.sata: pass ahci_imx..hotplug=1 to enable hotplug[ 2.173353] fec 2188000.ethernet eth0: registered PHC device 0[ 2.180413] usbcore: registered new interface driver r8152[ 2.185983] usbcore: registered new interface driver lan78xx[ 2.191688] usbcore: registered new interface driver asix[ 2.197147] usbcore: registered new interface driver ax88179_178a[ 2.203294] usbcore: registered new interface driver cdc_ether[ 2.209187] usbcore: registered new interface driver smsc95xx[ 2.214994] usbcore: registered new interface driver net1080[ 2.220689] usbcore: registered new interface driver cdc_subset[ 2.226661] usbcore: registered new interface driver zaurus[ 2.232269] usbcore: registered new interface driver MOSCHIP usb-ethernet driver[ 2.239757] usbcore: registered new interface driver cdc_ncm[ 2.245477] usbcore: registered new interface driver r8153_ecm[ 2.251315] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver[ 2.257863] ehci-pci: EHCI PCI platform driver[ 2.262395] usbcore: registered new interface driver usb-storage[ 2.271673] SPI driver ads7846 has no spi_device_id for ti,tsc2046[ 2.277885] SPI driver ads7846 has no spi_device_id for ti,ads7843[ 2.284097] SPI driver ads7846 has no spi_device_id for ti,ads7845[ 2.290283] SPI driver ads7846 has no spi_device_id for ti,ads7873[ 2.297407] egalax_ts 1-0004: Failed to switch to I2C interface[ 2.303804] egalax_ts 2-0004: Failed to switch to I2C interface[ 2.312957] snvs_rtc 20cc000.snvs:snvs-rtc-lp: registered as rtc0[ 2.319080] snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 1970-01-01T00:00:00 UTC (0)[ 2.328258] i2c_dev: i2c /dev entries driver[ 2.334558] mxc_v4l2_output v4l2_out: V4L2 device registered as video16[ 2.341313] mxc_v4l2_output v4l2_out: V4L2 device registered as video17[ 2.348102] mxc_v4l2_output v4l2_out: V4L2 device registered as video18[ 2.354881] mxc_v4l2_output v4l2_out: V4L2 device registered as video19[ 2.361638] mxc_v4l2_output v4l2_out: V4L2 device registered as video20[ 2.371509] Bluetooth: HCI UART driver ver 2.3[ 2.375989] Bluetooth: HCI UART protocol H4 registered[ 2.381136] Bluetooth: HCI UART protocol BCSP registered[ 2.386507] Bluetooth: HCI UART protocol LL registered[ 2.391674] Bluetooth: HCI UART protocol Three-wire (H5) registered[ 2.397993] Bluetooth: HCI UART protocol Marvell registered[ 2.403638] usbcore: registered new interface driver btusb[ 2.410187] sdhci: Secure Digital Host Controller Interface driver[ 2.416405] sdhci: Copyright(c) Pierre Ossman[ 2.420766] sdhci-pltfm: SDHCI platform and OF driver helper[ 2.427742] sdhci-esdhc-imx 2194000.mmc: Got CD GPIO[ 2.428089] sdhci-esdhc-imx 2198000.mmc: Got CD GPIO[ 2.429135] usbcore: registered new interface driver usbhid[ 2.429143] usbhid: USB HID core driver[ 2.434548] isl29018 2-0044: No cache defaults, reading back from HW[ 2.437872] sdhci-esdhc-imx 2198000.mmc: Got WP GPIO[ 2.444169] isl29018 2-0044: Failed to read 1: -6[ 2.463263] isl29018 2-0044: regmap initialization fails: -6[ 2.474400] mxc_hdmi_cec soc:hdmi_cec@120000: HDMI CEC initialized[ 2.475178] mmc3: SDHCI controller on 219c000.mmc [219c000.mmc] using ADMA[ 2.483356] mmc1: SDHCI controller on 2194000.mmc [2194000.mmc] using ADMA[ 2.488358] wm8962 0-001a: Failed to read ID register[ 2.499650] mmc2: SDHCI controller on 2198000.mmc [2198000.mmc] using ADMA[ 2.504095] fsl-ssi-dai 202c000.ssi: No cache defaults, reading back from HW[ 2.522717] NET: Registered PF_LLC protocol family[ 2.528099] NET: Registered PF_INET6 protocol family[ 2.528409] mmc1: host does not support reading read-only switch, assuming write-enable[ 2.534250] Segment Routing with IPv6[ 2.544244] mmc1: new high speed SDHC card at address aaaa[ 2.544843] In-situ OAM (IOAM) with IPv6[ 2.551138] mmcblk1: mmc1:aaaa SD32G 29.7 GiB[ 2.554345] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver[ 2.555220] mmc3: new DDR MMC card at address 0001[ 2.559547] mmcblk3: mmc3:0001 AJTD4R 14.6 GiB[ 2.565363] NET: Registered PF_PACKET protocol family[ 2.569869] mmcblk1: p1 p2 p3 p4[ 2.574047] can: controller area network core[ 2.580693] mmcblk3: p1 p2[ 2.582586] NET: Registered PF_CAN protocol family[ 2.587707] mmcblk3boot0: mmc3:0001 AJTD4R 4.00 MiB[ 2.589579] can: raw protocol[ 2.596718] mmcblk3boot1: mmc3:0001 AJTD4R 4.00 MiB[ 2.599362] can: broadcast manager protocol[ 2.604303] mmcblk3rpmb: mmc3:0001 AJTD4R 4.00 MiB, chardev (240:0)[ 2.607315] can: netlink gateway - max_hops=1[ 2.622492] Bluetooth: RFCOMM TTY layer initialized[ 2.627437] Bluetooth: RFCOMM socket layer initialized[ 2.632602] Bluetooth: RFCOMM ver 1.11[ 2.636422] Bluetooth: BNEP (Ethernet Emulation) ver 1.3[ 2.641742] Bluetooth: BNEP filters: protocol multicast[ 2.646996] Bluetooth: BNEP socket layer initialized[ 2.651967] Bluetooth: HIDP (Human Interface Emulation) ver 1.2[ 2.657908] Bluetooth: HIDP socket layer initialized[ 2.663113] lib80211: common routines for IEEE802.11 drivers[ 2.668872] Key type dns_resolver registered[ 2.674122] Registering SWP/SWPB emulation handler[ 2.679161] Loading compiled-in X.509 certificates[ 2.722526] galcore 130000.gpu: deferred probe timeout, ignoring dependency[ 2.729612] galcore: probe of 130000.gpu failed with error -110[ 2.736190] mxc_vpu 2040000.vpu_fsl: deferred probe timeout, ignoring dependency[ 2.743671] mxc_vpu: probe of 2040000.vpu_fsl failed with error -110[ 2.753749] gpio-keys gpio-keys: failed to get gpio: -16[ 2.759076] gpio-keys: probe of gpio-keys failed with error -16[ 2.765637] cfg80211: Loading compiled-in X.509 certificates for regulatory database[ 2.777167] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'[ 2.783836] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2[ 2.792460] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db[ 2.792945] ALSA device list:[ 2.803205] #0: imx-hdmi-soc[ 2.836947] EXT4-fs (mmcblk1p3): recovery complete[ 2.842748] EXT4-fs (mmcblk1p3): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.[ 2.852555] VFS: Mounted root (ext4 filesystem) on device 179:3.[ 2.860124] devtmpfs: mounted[ 2.865714] Freeing unused kernel image (initmem) memory: 1024K[ 2.913101] Run /sbin/init as init processPlease press Enter to activate this console./ # ifconfig/ # ifconfig -aeth0Link encap:Ethernet HWaddr 0E:B4:00:52:24:0EBROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)lo Link encap:Local LoopbackLOOPBACK MTU:65536 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)sit0Link encap:IPv6-in-IPv4NOARP MTU:1480 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)/ #/ # ifconfig eth0 192.168.1.1[ 42.633032] RTL8211E Gigabit Ethernet 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL )/ #/ # ifconfigeth0Link encap:Ethernet HWaddr 0E:B4:00:52:24:0Einet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0UP BROADCAST MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:0 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)/ #

连接路由器

需要通过网线,连接到路由器,或者交叉网线连接到 电脑

设置 网络 参数,网卡设备默认为eth0,使用 ifconfig 命令配置

ifconfig eth0 downifconfig eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.1

/ # ifconfig eth0eth0Link encap:Ethernet HWaddr 0E:B4:00:52:24:0Einet addr:192.168.1.10 Bcast:192.168.1.1 Mask:255.255.255.0inet6 addr: fe80::cb4:ff:fe52:240e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:0 errors:0 dropped:0 overruns:0 frame:0TX packets:11 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:0 (0.0 B) TX bytes:906 (906.0 B)/ # ifconfig eth0 down/ # ifconfig eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.1[ 3114.153029] RTL8211E Gigabit Ethernet 2188000.ethernet-1:00: attached PHY driver (mii_bus:phy_addr=2188000.ethernet-1:00, irq=POLL)/ # [ 3116.233066] fec 2188000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx[ 3116.240938] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready/ #/ #/ # ping 192.168.1.1PING 192.168.1.1 (192.168.1.1): 56 data bytes64 bytes from 192.168.1.1: seq=0 ttl=64 time=0.423 ms64 bytes from 192.168.1.1: seq=1 ttl=64 time=0.217 ms64 bytes from 192.168.1.1: seq=2 ttl=64 time=0.197 ms64 bytes from 192.168.1.1: seq=3 ttl=64 time=0.187 ms64 bytes from 192.168.1.1: seq=4 ttl=64 time=0.189 ms^C--- 192.168.1.1 ping statistics ---5 packets transmitted, 5 packets received, 0% packet lossround-trip min/avg/max = 0.187/0.242/0.423 ms/ #/ #/ # ifconfigeth0Link encap:Ethernet HWaddr 0E:B4:00:52:24:0Einet addr:192.168.1.10 Bcast:192.168.1.1 Mask:255.255.255.0inet6 addr: fe80::cb4:ff:fe52:240e/64 Scope:LinkUP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1RX packets:6 errors:0 dropped:0 overruns:0 frame:0TX packets:25 errors:0 dropped:0 overruns:0 carrier:0collisions:0 txqueuelen:1000RX bytes:586 (586.0 B) TX bytes:2094 (2.0 KiB)

通过以上信息,【迅为iMX6Q】开发板 Linux 5.15.71 RTL8211E 以太网驱动适配 成功了

小结

注意遇到问题,可以通过查看代码,定位到问题,这样更能找到解决问题的方法,如上面找不到设备,最终是 PHY 地址默认不正确导致的。

Linux 5.15.71 适配RTL8211E 以太网驱动,还是相对比较的容易,只需要简单的配置一下,修改设备树文件即可。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。