找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 31189|回复: 35

发个941 v6,941 v7,和wnr2000V3 TP分区类型的lede固件(4m和8m的都有)

[复制链接]
本帖最后由 rocketime 于 2019-12-14 22:50 编辑

当时就是随手水的一个帖子,谁知过了这么就还被加精了,既然加精了,就更新一波吧!

因为手上刚好有个网件的wnr2000V3。想用breed,就搞了一个tp分区类型的固件,顺手又把逼死强迫症的941v6的led给对应上了!
还有一个附带的941v7,qca9558百兆交换机的固件。
用的lede17.01.1的源码,搞来自己用的,想着反正都搞出来了就分享下吧!
941v6的修好了wifi指示灯,可以正常显示WiFi状态。高通这是要逼死强迫症啊,满世界也找不到ar9381的数据手册!我为了找这个led的gpio把ar9381所有的io口都加到固件里,然后一个一个的试!
9558的固件就没什么好说的了,用的H大的代码,稍微修改了一下匹配了最新的版本。cpu是qca9558,交换机是ar8236
网件的wnr2000V3,是用tp841v7的源码魔改的,各种按键和led都正常工作!机型和固件效验码没改,在breed里刷就是了!
有8m和4m的固件,默认中文,时区深圳旁边,无线默认开启,把官方没汉化的一些地方简单翻译了一下。
里面集成的软件不多,内核版本的md5效验码已经改成和官方源一致了,但是有些驱动安装还是有问题,不要在意这些细节!多拨,s-s,什么的,基本上常用的都有
发现bug可以在跟帖里说,但不一定会修……

最后,有想要源码的跟帖里说下,我整理下贴上来,主要是太乱了……顺便说下,941v6无线led的gpio是7,在ar9381上……

论坛只能上10M的附件,贴个我的文件服务器地址吧:http://rocketime.f3322.net:9807/right/

百度云:http://pan.baidu.com/s/1o78JoDW

---------------------------------------------------更新分割线----------------------------------------------------------------------------------------------------没什么好多说的,用18.06.5的源码编译了一遍固件,默认有中文和luci,具体里面有什么自己刷了看吧,差不多常见的型号都编译了
因为现在手上没941V6的机器,那个wifi灯还能不能亮也不好说,反正代码是和之前的一样,按道理应该能亮
想要4m固件的基本可以歇歇了,4m能放下基本功能就不错了,openwrt的内核现在越来越大了……
顺手也编译了一遍lean的源码,各取所需吧
就不传网盘和论坛了,直接放个我的文件服务器地址,去里面下吧:
http://rocketime.f3322.net:9807/openwrt_Firmware/




























