【TINY4412】LINUX移植笔记:(11)以太网DM9621驱动

环境

宿主机 : 虚拟机 Ubuntu 16.04 LTS / X64
目标板[底板]: Tiny4412SDK - 1506
目标板[核心板]: Tiny4412 - 1412
LINUX内核: 4.12.0
交叉编译器: arm-none-linux-gnueabi-gcc(gcc version 4.8.3 20140320)
日期: 2017-9-9 20:30:09
作者: SY

简介

开发板使用的以太网芯片DM9621,基于USB接口,首先需要配置USB为主机模式。

1
2
3
4
Device Drivers --->
[*] Network device support --->
<*> USB Network Adapters --->
<*> Davicom DM96xx based USB 10/100 ethernet devices

测试

将开发板使用网线连接到路由器,将主机也连接到路由器

1
2
3
4
5
6
7
8
9
[root@TINY4412:/]# [ 3.010109] usb 2-2.4: new high-speed USB device number 3 using exynos-ehci
[ 3.160987] usb 2-2.4: config 1 interface 0 altsetting 0 endpoint 0x83 has an invalid bInterval 0, changing to 7
[ 3.237598] usb 2-2.4: New USB device found, idVendor=0a46, idProduct=9621
[ 3.237745] usb 2-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3.250666] dm9601 2-2.4:1.0 eth0: register 'dm9601' at usb-12580000.ehci-2.4, Davicom DM96xx USB 10/100 Ethernet, 00:00:ff:ff:00:00
[ 3.350251] usb 2-2.5: new high-speed USB device number 4 using exynos-ehci
[ 3.501430] usb 2-2.5: New USB device found, idVendor=0424, idProduct=2530
[ 3.501548] usb 2-2.5: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 3.501664] usb 2-2.5: Product: Bridge device

可以观察到小灯已经闪烁,ping一下主机。

1
2
3
4
5
[root@TINY4412:/]# ping 192.168.2.40
PING 192.168.2.40 (192.168.2.40): 56 data bytes
ping: sendto: Network is unreachable
[root@TINY4412:/]# ifconfig
[root@TINY4412:/]#

居然不能打印以太网配置信息,查资料是以太网没有配置IP地址

1
2
3
4
5
6
7
8
9
10
11
12
13
[root@TINY4412:/]# ifconfig eth0 192.168.2.39 netmask 255.255.255.0
[root@TINY4412:/]# ping 192.168.2.40
PING 192.168.2.40 (192.168.2.40): 56 data bytes
64 bytes from 192.168.2.40: seq=0 ttl=64 time=1.326 ms
64 bytes from 192.168.2.40: seq=1 ttl=64 time=0.664 ms
64 bytes from 192.168.2.40: seq=2 ttl=64 time=0.630 ms
64 bytes from 192.168.2.40: seq=3 ttl=64 time=0.604 ms
64 bytes from 192.168.2.40: seq=4 ttl=64 time=0.629 ms
64 bytes from 192.168.2.40: seq=5 ttl=64 time=0.683 ms
^C
--- 192.168.2.40 ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max = 0.604/0.756/1.326 ms

每次开机都需要配置IP地址,网络才能工作。

SY wechat
扫一扫,用手机访问本站