找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 7703|回复: 28

给水星D26G pro 适配OPENWRT,5.4 内核

[复制链接]
发表于 2020-7-7 17:07 | 显示全部楼层 |阅读模式
本帖最后由 laomao9000 于 2023-3-27 16:18 编辑

水星D26G pro  MT7621AT+        MT7615N+MT7615N,DDR3ram128M,8M spi nor 闪存,支持2.4G 4*4,800M,5G也是4*4,1733M,
参数:reset按钮:GPIO 8,LED:gpio 25 ,TTL:57600
选用了LEAN的源码,经过反复测试,还是选取了MT7615的闭源驱动,开源驱动不成熟,非常卡。

具体过程:
增加DTS文件 /openwrt/target/linux/ramips/dts/mt7621_mercury_d26g.dts
  1. /dts-v1/;

  2. #include "mt7621.dtsi"

  3. #include <dt-bindings/gpio/gpio.h>
  4. #include <dt-bindings/input/input.h>

  5. / {
  6.         compatible = "mercury,d26g", "mediatek,mt7621-soc";
  7.         model = "Mercury D26G";

  8.         aliases {
  9.                 led-boot = &led_status;
  10.                 led-failsafe = &led_status;
  11.                 led-running = &led_status;
  12.                 led-upgrade = &led_status;
  13.         };

  14.         chosen {
  15.                 bootargs = "console=ttyS0,57600";
  16.         };

  17.         leds {
  18.                 compatible = "gpio-leds";

  19.                 led_status: status {
  20.                         label = "d26g:white:status";
  21.                         gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
  22.                 };
  23.         };

  24.         keys {
  25.                 compatible = "gpio-keys";

  26.                 reset {
  27.                         label = "reset";
  28.                         gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
  29.                         linux,code = <KEY_RESTART>;
  30.                 };
  31.         };
  32. };

  33. &spi0 {
  34.         status = "okay";

  35.         m25p80@0  {
  36.                 compatible = "jedec,spi-nor";
  37.                 reg = <0>;
  38.                 spi-max-frequency = <1000000>;

  39.                 partitions {
  40.                         compatible = "fixed-partitions";
  41.                         #address-cells = <1>;
  42.                         #size-cells = <1>;

  43.                         partition@0 {
  44.                                 label = "factory_boot";
  45.                                 reg = <0x0 0x1d800>;
  46.                                 read-only;
  47.                         };

  48.                         factory_info: partition@1d800 {
  49.                                 label = "factory_info";
  50.                                 reg = <0x1d800 0x800>;
  51.                                 read-only;
  52.                         };

  53.                         art: partition@1e000 {
  54.                                 label = "art";
  55.                                 reg = <0x1e000 0x2000>;
  56.                                 read-only;
  57.                         };

  58.                         partition@20000 {
  59.                                 label = "config";
  60.                                 reg = <0x20000 0x10000>;
  61.                                 read-only;
  62.                         };

  63.                         partition@30000 {
  64.                                 label = "normal_boot";
  65.                                 reg = <0x30000 0x20000>;
  66.                                 read-only;
  67.                         };

  68.                         partition[url=home.php?mod=space&uid=485662]@50000[/url] {
  69.                                 compatible = "denx,uimage";
  70.                                 label = "firmware";
  71.                                 reg = <0x50000 0xfb0000>;
  72.                         };

  73.                 };
  74.         };
  75. };

  76. &pcie {
  77.         status = "okay";
  78. };

  79. &pcie0 {
  80.         mt76@0,0 {
  81.                 reg = <0x0000 0 0 0 0>;
  82.                 mediatek,mtd-eeprom = <&art 0>;
  83.                 mtd-mac-address = <&factory_info 0xd>;
  84.                 ieee80211-freq-limit = <2400000 2500000>;
  85.         };
  86. };

  87. &pcie1 {
  88.         mt76@0,0 {
  89.                 reg = <0x0000 0 0 0 0>;
  90.                 mediatek,mtd-eeprom = <&art 0x1000>;
  91.                 mtd-mac-address = <&factory_info 0xd>;
  92.                 mtd-mac-address-increment = <2>;
  93.                 ieee80211-freq-limit = <5000000 6000000>;
  94.         };
  95. };

  96. &gmac0 {
  97.         mtd-mac-address = <&factory_info 0xd>;
  98. };


  99. &switch0 {
  100.         ports {
  101.                 port@0 {
  102.                         status = "okay";
  103.                         label = "wan";
  104.                         mtd-mac-address = <&factory_info 0xd>;
  105.                         mtd-mac-address-increment = <1>;
  106.                 };

  107.                 port@2 {
  108.                         status = "okay";
  109.                         label = "lan1";
  110.                 };

  111.                 port@3 {
  112.                         status = "okay";
  113.                         label = "lan2";
  114.                 };

  115.                 port@4 {
  116.                         status = "okay";
  117.                         label = "lan3";
  118.                 };
  119.         };
  120. };

  121. &state_default {
  122.         gpio {
  123.                 groups = "jtag", "uart2", "uart3", "wdt";
  124.                 function = "gpio";
  125.         };
  126. };