941 v7的代码,需要的就拿去,源头是H大我只是简单改了下

  1. /*
  2. *  TP-LINK TL-WR941ND v7 board support
  3. *
  4. *  Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
  5. *  Copyright (C) 2014 hackpascal <hackpacsal@gmail.com>
  6. *        2017.04 Rocketime revised for lede 17.01.1
  7. *
  8. *  This program is free software; you can redistribute it and/or modify it
  9. *  under the terms of the GNU General Public License version 2 as published
  10. *  by the Free Software Foundation.
  11. */

  12. #include <linux/delay.h>
  13. #include <linux/pci.h>
  14. #include <linux/phy.h>
  15. #include <linux/gpio.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/ath9k_platform.h>
  18. #include <linux/ar8216_platform.h>

  19. #include <asm/mach-ath79/ar71xx_regs.h>

  20. #include "common.h"
  21. #include "dev-ap9x-pci.h"
  22. #include "dev-eth.h"
  23. #include "dev-gpio-buttons.h"
  24. #include "dev-leds-gpio.h"
  25. #include "dev-m25p80.h"
  26. #include "dev-spi.h"
  27. #include "dev-usb.h"
  28. #include "dev-wmac.h"
  29. #include "machtypes.h"
  30. // #include "tplink-wmac.h"

  31. #define WR941NDV7_GPIO_LED_WLAN                        12
  32. #define WR941NDV7_GPIO_LED_SYSTEM                19
  33. #define WR941NDV7_GPIO_LED_QSS                        15

  34. #define WR941NDV7_GPIO_BTN_RESET                16

  35. #define WR941NDV7_KEYS_POLL_INTERVAL                20        /* msecs */
  36. #define WR941NDV7_KEYS_DEBOUNCE_INTERVAL        (3 * WR941NDV7_KEYS_POLL_INTERVAL)

  37. #define ATH_MII_MGMT_CMD                0x24
  38. #define ATH_MGMT_CMD_READ                0x1

  39. #define ATH_MII_MGMT_ADDRESS                0x28
  40. #define ATH_ADDR_SHIFT                        8

  41. #define ATH_MII_MGMT_CTRL                0x2c
  42. #define ATH_MII_MGMT_STATUS                0x30

  43. #define ATH_MII_MGMT_IND                0x34
  44. #define ATH_MGMT_IND_BUSY                (1 << 0)
  45. #define ATH_MGMT_IND_INVALID                (1 << 2)

  46. #define QCA955X_ETH_CFG_GE0_MII_EN        BIT(1)
  47. #define QCA955X_ETH_CFG_GE0_MII_SLAVE        BIT(4)

  48. static const char *wr941ndv7_part_probes[] = {
  49.         "tp-link",
  50.         NULL,
  51. };

  52. static struct flash_platform_data wr941ndv7_flash_data = {
  53.         .part_probes        = wr941ndv7_part_probes,
  54. };

  55. static struct gpio_led wr941ndv7_leds_gpio[] __initdata = {
  56.         {
  57.                 .name                = "tp-link:green:qss",
  58.                 .gpio                = WR941NDV7_GPIO_LED_QSS,
  59.                 .active_low        = 1,
  60.         },
  61.         {
  62.                 .name                = "tp-link:green:system",
  63.                 .gpio                = WR941NDV7_GPIO_LED_SYSTEM,
  64.                 .active_low        = 1,
  65.         },
  66.         {
  67.                 .name                = "tp-link:green:wlan",
  68.                 .gpio                = WR941NDV7_GPIO_LED_WLAN,
  69.                 .active_low        = 1,
  70.         },
  71. };

  72. static struct gpio_keys_button wr941ndv7_gpio_keys[] __initdata = {
  73.         {
  74.                 .desc                = "reset",
  75.                 .type                = EV_KEY,
  76.                 .code                = KEY_RESTART,
  77.                 .debounce_interval = WR941NDV7_KEYS_DEBOUNCE_INTERVAL,
  78.                 .gpio                = WR941NDV7_GPIO_BTN_RESET,
  79.                 .active_low        = 1,
  80.         },
  81. };

  82. static struct mdio_board_info wr941ndv7_mdio0_info[] = {
  83.         {
  84.                 .bus_id = "ag71xx-mdio.0",
  85.                 .phy_addr = 0,
  86.                 .platform_data = NULL,
  87.         },
  88. };

  89. static unsigned long __init ath_gmac_reg_rd(unsigned long reg)
  90. {
  91.         void __iomem *base;
  92.         unsigned long t;

  93.         base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE);

  94.         t = __raw_readl(base + reg);

  95.         iounmap(base);

  96.         return t;
  97. }

  98. static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value)
  99. {
  100.         void __iomem *base;
  101.         unsigned long t = value;

  102.         base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE);

  103.         __raw_writel(t, base + reg);

  104.         iounmap(base);
  105. }

  106. static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data)
  107. {
  108.         unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg;
  109.         volatile int rddata;
  110.         unsigned short ii = 0xFFFF;

  111.         do
  112.         {
  113.                 udelay(5);
  114.                 rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1;
  115.         } while (rddata && --ii);

  116.         ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr);
  117.         ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data);

  118.         do
  119.         {
  120.                 udelay(5);
  121.                 rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1;
  122.         } while (rddata && --ii);
  123. }

  124. static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg)
  125. {
  126.         unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val;
  127.         volatile int rddata;
  128.         unsigned short ii = 0xffff;

  129.         do
  130.         {
  131.                 udelay(5);
  132.                 rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1;
  133.         } while (rddata && --ii);

  134.         ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0);
  135.         ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr);
  136.         ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ);

  137.         do
  138.         {
  139.                 udelay(5);
  140.                 rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1;
  141.         } while (rddata && --ii);

  142.         val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS);
  143.         ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0);

  144.         return val;
  145. }

  146. static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data)
  147. {
  148.         unsigned int addr_temp;
  149.         unsigned int data;
  150.         unsigned char phy_address, reg_address;

  151.         addr_temp = (s27_addr) >> 2;
  152.         data = addr_temp >> 7;

  153.         phy_address = 0x1f;
  154.         reg_address = 0x10;

  155.         phy_reg_write(phy_address, reg_address, data);

  156.         phy_address = (0x17 & ((addr_temp >> 4) | 0x10));

  157.         reg_address = (((addr_temp << 1) & 0x1e) | 0x1);
  158.         data = (s27_write_data >> 16) & 0xffff;
  159.         phy_reg_write(phy_address, reg_address, data);

  160.         reg_address = ((addr_temp << 1) & 0x1e);
  161.         data = s27_write_data  & 0xffff;
  162.         phy_reg_write(phy_address, reg_address, data);
  163. }

  164. static unsigned int __init athrs27_reg_read(unsigned int s27_addr)
  165. {
  166.         unsigned int addr_temp;
  167.         unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr;
  168.         unsigned int data;
  169.         unsigned char phy_address, reg_address;

  170.         addr_temp = s27_addr >>2;
  171.         data = addr_temp >> 7;

  172.         phy_address = 0x1f;
  173.         reg_address = 0x10;

  174.         phy_reg_write(phy_address, reg_address, data);

  175.         phy_address = (0x17 & ((addr_temp >> 4) | 0x10));
  176.         reg_address = ((addr_temp << 1) & 0x1e);
  177.         s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address);

  178.         reg_address = reg_address | 0x1;
  179.         s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address);
  180.         s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ;
  181.         
  182.         return (s27_rd_csr);
  183. }

  184. static void __init ar8236_reset(void)
  185. {
  186.         unsigned short i = 60;

  187.         athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000);
  188.         while (i--)
  189.         {
  190.                 mdelay(100);
  191.                 if (!(athrs27_reg_read(0x0) & 0x80000000))
  192.                 break;
  193.         }
  194. }

  195. static void __init wr941ndv7_setup(void)
  196. {
  197.         u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
  198.         u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
  199.         u8 tmpmac[ETH_ALEN];

  200.         ath79_register_m25p80(&wr941ndv7_flash_data);
  201.         ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941ndv7_leds_gpio),
  202.                                  wr941ndv7_leds_gpio);
  203.         ath79_register_gpio_keys_polled(-1, WR941NDV7_KEYS_POLL_INTERVAL,
  204.                                         ARRAY_SIZE(wr941ndv7_gpio_keys),
  205.                                         wr941ndv7_gpio_keys);

  206. //        tplink_register_builtin_wmac1(0x1000, mac, 1);
  207.         ath79_register_wmac(art + 0x1000, tmpmac);

  208.         ar8236_reset();

  209.         ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_GE0_MII_EN |
  210.                 QCA955X_ETH_CFG_GE0_MII_SLAVE);

  211.         mdiobus_register_board_info(wr941ndv7_mdio0_info,
  212.                                     ARRAY_SIZE(wr941ndv7_mdio0_info));
  213.         ath79_register_mdio(0, 0x0);

  214.         ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);

  215.         /* GMAC0 is connected to an AR8236 switch */
  216.         ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
  217.         ath79_eth0_data.speed = SPEED_100;
  218.         ath79_eth0_data.duplex = DUPLEX_FULL;
  219.         ath79_eth0_data.phy_mask = BIT(0);
  220.         ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
  221.         ath79_register_eth(0);

  222.         ath79_register_usb();
  223. }

  224. MIPS_MACHINE(ATH79_MACH_TL_WR941ND_V7, "TL-WR941ND-v7",
  225.              "TP-LINK TL-WR941ND v7",
  226.              wr941ndv7_setup);
