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:08root@OpenWrt:/# cat /proc/tc3162/hsgmii_usb_lan_link_status

01.27-21:45:08hsgmii_lan_phy_link_status = up

01.27-21:45:08hsgmii_lan_phy_mode = 5

01.27-21:45:08hsgmii_lan_linkrate = 3

01.27-21:45:38root@OpenWrt:/# cat /proc/tc3162/en8811_link_st

01.27-21:45:38PHYeth0.6: 1000Mbps/Full

如何闲着dts:select by rfb_id
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.

相关推荐
DFT计算杂谈2 小时前
无 Root 权限在 Tesla K80 零门槛部署 DeepSeek 大模型
linux·服务器·网络·数据库·机器学习
Zhang~Ling3 小时前
从 fopen 到 struct file:从零开始拆解 Linux 文件 I/O
linux·运维·服务器
DeeplyMind3 小时前
Linux 深入 per-VMA lock:Linux 缺页路径如何摆脱 mmap_lock
linux·per-vma lock
爱写代码的森3 小时前
蒙三方库 | harmony-utils之FileUtil文件重命名与属性查询详解
linux·运维·服务器·华为·harmonyos·鸿蒙·huawei
XMAIPC_Robot4 小时前
软硬协同实时控制|RK3588业务调度+FPGA硬件时序,ethercat实现半导体设备微秒级响应(125us)
linux·arm开发·人工智能·fpga开发
重生的黑客5 小时前
Linux 进程优先级、切换与调度:从孤儿进程到 O(1) 调度模型
linux·运维·服务器·进程优先级·nice
骑上单车去旅行6 小时前
MD5校验对比脚本
linux·服务器·windows
平生幻6 小时前
Linux 常用命令
linux
ShirleyWang0128 小时前
让headlamp控制台能访问
linux·服务器·python·k8s·k3s
liuccn8 小时前
Linux 存储系统:LVM 与直接分区
linux·运维