OPENWRT 端口link问题

1,配置测试:

2,定位思路:

对比其他商品的打印:

printenv,查看端口的映射关系。

手动测试设置参数:

setenv board_args 09ffffff:00000000

setenv 8811phy_addr 0-0-0-0-F
修改rb_default

setenv rb_default "123,112,001,001,000,aab,bbb"

设置后saveenv,重启,查看端口情况。

主要差异在phy_addr

在 mi.conf 中,其他与 SerDes 相关的配置包括:

srdsEtherPhyTypeAllComp=7,NONE,an8811,A,B,C,D,E: 设置 phy_type。

srdsEtherTypeAllComp=3,NONE,LAN,WAN: 设置 ether type,目前仅支持三种类型。

srdsIfNameAllComp=12,NONE,XFI,USXGMII,HSGMII,PON,PCIE_G3_1LANE,PCIE_G2_1LANE,USB3.0,USB2.0_only,HSGMII+USB2.0,5G_BaseR,FTTR_OLT: 设置整体的 SerDes 类型,目前总共支持 12 种。

srdsPortCnt=5: SerDes 的总数,例如 SerDes PON, SerDes Ethernet 等

1.2.5Gxmac的口是怎么定义的,比如port口是几

可在mi.conf文件或boot命令行使用printenv查看board_args参数,以值ffffffff:0c000000按照从左往右16位,每2位代表一个Port,共计8个Port.ff表示GSW,09表示hsgmii_USB,0A表示

hsgmll_pcie0,0B表示hsgml_pcie1,0C表示hsgmilether.因此上面的值表示port0/1/2/3-gsw,port4对应etherserdes,5/6/7未配置。启动的接口会有eth0.1/0.2/0.3/0.4/0.5

改成:09ffffff:00000000, eth0.1使用hsgmii_USB。

eth0.1怎么和serdes 关联的。

root@openwrt:/# sys serdes

Serdes-1:IF=PON, EtherType=NONE, Ether PHY Type=NONE

Serdes-2:IF=FTTR_OLT, EtherType=NONE, Ether PHY Type=NONE

Serdes-3:IF=PCIE_G2-iLANE, EtherType=NONE, Ether PHY Type=NONE

Serdes-4:IF=PCIE_G2-iLANE, EtherType=NONE, Ether PHY Type=NONE

Serdes-5:IF=HSGMII+USB2.0, Ether Type=NONE,Ether PHY_Type=an8811

8811phy_addr=0-0-0-0-F

第1位(最左边):PON SerDes PHY地址

第2位:ETH SerDes PHY地址

第3位:PCIe0 SerDes PHY地址

第4位:PCIe1 SerDes PHY地址

第5位(最右边):USB1 SerDes PHY地址

2.怎么获取2.5G口link状态,配置协商模式等等

mac层查看链接状态,cat/proc/tc3162/hsgmil后Tab键,看生成了哪些proc方法,本例中由于boardargs配置了oc即etherserdes因此生成了eth_lan相关的proc方法,可查看link状态

phy层,以airoha2.5Gphy8811为例,如果s8811相关ko加载可查看/proc/tc3162/en8811linkst关方法如果你们使用自已的phy,则需要自己实现相关方法;

查看mdio访问phy相关寄存器

cat /sys/kernel/debug/eth0.1/link_status

查看mac测的link 状态

在 mi.conf 中,其他与 SerDes 相关的配置包括:

srdsEtherPhyTypeAllComp=7,NONE,an8811,A,B,C,D,E: 设置 phy_type。

srdsEtherTypeAllComp=3,NONE,LAN,WAN: 设置 ether type,目前仅支持三种类型。

srdsIfNameAllComp=12,NONE,XFI,USXGMII,HSGMII,PON,PCIE_G3_1LANE,PCIE_G2_1LANE,USB3.0,USB2.0_only,HSGMII+USB2.0,5G_BaseR,FTTR_OLT: 设置整体的 SerDes 类型,目前总共支持 12 种。

srdsPortCnt=5: SerDes 的总数,例如 SerDes PON, SerDes Ethernet 等

The figure above indicates which MACs are shared by each Serdes.

serdes_0: Shared by XSI MAC and PON MAC under GDMA2;

serdes_1: An XSI MAC under GDMA4 is exclusively used

serdes_2/serdes_3: Shared by XSI MAC under GDMA3 and PCIE 0/PCIE1 MAC;

serdes_4: Shared by HSGMII MAC and USB MAC under GDMA4.

serdes_5: This Serdes is not used by XSI shared by USB / PCIE2 MAC.

如何查看端口状态:

01.27-21:45:08\]root@OpenWrt:/# cat /proc/tc3162/hsgmii_usb_lan_link_status \[01.27-21:45:08\]hsgmii_lan_phy_link_status = up \[01.27-21:45:08\]hsgmii_lan_phy_mode = 5 \[01.27-21:45:08\]hsgmii_lan_linkrate = 3 \[01.27-21:45:38\]root@OpenWrt:/# cat /proc/tc3162/en8811_link_st \[01.27-21:45:38\]PHY\[eth0.6\]: 1000Mbps/Full

7583 OpenWrt firmware supports that same firmware used on different RFB testboard, which gpio or
configurations are different. After startup , boot will select the DTB based by rfb_id1 config.
an7583_evb1.dtb: corresponds to all boards of rfb_id1=1series.
an7583_evb2.dtb corresponds to the rfb_id1=2series, and so on.

相关推荐
小码吃趴菜6 分钟前
服务器预约系统linux小项目-第二节课
linux·运维·服务器
路溪非溪7 分钟前
关于Linux中的日志问题
linux·arm开发·驱动开发
linux修理工10 分钟前
ip a 命令解析与 IP 地址提取
linux·服务器·php
万象.12 分钟前
Linux网络层相关知识及报文格式
linux·网络·智能路由器
穷途末路程序员15 分钟前
linux设备驱动程序框架(进阶1)——利用udev自动生成设备文件
linux
程序猿编码17 分钟前
轻量又灵活:一款伪造TCP数据包的iptables扩展实现解析(C/C++代码实现)
linux·c语言·网络·c++·tcp/ip·内核·内核模块
_OP_CHEN21 分钟前
【Linux网络编程】(二)计算机网络概念进阶:彻底搞懂协议本质、传输流程与封装分用
linux·运维·服务器·网络·网络协议·计算机网络·c/c++
风曦Kisaki21 分钟前
# 云计算基础Day06:Linux权限管理
linux·云计算
勇闯逆流河24 分钟前
【Linux】linux进程概念(fork,进程状态,僵尸进程,孤儿进程)
linux·运维·服务器·开发语言·c++
牛十二24 分钟前
宝塔安装openclaw+企业微信操作手册
linux·运维·服务器