Recently, I used mx515 CPU for a video phone project. previously compiled kernel startup has always been a problem,
You can see that eth0 is not found in ifconfig after startup. Run the following command:
# Ifconfig
Lo link encap: local loopback
Inet ADDR: 127.0.0.1 mask: 255.0.0.0
Up loopback running MTU: 16436 Metric: 1
RX packets: 3 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 3 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX Bytes: 280 (280.0 B) TX Bytes: 280 (280.0 B)
# Ifconfig-
Eth0 link encap: Ethernet hwaddr 00: 00: 00: 00: 00: 00
Broadcast multicast MTU: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B)
Base Address: 0xc000
Lo link encap: local loopback
Inet ADDR: 127.0.0.1 mask: 255.0.0.0
Up loopback running MTU: 16436 Metric: 1
RX packets: 5 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 5 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX Bytes: 455 (455.0 B) TX Bytes: 455 (455.0 B)
Very depressing. Looking back at the FEC startup log information, I found:
FEC enet version 0.2
FEC: PHY @ 0x2, Id 0x0007c0f1 -- lan8710
Eth0: Ethernet 00: 00: 00: 00: 00: 00
It turns out that the MAC address is 0. You can use the following command in the kernel:
Method 1:
# Ifconfig eth0 HW ether 00: 04: 9f: 00: Ea: 09
# Ifconfig
Lo link encap: local loopback
Inet ADDR: 127.0.0.1 mask: 255.0.0.0
Up loopback running MTU: 16436 Metric: 1
RX packets: 21 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 21 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX Bytes: 1855 (1.8 kib) TX Bytes: 1855 (1.8 kib)
# Ifconfig eth0 up
# Ifconfig
Eth0 link encap: Ethernet hwaddr 00: 04: 9f: 00: Ea: 09
Up broadcast running Multicast MTU: 1500 Metric: 1
RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 FIG: 1000
RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B)
Base Address: 0xc000
Lo link encap: local loopback
Inet ADDR: 127.0.0.1 mask: 255.0.0.0
Up loopback running MTU: 16436 Metric: 1
RX packets: 23 errors: 0 dropped: 0 overruns: 0 frame: 0
TX packets: 23 errors: 0 dropped: 0 overruns: 0 carrier: 0
Collisions: 0 txqueuelen: 0
RX Bytes: 2030 (1.9 kib) TX Bytes: 2030 (1.9 kib)
#
Yes.
Method 2:
Set the MAC address when uboot starts. The following is the MAC address for FEC,
Vdphone U-boot> set fec_addr 00: 04: 9f: 00: Ea: 09
Vdphone U-boot> Save