Skip to content
Permalink
Browse files

ramips: add support for I-O DATA WN-G300R3

  • Loading branch information...
musashino205 committed Mar 7, 2019
1 parent 3dcaac2 commit ce4b63911b260bff049d696e9a847faccbfc5860
@@ -97,6 +97,7 @@ ramips_setup_interfaces()
hc5661a|\
hc5962|\
hlk-rm04|\
iodata,wn-g300r3|\
k2p|\
kn|\
kn_rc|\
@@ -591,6 +592,7 @@ ramips_setup_macs()
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" -1)
;;
iodata,wn-ax1167gr|\
iodata,wn-g300r3|\
iodata,wn-gx300gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary Factory 4)" 1)
;;
@@ -0,0 +1,136 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include "mt7620n.dtsi"

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

/ {
compatible = "iodata,wn-g300r3", "ralink,mt7620a-soc";
model = "I-O DATA WN-G300R3";

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

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

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

leds {
compatible = "gpio-leds";

led_power: power {
label = "wn-g300r3:green:power";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
default-state = "on";
};

wps {
label = "wn-g300r3:green:wps";
gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
};
};

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

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>;
};
};
};

&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 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x390000>;
};

partition@3e0000 {
label = "backup";
reg = <0x3e0000 0x10000>;
read-only;
};

partition@3f0000 {
label = "storage";
reg = <0x3f0000 0x10000>;
read-only;
};
};
};
};

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

mtd-mac-address = <&Factory 0x4>;
};

&gpio1 {
status = "okay";
};

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

&wmac {
ralink,mtd-eeprom = <&Factory 0x0>;
};
@@ -413,6 +413,17 @@ define Device/iodata_wn-ac733gr3
endef
TARGET_DEVICES += iodata_wn-ac733gr3

define Device/iodata_wn-g300r3
DTS := WN-G300R3
DEVICE_TITLE := I-O DATA WN-G300R3
IMAGE_SIZE := 3648k
IMAGES += factory.bin
IMAGE/factory.bin := \
$$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \
senao-header -r 0x30a -p 0x65 -t 2
endef
TARGET_DEVICES += iodata_wn-g300r3

define Device/kimax_u35wf
DTS := U35WF
IMAGE_SIZE := 16064k

0 comments on commit ce4b639

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