Skip to content
Permalink
Browse files

ramips: add support for ELECOM WRC-1167GHBK2-I

There is no plan to submit a PR to openwrt/openwrt.

WRC-1167GHBK2-I does not have a device specific MAC address in the
eeprom for MT7612E in "Factory" partition.
  • Loading branch information...
musashino205 committed Jan 30, 2019
1 parent 510c9f6 commit 3dcaac2a5f129edbb756924de957f37a95f52f1a
@@ -147,6 +147,10 @@ dir-860l-b1)
edimax,br-6478ac-v2)
set_wifi_led "$boardname:blue:wlan"
;;
elecom,wrc-1167ghbk2-i)
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$boardname:green:wlan5g" "phy0radio"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "$boardname:green:wlan2g" "phy1radio"
;;
elecom,wrc-733ghbk)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "phy1radio"
ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:blue:wlan5g" "phy0radio"
@@ -324,6 +324,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch1" \
"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0"
;;
elecom,wrc-1167ghbk2-i)
ucidef_add_switch "switch1" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
hc5661|\
head-weblink,hdrm200|\
y1s)
@@ -556,6 +560,10 @@ ramips_setup_macs()
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 2)
;;
elecom,wrc-1167ghbk2-i)
lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
;;
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
@@ -66,6 +66,7 @@ case "$FIRMWARE" in
jboot_eeprom_extract "config" 0xE000
rt2x00_eeprom_set_macaddr $wifi_mac
;;
elecom,wrc-1167ghbk2-i|\
elecom,wrc-733ghbk)
wifi_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.2G.0.MAC.Address)
rt2x00_eeprom_extract "Factory" 0 512
@@ -0,0 +1,195 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include "mt7620a.dtsi"

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

/ {
compatible = "elecom,wrc-1167ghbk2-i", "ralink,mt7620a-soc";
model = "ELECOM WRC-1167GHBK2-I";

aliases {
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};

memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};

leds {
compatible = "gpio-leds";

wps {
label = "wrc-1167ghbk2-i:red:wps";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

wlan2g {
label = "wrc-1167ghbk2-i:blue:wlan2g";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};

led_power: power {
label = "wrc-1167ghbk2-i:blue:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
default-state = "on";
};

wlan5g {
label = "wrc-1167ghbk2-i:blue:wlan5g";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
};

keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;

wps {
label = "wps";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};

reset {
label = "reset";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};

auto {
label = "auto";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
linux,code = <BTN_0>;
linux,input-type = <EV_SW>;
};
};
};

&spi0 {
status = "okay";

flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};

partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};

Factory: partition@40000 {
label = "Factory";
reg = <0x40000 0x10000>;
read-only;
};

partition@50000 {
label = "nvram";
reg = <0x50000 0x20000>;
read-only;
};

partition@70000 {
compatible = "edimax,uimage";
label = "firmware";
reg = <0x70000 0x780000>;
};

partition@7f0000 {
label = "hwconfig";
reg = <0x7f0000 0x10000>;
read-only;
};
};
};
};

&ethernet {
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &mdio_pins>;

port@5 {
status = "okay";
mediatek,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};

mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";

ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
};

ethernet-phy@1 {
reg = <1>;
phy-mode = "rgmii";
};

ethernet-phy@2 {
reg = <2>;
phy-mode = "rgmii";
};

ethernet-phy@3 {
reg = <3>;
phy-mode = "rgmii";
};

ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};

ethernet-phy@1f {
reg = <0x1f>;
phy-mode = "rgmii";
};
};
};

&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf";
ralink,function = "gpio";
};
};
};

&pcie {
status = "okay";
};

&pcie0 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0000 0 0 0 0>;
/* there is no MAC address, neeed to patch */
mediatek,mtd-eeprom = <&Factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
@@ -275,6 +275,17 @@ define Device/e1700
endef
TARGET_DEVICES += e1700

define Device/elecom_wrc-1167ghbk2-i
DTS := WRC-1167GHBK2-I
DEVICE_TITLE := ELECOM WRC-1167GHBK2-I
IMAGE_SIZE := 7680k
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | \
edimax-header -s CSYS -m RN68 -f 0x70000 -S 0x01100000 | pad-rootfs | \
append-metadata | check-size $$$$(IMAGE_SIZE)
DEVICE_PACKAGES := kmod-mt76x2
endef
TARGET_DEVICES += elecom_wrc-1167ghbk2-i

define Device/elecom_wrc-733ghbk
DTS := WRC-733GHBK
DEVICE_TITLE := ELECOM WRC-733GHBK

0 comments on commit 3dcaac2

Please sign in to comment.
You can’t perform that action at this time.