免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 23835 | 回复: 0

[操作系统] OpenWrt玩家新玩具:京东新路由2已被破 [复制链接]

论坛徽章:
0
发表于 2015-11-10 16:11 |显示全部楼层
新路由2 是由 京东发布的一款新产品。型号为NEWIFI D1。

配置有MT7621A处理器,双核四线程。DDR3 256MB大容量内存。32MB闪存。2.4G+5G的无线解决方案。还有USB3.0接口。配置很高,很适合爱好者来HACK

但是因为新品很多资料没发布。

我朋友自己尝试了一下最新版的OPENWRT 15.05是可以支持的。还存在两个主要BUG:
1、启动系统的时候如果网线是插着的状态网口会死掉。无法工作。必须启动机器不插网线,有时候偶尔开一段时间还恢复正常。
2、官方1505目前不支持他的2.4G无线网卡,所以系统只有5G无线网络。

反正我们是搞不定了。看看谁能搞定吧。


编译方法:
使用官方openwrt1505版。然后在target/linux/ramips/dts/下生成NEWIFID1.dts文件,内容如下:
  1. /dts-v1/;

  2. /include/ "mt7621.dtsi"

  3. / {
  4.         compatible = "mediatek,mt7621-eval-board", "mediatek,mt7621-soc";
  5.         model = "D1";

  6.         memory@0 {
  7.                 device_type = "memory";
  8.                 reg = <0x0 0x10000000>;
  9.         };

  10.         chosen {
  11.                 bootargs = "console=ttyS0,115200";
  12.         };

  13.         palmbus@1E000000 {

  14.                 gpio@600 {
  15.                         gpio0: bank@0 {
  16.                                 status = "okay";
  17.                         };
  18.                         gpio1: bank@1 {
  19.                                 status = "okay";
  20.                         };
  21.                 };

  22.                 spi@b00 {
  23.                         status = "okay";

  24.                         m25p80@0 {
  25.                                 #address-cells = <1>;
  26.                                 #size-cells = <1>;
  27.                                 compatible = "mx25l25635e";
  28.                                 reg = <0 0>;
  29.                                 linux,modalias = "m25p80";
  30.                                 spi-max-frequency = <10000000>;

  31.                                 partition@0 {
  32.                                         label = "u-boot";
  33.                                         reg = <0x0 0x30000>;
  34.                                         read-only;
  35.                                 };

  36.                                 partition@30000 {
  37.                                         label = "u-boot-env";
  38.                                         reg = <0x30000 0x10000>;
  39.                                         read-only;
  40.                                 };

  41.                                 factory: partition@40000 {
  42.                                         label = "factory";
  43.                                         reg = <0x40000 0x10000>;
  44.                                 };

  45.                                 partition@50000 {
  46.                                         label = "firmware";
  47.                                         reg = <0x50000 0xfb0000>;
  48.                                 };

  49.                         };
  50.                 };

  51.         };

  52.         pcie@1e140000 {
  53.                 status = "okay";

  54.                 pcie0 {
  55.                         mt76@0,0 {
  56.                                 reg = <0x0000 0 0 0 0>;
  57.                                 device_type = "pci";
  58.                                 mediatek,mtd-eeprom = <&factory 0x8000>;
  59.                                 mediatek,2ghz = <0>;
  60.                         };
  61.                 };

  62.                 pcie1 {
  63.                         mt76@1,0 {
  64.                                 reg = <0x0000 0 0 0 0>;
  65.                                 device_type = "pci";
  66.                                 mediatek,mtd-eeprom = <&factory 0x0000>;
  67.                                 mediatek,5ghz = <0>;
  68.                         };
  69.                 };
  70.         };

  71.         ethernet@1e100000 {
  72.                 mtd-mac-address = <&factory 0xe000>;
  73.         };

  74.         gpio_export {
  75.                 compatible = "gpio-export";
  76.                 #size-cells = <0>;
  77.                 usb20-power {
  78.                         gpio-export,name = "usb20-power";
  79.                         gpio-export,output = <1>;
  80.                         gpios = <&gpio0 9 1>;
  81.                 };
  82.                 usb30-power {
  83.                         gpio-export,name = "usb30-power";
  84.                         gpio-export,output = <1>;
  85.                         gpios = <&gpio0 11 1>;
  86.                 };
  87.         };

  88.         gpio-leds {
  89.                 compatible = "gpio-leds";

  90.                 power {
  91.                         label = "d1:green:power";
  92.                         gpios = <&gpio0 14 0>;
  93.                 };

  94.                 sys1 {
  95.                         label = "d1:green:sys1";
  96.                         gpios = <&gpio0 16 1>;
  97.                 };

  98.                 sys2 {
  99.                         label = "d1:green:sys2";
  100.                         gpios = <&gpio0 13 1>;
  101.                 };

  102.         };

  103.         gpio-keys-polled {
  104.                 compatible = "gpio-keys-polled";
  105.                 #address-cells = <1>;
  106.                 #size-cells = <0>;
  107.                 poll-interval = <20>;
  108.                 reset {
  109.                         label = "reset";
  110.                         gpios = <&gpio0 15 1>;
  111.                         linux,code = <0x198>;
  112.                 };
  113.         };

  114.         pinctrl {
  115.                 state_default: pinctrl0 {
  116.                 gpio {
  117.                                 ralink,group = "rgmii2", "jtag", "wdt rst", "mdio", "sdhci", "uart2", "uart3";
  118.                                 ralink,function = "gpio";
  119.                         };
  120.                 };
  121.         };

  122. };
