ramips: add support for ELECOM WRC-1167GS2-B
authorINAGAKI Hiroshi <musashino.open@gmail.com>
Sat, 28 Nov 2020 09:41:12 +0000 (18:41 +0900)
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>
Tue, 22 Dec 2020 20:44:57 +0000 (21:44 +0100)
ELECOM WRC-1167GS2-B is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based
on MT7621A.

Specification:

- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB
- Flash : SPI-NOR 16 MiB
- WLAN : 2.4/5 GHz 2T2R (MediaTek MT7615D)
- Ethernet : 10/100/1000 Mbps x5
  - Switch : MediaTek MT7530 (SoC)
- LED/keys : 6x/6x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
  - J4: 3.3V, GND, TX, RX from ethernet port side
  - 57600n8
- Power : 12VDC, 1A

MAC addresses:

LAN : 04:AB:18:**:**:13 (Factory, 0xFFF4 (hex))
WAN : 04:AB:18:**:**:14 (Factory, 0xFFFA (hex))
2.4 GHz : 04:AB:18:**:**:15 (none)
5 GHz : 04:AB:18:**:**:16 (Factory, 0x4 (hex))

Flash instruction using factory image:

1. Boot WRC-1167GS2-B normally
2. Access to "http://192.168.2.1/" and open firmware update page
   ("ファームウェア更新")
3. Select the OpenWrt factory image and click apply ("適用") button
4. Wait ~120 seconds to complete flashing

Notes:

- there is no way to configure the correct MAC address for secondary phy
  (5GHz) on MT7615D
- Wi-Fi band on primary phy (2.4GHz) cannot be limitted by specifying
  ieee80211-freq-limit
  (fail to register secondary phy due to error)
- mtd-mac-address in the wifi node is required for using
  mtd-mac-address-increment

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[rebase onto split DTSI patch]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts [new file with mode: 0644]
target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi [new file with mode: 0644]
target/linux/ramips/dts/mt7621_elecom_wrc-gs.dtsi
target/linux/ramips/image/mt7621.mk

diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts b/target/linux/ramips/dts/mt7621_elecom_wrc-1167gs2-b.dts
new file mode 100644 (file)
index 0000000..6349fd4
--- /dev/null
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_elecom_wrc-gs-1pci.dtsi"
+
+/ {
+       compatible = "elecom,wrc-1167gs2-b", "mediatek,mt7621-soc";
+       model = "ELECOM WRC-1167GS2-B";
+};
+
+&gmac0 {
+       mtd-mac-address = <&factory 0xfff4>;
+};
+
+&wan {
+       mtd-mac-address = <&factory 0xfffa>;
+};
+
+&partitions {
+       partition@50000 {
+               compatible = "denx,uimage";
+               label = "firmware";
+               reg = <0x50000 0xb00000>;
+       };
+
+       partition@b50000 {
+               label = "tm_pattern";
+               reg = <0xb50000 0x380000>;
+               read-only;
+       };
+
+       partition@ed0000 {
+               label = "tm_key";
+               reg = <0xed0000 0x80000>;
+               read-only;
+       };
+
+       partition@f50000 {
+               label = "nvram";
+               reg = <0xf50000 0x30000>;
+               read-only;
+       };
+
+       partition@f80000 {
+               label = "user_data";
+               reg = <0xf80000 0x80000>;
+               read-only;
+       };
+};
+
+&wifi {
+       mtd-mac-address = <&factory 0x4>;
+       mtd-mac-address-increment = <(-1)>;
+};
diff --git a/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi b/target/linux/ramips/dts/mt7621_elecom_wrc-gs-1pci.dtsi
new file mode 100644 (file)
index 0000000..7495453
--- /dev/null
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include "mt7621_elecom_wrc-gs.dtsi"
+
+&leds {
+       wlan2g {
+               label = "white:wlan2g";
+               gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+       };
+
+       wlan5g {
+               label = "white:wlan5g";
+               gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&state_default {
+       gpio {
+               groups = "i2c", "uart3", "jtag", "wdt", "sdhci";
+               function = "gpio";
+       };
+};
+
+&pcie0 {
+       wifi: wifi@0,0 {
+               compatible = "mediatek,mt76";
+               reg = <0x0000 0 0 0 0>;
+               mediatek,mtd-eeprom = <&factory 0x0>;
+       };
+};
index 790c5fed70e9e35b3889934d082ef033e37772c5..9cf2b666b4e17ef3226a1df55e437ac14d7e9c06 100644 (file)
@@ -14,7 +14,7 @@
                label-mac-device = &wan;
        };
 
-       leds {
+       leds: leds {
                compatible = "gpio-leds";
 
                led_power_green: power_green {
index cf81a862ff439926d56197007003d8a3395b76b7..7b6152958406a87667da98c17130339bbf623476 100644 (file)
@@ -426,6 +426,14 @@ define Device/elecom_wrc-gs
   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
 endef
 
+define Device/elecom_wrc-1167gs2-b
+  $(Device/elecom_wrc-gs)
+  IMAGE_SIZE := 11264k
+  DEVICE_MODEL := WRC-1167GS2-B
+  ELECOM_HWNAME := WRC-1167GS2
+endef
+TARGET_DEVICES += elecom_wrc-1167gs2-b
+
 define Device/elecom_wrc-1750gs
   $(Device/elecom_wrc-gs)
   IMAGE_SIZE := 11264k