Uboot设置网络,

一、选择对应的网卡,eth1,设置网络参数,

ast# setenv ethact eth1
ast# setenv ipaddr 192.168.5.8
ast# setenv gatewayip 192.168.255.255
ast# setenv netmask 255.255.0.0
ast# setenv serverip 192.168.1.48
ast# saveenv

 

ast# ping 192.168.1.48

 

二、测试Phy的连通性:

ast# mii
mii - MII utility commands

Usage:
mii device - list available devices
mii device <devname> - set current device
mii info <addr> - display MII PHY info
mii read <addr> <reg> - read MII PHY <addr> register <reg>
mii write <addr> <reg> <data> - write MII PHY <addr> register <reg>
mii modify <addr> <reg> <data> <mask> - modify MII PHY <addr> register <reg>
updating bits identified in <mask>
mii dump <addr> <reg> - pretty-print <addr> <reg> (0-5 only)
Addr and/or reg may be ranges, e.g. 2-7.
ast# <INTERRUPT>
ast#
ast# <INTERRUPT>
ast#
ast#
ast# mii device
MII devices: 'eth0' 'eth1' 'eth2' 'eth3'
Current device: 'eth0'
ast# <INTERRUPT>
ast# mii device eth1
ast# mii device
MII devices: 'eth0' 'eth1' 'eth2' 'eth3'
Current device: 'eth1'
ast# mii info
PHY 0x00: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
PHY 0x01: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
ast#
PHY 0x00: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
PHY 0x01: OUI = 0x0732, Model = 0x11, Rev = 0x06, 1000baseT, FDX
ast# mii device eth0
ast# mii info
PHY 0x00: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x01: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
....

PHY 0x1E: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX
PHY 0x1F: OUI = 0x0000, Model = 0x00, Rev = 0x00, 10baseT, HDX

ast# <INTERRUPT>
ast# <INTERRUPT>
ast#

 

三、测试Mac、Phy的延时

ast# mactest
chip: AST2600 A3
mactest <mac_idx> <mdio_idx> <speed> <ctrl> <loop_max> <test mode> <phy addr> <margin / IEEE select> <user data>
mac_idx[dec]| 0->MAC1 1->MAC2 2->MAC3 3->MAC4
mdio_idx[dec]| 0->MDIO1 1->MDIO2 2->MDIO3 3->MDIO4
speed[hex]| bit[0]->1G bit[1]->100M bit[2]->10M (default:0x07)
ctrl[hex]| default : 0x000
| bit0 : skip PHY init/deinit
| bit1 : skip PHY deinit
| bit2 : skip PHY ID check
| bit3 : reserved
| bit4 : PHY internal loopback
| bit5 : MAC internal loopback
| bit6 : Enable PHY RX delay
| bit7 : Enable PHY TX delay
| bit8 : RMII 50MHz Output enable
| bit9 : RMII REFCLK pin input enable
| bit10 : inverse RGMII RXCLK
| bit11 : reserved
| bit12 : TX single packet for each test point
| bit13 : full range scan
| bit15~14 : reserved
| bit16 : NCSI verbose log
| bit17 : NCSI skip RX error
| bit31~18 : reserved
loop_max[dec]| 1G : (default: 20)
| 100M: (default: 2)
| 10M : (default: 1)
test_mode[dec]| (default: 0)
| 0: TX/RX delay margin check
| 1: TX/RX delay scan
| 2: TX/RX delay and IO driving scan
| 3: TX frame - ARP
| 4: TX frame - random
| 5: TX frame - user defined (default:0xaaaaaaaa)
phy_addr[dec]| 0~31: PHY Address (default:0)
TX/RX delay margin| 1/2/3/... (default:2) only for test_mode 0
| check range = (orig - margin) ~ (orig + margin)
IEEE packet select| 0/1/2 (default:0) only for test_mode 3,4,5)
## Application terminated, rc = 0x1

 

常用命令,

测试 MAC2 MDIO2 1000M 的 PHY internal loopback

ast# mactest 1 1 1 0xD0
chip: AST2600 A3
ctrl=0x000d0
speed=0x1
mdio_idx=1
===================
ast2600 compatible = 1
ast2500 compatible = 1
valid MAC number = 4
use new MDIO register = 1 1 1 1
1G compatible = 1 1 1 1
===================
RGMIICK of MAC1/2 = 125048508 Hz
RGMIICK of MAC3/4 = 125048508 Hz
EPLL = 1000192752 Hz
HCLK = 200048316 Hz
mac address: 28:2b:b9:60:0b:89:
Legend:
o : OK
x : CRC error
. : packet not found
System default setting
O : OK
X : CRC error
* : packet not found

[1G ]========================================>

+++++
00000
89abc
|
0e: ooooo
0f: ooooo
10:-ooOoo
11: ooooo
12: ooooo
[PHY] @addr 0: id = 001c_c916 (RTL8211F)
## Application terminated, rc = 0x0

测试 MAC2 MDIO2 1000M 的 MAC internal loopback

ast# mactest 1 1 1 0xE0
chip: AST2600 A3
ctrl=0x000e0
speed=0x1
mdio_idx=1
===================
ast2600 compatible = 1
ast2500 compatible = 1
valid MAC number = 4
use new MDIO register = 1 1 1 1
1G compatible = 1 1 1 1
===================
RGMIICK of MAC1/2 = 125048508 Hz
RGMIICK of MAC3/4 = 125048508 Hz
EPLL = 1000192752 Hz
HCLK = 200048316 Hz
mac address: 28:2b:b9:60:0b:89:
Legend:
o : OK
x : CRC error
. : packet not found
System default setting
O : OK
X : CRC error
* : packet not found
Timeout: set RTL8211F

[1G ]========================================>

+++++
00000
89abc
|
0e: ooooo
0f: ooooo
10:-ooOoo
11: ooooo
12: ooooo
[PHY] @addr 0: id = 001c_c916 (RTL8211F)
## Application terminated, rc = 0x0

posted @ 2024-10-11 10:13  丶Future  阅读(147)  评论(0编辑  收藏  举报