复制代码
修改/openwrt/target/linux/ramips/image/mt7621.mk
  1. define Device/mercury_d26g
  2.   $(Device/uimage-lzma-loader)
  3.   IMAGE_SIZE := 16064k
  4.   DEVICE_MODEL := D26G Pro
  5.   DEVICE_VENDOR := Mercury
  6.   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3  wpad-basic  uboot-envtools
  7. endef
  8. TARGET_DEVICES += mercury_d26g
复制代码

配置端口,修改/openwrt/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
  1. xiaomi,mir3p|\
  2.         mercury,d26g|\
  3.         xiaomi,redmi-router-ac2100)
  4.                 ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
  5.                 ;;
复制代码


然后make menuconfig,再编译,生成固件,刷机:


测试无线信号,正常。LANto5G 开启160M,速度能达到90MB.
固件布局:
0.638635] Creating 4 MTD partitions on "spi0.0":
[    0.648191] 0x000000000000-0x000000030000 : "u-boot"
[    0.659436] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.671183] 0x000000040000-0x000000050000 : "factory"
[    0.682406] 0x000000050000-0x000001000000 : "firmware"

固件:
链接: https://pan.baidu.com/s/1nWNVGKJ8oc1bTo3NY_AH7g 提取码: 7tam


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-7-7 17:28 | 显示全部楼层
不懂绑定
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-7 17:50 | 显示全部楼层
7621 5.4 内核改用 DSA 了,没有交换机
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-7-7 17:59 | 显示全部楼层
本帖最后由 laomao9000 于 2020-7-7 23:49 编辑
gaawong 发表于 2020-7-7 17:50
7621 5.4 内核改用 DSA 了,没有交换机

谢谢!没注意内核升级到了5.4,这下要和linux统一了,需要花时间研究DSA模式下的port、vlan tag等等的设置。openwrt需要引入新的luci界面,支持DSA模式下的端口配置,否则会非常不便。


我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-7-8 10:52 | 显示全部楼层
水星D26G pro的EEPROM格式比较特殊,需要做些调整,匹配OPENWRT布局,方法请参考帖子:
水星D26G PRO 刷入PB-BOOT 潘多拉pandorabox
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-22 21:28 来自手机 | 显示全部楼层
非常感谢,我周末试试。用闭源驱动的话,802.11r漫游不知道还有没有效果
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-26 09:26 来自手机 | 显示全部楼层
本帖最后由 buliaoyin 于 2020-7-26 10:17 编辑

昨天试了下按照楼主的dts文件编译openwrt,闪存大小改为8M的,编译出来的固件刷进去后无法正常启动(mac2600r的潘多拉固件可以正常运行)。
我看dts里面的闪存布局是按照官方固件的布局写的,而不是调整eeprom后的方式。
然后我试着改了下,按uboot,uboot-env,factory,image的通用布局,刷进去还是不能启动。
不知道这里是不是还有别的需要注意的吗?

点评

哥们,你后来搞定了吗?  详情 回复 发表于 2021-9-27 13:48
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-26 16:53 | 显示全部楼层
请问 如何刷机 需要拆机吗?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-26 21:55 | 显示全部楼层
玩这款机器的真少,目前我在用2600r的老毛子,感觉网络老是会丢包。楼主的op也刷过,切换界面有点慢,最后还是用的潘多拉。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-7-29 06:13 | 显示全部楼层
lj830311 发表于 2020-7-26 21:55
玩这款机器的真少,目前我在用2600r的老毛子,感觉网络老是会丢包。楼主的op也刷过,切换界面有点慢,最后 ...

潘多拉优化最好,稳定。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-7-31 19:36 | 显示全部楼层
为啥openwrt里面添加了第三方规则地址更新了还是0条。。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

大哥刷机需要拆机不? 手上正好有人想折腾下  详情 回复 发表于 2020-8-1 01:44
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-8-1 01:44 | 显示全部楼层
lj830311 发表于 2020-7-31 19:36
为啥openwrt里面添加了第三方规则地址更新了还是0条。。

大哥刷机需要拆机不? 手上正好有人想折腾下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-8-5 00:40 | 显示全部楼层
肯定要拆机啊,不管是ttl还是土豪金夹着还是拆闪存刷都要拆机。

点评

非常感谢 楼主原帖确实看过,可无奈编程器实在是没有  详情 回复 发表于 2020-8-5 17:08
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-8-5 00:44 | 显示全部楼层
楼主有d26gpro刷潘多拉的教程,刷了不死其他固件随便换。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-8-5 17:08 | 显示全部楼层
lj830311 发表于 2020-8-5 00:40
肯定要拆机啊,不管是ttl还是土豪金夹着还是拆闪存刷都要拆机。

非常感谢 楼主原帖确实看过,可无奈编程器实在是没有
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-3-29 04:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

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