复制代码
然后编辑target/linux/ramips/image/Makefile
在ifeq ($(SUBTARGET),mt7621) 下面的TARGET_DEVICES值中增加d1
然后,再下面找个地方写一个参数
  1. define Device/d1
  2.   DTS := D1
  3.   IMAGE_SIZE := $(ralink_default_fw_size_32M)
  4. endef
复制代码
编辑target/linux/ramips/base-files/etc/board.d/02_network
在firewrt | \下面增加d1 | \


有以上的基本就够了。然后就正常编译OPENWRT的流程了。可以测试看看了!!


附图有真相
  1. [    0.000000] Linux version 3.18.21 (xxx) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r65) ) #1 SMP Tue Nov 10 15:39:52 CST 2015
  2. [    0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3
  3. [    0.000000] bootconsole [early0] enabled
  4. [    0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc)
  5. [    0.000000] MIPS: machine is xxx
  6. [    0.000000] Determined physical RAM map:
  7. [    0.000000]  memory: 10000000 @ 00000000 (usable)
  8. [    0.000000] Initrd not found or empty - disabling initrd
  9. [    0.000000] Zone ranges:
  10. [    0.000000]   Normal   [mem 0x00000000-0x0fffffff]
  11. [    0.000000]   HighMem  empty
  12. [    0.000000] Movable zone start for each node
  13. [    0.000000] Early memory node ranges
  14. [    0.000000]   node   0: [mem 0x00000000-0x0fffffff]
  15. [    0.000000] Initmem setup node 0 [mem 0x00000000-0x0fffffff]
  16. [    0.000000] On node 0 totalpages: 65536
  17. [    0.000000] free_area_init_node: node 0, pgdat 8033db80, node_mem_map 81000000
  18. [    0.000000]   Normal zone: 512 pages used for memmap
  19. [    0.000000]   Normal zone: 0 pages reserved
  20. [    0.000000]   Normal zone: 65536 pages, LIFO batch:15
  21. [    0.000000] Detected 3 available secondary CPU(s)
  22. [    0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes.
  23. [    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
  24. [    0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes.
  25. [    0.000000] PERCPU: Embedded 9 pages/cpu @8120b000 s5696 r8192 d22976 u36864
  26. [    0.000000] pcpu-alloc: s5696 r8192 d22976 u36864 alloc=9*4096
  27. [    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
复制代码
CPU情况
  1. root@localhost:/tmp# cat /proc/cpuinfo
  2. system type             : MediaTek MT7621 ver:1 eco:3
  3. processor               : 0
  4. cpu model               : MIPS 1004Kc V2.15
  5. BogoMIPS                : 580.40
  6. wait instruction        : yes
  7. microsecond timers      : yes
  8. tlb_entries             : 32
  9. extra interrupt vector  : yes
  10. hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
  11. isa                     : mips1 mips2 mips32r1 mips32r2
  12. ASEs implemented        : mips16 dsp mt
  13. shadow register sets    : 1
  14. kscratch registers      : 0
  15. package                 : 0
  16. core                    : 0
  17. VCED exceptions         : not available
  18. VCEI exceptions         : not available
  19. VPE                     : 0

  20. processor               : 1
  21. cpu model               : MIPS 1004Kc V2.15
  22. BogoMIPS                : 439.91
  23. wait instruction        : yes
  24. microsecond timers      : yes
  25. tlb_entries             : 32
  26. extra interrupt vector  : yes
  27. hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
  28. isa                     : mips1 mips2 mips32r1 mips32r2
  29. ASEs implemented        : mips16 dsp mt
  30. shadow register sets    : 1
  31. kscratch registers      : 0
  32. package                 : 0
  33. core                    : 0
  34. VCED exceptions         : not available
  35. VCEI exceptions         : not available
  36. VPE                     : 1

  37. processor               : 2
  38. cpu model               : MIPS 1004Kc V2.15
  39. BogoMIPS                : 580.40
  40. wait instruction        : yes
  41. microsecond timers      : yes
  42. tlb_entries             : 32
  43. extra interrupt vector  : yes
  44. hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
  45. isa                     : mips1 mips2 mips32r1 mips32r2
  46. ASEs implemented        : mips16 dsp mt
  47. shadow register sets    : 1
  48. kscratch registers      : 0
  49. package                 : 0
  50. core                    : 1
  51. VCED exceptions         : not available
  52. VCEI exceptions         : not available
  53. VPE                     : 0

  54. processor               : 3
  55. cpu model               : MIPS 1004Kc V2.15
  56. BogoMIPS                : 586.13
  57. wait instruction        : yes
  58. microsecond timers      : yes
  59. tlb_entries             : 32
  60. extra interrupt vector  : yes
  61. hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
  62. isa                     : mips1 mips2 mips32r1 mips32r2
  63. ASEs implemented        : mips16 dsp mt
  64. shadow register sets    : 1
  65. kscratch registers      : 0
  66. package                 : 0
  67. core                    : 1
  68. VCED exceptions         : not available
  69. VCEI exceptions         : not available
  70. VPE                     : 1
复制代码
内存
  1. root@localhost:/tmp# free
  2.              total         used         free       shared      buffers
  3. Mem:        256036       124412       131624          212         3604
  4. -/+ buffers:             120808       135228
  5. Swap:            0            0            0
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP