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.

相关推荐
我真的想 啸3 小时前
在 Ubuntu 24.04 系统上安装并使用 Codex CLI
linux·ubuntu·arcgis
嵌入小生0076 小时前
线程(2)/ 线程属性 /相关函数接口--- 嵌入式(Linux)
linux·嵌入式·线程·软件编程·僵尸线程·马年开工第一学·线程属性
No8g攻城狮6 小时前
【Linux】Linux nano 编辑器全攻略:从入门到精通
linux·运维·编辑器·nano
zl_dfq7 小时前
Linux 之 【网络套接字编程】(固定宽度整数类型、socket常见API、netstat)
linux·网络
huaweichenai9 小时前
Linux安装http-server并部署html静态站点
linux·运维·服务器
Gss7779 小时前
Linux 正则表达式详解(基础 + 扩展 + 实操)
linux·运维·正则表达式
北冥湖畔的燕雀9 小时前
Linux权限与Vim,gcc以及make/makefile操作全解析
linux·运维·服务器
代码游侠9 小时前
Linux驱动复习——驱动
linux·运维·arm开发·笔记·学习
LuDvei10 小时前
LINUX文件操作函数
java·linux·算法
czxyvX11 小时前
017-Linux-网络基础概念
linux·网络