谷动谷力

 找回密码
 立即注册
查看: 204|回复: 0
打印 上一主题 下一主题
收起左侧

MT76x8 openwrt配置dts多网口

[复制链接]
跳转到指定楼层
楼主
发表于 2024-1-29 11:42:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
MT76x8 openwrt配置dts多网口


对于MT76x8芯片的OpenWrt,要想实现多网口功能,需要进行DTS配置。以下是配置步骤:

1. 打开Openwrt源码中的MT7688.dtsi文件,此文件在openwrt/target/linux/ramips/dts目录下。

2. 在文件中增加一个新节点,以ethernet@10100000为例:
  1.     ethernet@10100000 {

  2.         #address-cells = <1>;

  3.         #size-cells = <0>;

  4.         compatible = "mediatek,eth-mac";

  5.         reg = <0x10100000 0x800>;

  6.         interrupts = <27>;

  7.         clocks = <&ralink_sysctl CLK_RGMIIMAC>;

  8.         resets = <&ralink_sysctl 0 3>;

  9.         ralink,portmap = "wllll";

  10.         phymode = "mii";

  11.     };
复制代码

其中,#address-cells和#size-cells属性的值都为1,代表地址和大小都是1,reg属性中的0x10100000和0x800分别为MAC寄存器的地址和大小,compatible属性为中信微的eth-mac,phymode属性为mii,代表使用MII PHY。

3. 在文件的全局节点中加入新节点的引用,例如:   
  1. ahb {
  2.         compatible = "simple-bus";
  3.         #address-cells = <1>;
  4.         #size-cells = <1>;
  5.         ranges;
  6.         ethernet@10100000 {
  7.             compatible = "mediatek,eth-mac";
  8.             reg = <0x10100000 0x800>;
  9.             interrupts = <27>;
  10.             clocks = <&ralink_sysctl CLK_RGMIIMAC>;
  11.             resets = <&ralink_sysctl 0 3>;
  12.             ralink,portmap = "wllll";
  13.             phymode = "mii";
  14.         };
  15.     };
复制代码

4. 保存文件,并重新编译OpenWrt固件,然后通过ifconfig命令查看多网口是否已经被识别。

5. 如果需要增加更多的网口,只需要按照步骤1-4进行相应的修改即可。

+10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|深圳市光明谷科技有限公司|光明谷商城|Sunshine Silicon Corpporation ( 粤ICP备14060730号|Sitemap

GMT+8, 2024-5-19 15:02 , Processed in 0.105756 second(s), 41 queries .

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表