Skip to content
Permalink
Browse files

ramips: add support for ELECOM WRC-733GHBK

  • Loading branch information...
musashino205 committed Oct 5, 2018
1 parent 7492032 commit 8281655aa510ec7d633d986fdd270a57c796c81f
@@ -137,6 +137,10 @@ dir-860l-b1)
edimax,br-6478ac-v2)
set_wifi_led "$boardname:blue:wlan"
;;
elecom,wrc-733ghbk)
ucidef_set_led_wlan "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "phy1radio"
ucidef_set_led_wlan "wlan5g" "wlan5g" "$boardname:blue:wlan5g" "phy0radio"
;;
ex2700|\
wn3000rpv3)
set_wifi_led "$boardname:green:router"
@@ -267,6 +267,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
elecom,wrc-733ghbk)
ucidef_add_switch "switch1" \
"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "0:wan" "6@eth0"
;;
gnubee,gb-pc1|\
gnubee,gb-pc2)
ucidef_add_switch "switch0" \
@@ -524,6 +528,10 @@ ramips_setup_macs()
sk-wb8)
wan_mac=$(mtd_get_mac_binary factory 57350)
;;
elecom,wrc-733ghbk)
lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
;;
gl-mt300n-v2|\
whr-g300n)
wan_mac=$(mtd_get_mac_binary factory 4)
@@ -65,6 +65,11 @@ case "$FIRMWARE" in
jboot_eeprom_extract "config" 0xE000
rt2x00_eeprom_set_macaddr $wifi_mac
;;
elecom,wrc-733ghbk)
wifi_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.2G.0.MAC.Address)
rt2x00_eeprom_extract "Factory" 0 512
rt2x00_eeprom_set_macaddr $wifi_mac
;;
tiny-ac)
wifi_mac=$(mtd_get_mac_ascii u-boot-env INIC_MAC_ADDR)
rt2x00_eeprom_extract "factory" 0 512
@@ -0,0 +1,172 @@
/dts-v1/;

#include "mt7620a.dtsi"

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

/ {
compatible = "elecom,wrc-733ghbk", "ralink,mt7620a-soc";
model = "ELECOM WRC-733GHBK";

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

chosen {
bootargs = "console=ttyS0,57600";
};

gpio-leds {
compatible = "gpio-leds";

wps {
label = "wrc-733ghbk:red:wps";
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
};

led_power: power {
label = "wrc-733ghbk:blue:power";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};

wlan2g {
label = "wrc-733ghbk:blue:wlan2g";
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
};

wlan5g {
label = "wrc-733ghbk:blue:wlan5g";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
};

gpio-keys {
compatible = "gpio-keys";

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

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

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

gpio_export {
compatible = "gpio-export";
#size-cells = <0>;

rtl8367rb_power {
gpio-export,name = "rtl8367rb-power";
gpio-export,output = <1>;
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
};
};

rtl8367rb {
compatible = "realtek,rtl8367b", "rtl8367b";
gpio-sda = <&gpio0 22 GPIO_ACTIVE_HIGH>;
gpio-sck = <&gpio0 23 GPIO_ACTIVE_HIGH>;
realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
};
};

&spi0 {
status = "okay";

m25p80@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 = "denx,uimage";
label = "firmware";
reg = <0x70000 0x780000>;
};

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

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

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

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

&pcie {
status = "okay";
};

&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&Factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
@@ -3,7 +3,22 @@
#

DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION \
DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE
DLINK_ROM_ID DLINK_FAMILY_MEMBER DLINK_FIRMWARE_SIZE KERNEL_INITRAMFS_PREFIX

define Build/add-edimax-factory-initramfs
$(eval edimax_model=$(1))

$(STAGING_DIR_HOST)/bin/mkedimaximg \
-s CSYS -m $(edimax_model) \
-f 0x70000 -S 0x01100000 \
-i $@ -o $@.factory

if [ "$$(stat -c%s $@.factory)" -le $$(($(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE))))) ]; then \
mv $@.factory $(BIN_DIR)/$(KERNEL_INITRAMFS_PREFIX)-factory.bin; \
else \
echo "WARNING: initramfs kernel image too big, cannot generate factory image" >&2; \
fi
endef

define Build/elecom-header
cp $@ $(KDIR)/v_0.0.0.bin
@@ -263,6 +278,16 @@ define Device/e1700
endef
TARGET_DEVICES += e1700

define Device/elecom_wrc-733ghbk
DTS := WRC-733GHBK
DEVICE_TITLE := ELECOM WRC-733GHBK
IMAGE_SIZE := 7680k
KERNEL_INITRAMFS := $$(KERNEL) | pad-to 2 | \
add-edimax-factory-initramfs RN62
DEVICE_PACKAGES := kmod-mt76x0e kmod-switch-rtl8366-smi kmod-switch-rtl8367b
endef
TARGET_DEVICES += elecom_wrc-733ghbk

define Device/ex2700
NETGEAR_HW_ID := 29764623+4+0+32+2x2+0
NETGEAR_BOARD_ID := EX2700

0 comments on commit 8281655

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