复制代码






本帖子中包含更多资源

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

×

评分

参与人数 2恩山币 +2 收起 理由
coru*** + 1 强大的恩山!(以下重复1万次)
huangl*** + 1 我来恩山就是为了撩你!

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
来自手机 | 显示全部楼层
谢谢分享。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

来自手机 | 显示全部楼层
我也有个wnr2000 v3,请问怎么刷breed呢?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
51show 发表于 2017-4-22 16:05
我也有个wnr2000 v3,请问怎么刷breed呢?

从open里应该能刷,不过,我一般直接用编程器
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
1542725691 发表于 2017-4-22 17:30
请问怎么适配941nv7的lede,h大的源码地址有么

源码放到帖子里了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

老板牛逼哈哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
1542725691 发表于 2017-4-22 19:05
谢谢楼主的分享,我试试

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

使用道具 举报

感谢楼主的分享
2041N V1刷941 V6 楼主的版本初步使用感觉很好。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 来自手机 | 显示全部楼层
纳米飞 发表于 2017-6-17 08:21
感谢楼主的分享
2041N V1刷941 V6 楼主的版本初步使用感觉很好。

这个固件刷2041的话,复位键和那个wifi按键用不了,一直想加进去,无奈没时间…用的话应该没有其他的问题
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

留名备注 。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

本帖最后由 1287329 于 2017-6-21 18:42 编辑

楼主,你好。新手向你请教,我已经把 941v7的代码 mach-tl-wr941nd-v7.c 放到了.../lede/source/target/linux/ar71xx/files/arch/mips/ath79 目录里面,但是make menuconfig编译的时候在target profile选项里面还是没有941v7的选项,请问还要修改哪些地方才能在make menuconfig编译的时候显示941v7的选项啊?

本帖子中包含更多资源

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

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

使用道具 举报

 楼主| | 显示全部楼层
1287329 发表于 2017-6-21 18:37
楼主,你好。新手向你请教,我已经把 941v7的代码 mach-tl-wr941nd-v7.c 放到了.../lede/source/target/lin ...

除了c文件,还有很多其他的配置要添加,比如led,闪存布局,然后还要在makefile里添加信息才行,
所以,一句两句说不清啊!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

rocketime 发表于 2017-6-22 23:23
除了c文件,还有很多其他的配置要添加,比如led,闪存布局,然后还要在makefile里添加信息才行,
所以, ...

哦  知道了  谢谢了  我自己慢慢研究
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-27 01:11

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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