Skip to content
Permalink
Browse files

ramips: Add support for IODATA WN-G300DGR

IODATA WN-G300DGR is a 2.4GHz band 11n router, based on Ralink RT3052F.

Specification:

- RT3052F (384 MHz)
- 32 MB of RAM (SDRAM)
- 4 MB of FLASH (CFI)
- 2T2R 2.4 GHz
- 4x 10/100/1000 Mbps Ethernet (Realtek RTL8366RB)
- 5x LED, 3x button
- UART header on PCB

Flash instruction using U-Boot TFTP:
1. Connect the UART pin on WN-G300DGR (CN1, Vcc/GND/TX/RX from caret) with PC
2. Set PC to fixed ip address 192.168.99.8
3. Download lede-ramips-rt305x-wn-g300dgr-squashfs-sysupgrade.bin and
rename it to uImageWN-G300DGR
4. Start a tftp server with the file uImageWN-G300DGR in its root
directory
5. Turn off the router
6. Turn on router and repeatedly press "2" key on the UART console
7. When entering tftp mode, press keys "y", "Enter", "Enter", "Enter"
8. After a short time, the firmware should be transferred from the tftp
server
9. Wait ~60 second to complete flash

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
  • Loading branch information...
musashino205 committed Nov 23, 2017
1 parent 0b02a0f commit 0dd7329280220938aee51d7b423f04a74cd4dc2d
@@ -207,6 +207,10 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0"
;;
wn-g300dgr)
ucidef_add_switch "switch0" \
"0:lan" "1:lan" "2:lan" "3:wan" "5@eth0"
;;
asl26555-8M|\
asl26555-16M|\
rp-n53)
@@ -592,6 +592,9 @@ ramips_board_detect() {
*"WMR-300")
name="wmr-300"
;;
*"WN-G300DGR")
name="wn-g300dgr"
;;
*"WN3000RPv3")
name="wn3000rpv3"
;;
@@ -0,0 +1,168 @@
/dts-v1/;

#include "rt3050.dtsi"

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

/ {
compatible = "iodata,wn-g300dgr", "ralink,rt3052-soc";
model = "IODATA WN-G300DGR";

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

cfi@1f000000 {
compatible = "cfi-flash";
reg = <0x1f000000 0x800000>;
bank-width = <2>;
device-width = <2>;

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

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

led_power_amber: power-amber {
label = "wn-g300dgr:amber:power";
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
};

led_power_blue: power-blue {
label = "wn-g300dgr:blue:power";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};

wps-blue {
label = "wn-g300dgr:blue:wps";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
};

wps-green {
label = "wn-g300dgr:green:wps";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};

filtering {
label = "wn-g300dgr:blue:filtering";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
};

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

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

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

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

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

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

usb-power {
gpio-export,name = "usb-power";
gpio-export,output = <1>;
gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
};
};

rtl8366rb {
compatible = "realtek,rtl8366rb";
gpio-sda = <&gpio0 1 GPIO_ACTIVE_HIGH>;
gpio-sck = <&gpio0 2 GPIO_ACTIVE_HIGH>;
};
};

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

&ethernet {
mtd-mac-address = <&factory 0x4>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
};

&esw {
ralink,rgmii = <1>;
mediatek,portmap = <0x3f>;
ralink,fct2 = <0x0002500c>;
/*
* ext phy base addr 31, rx/tx clock skew 0,
* turbo mii off, rgmi 3.3v off, port 5 polling off
* port5: enabled, gige, full-duplex, rx/tx-flow-control
* port6: enabled, gige, full-duplex, rx/tx-flow-control
*/
ralink,fpa2 = <0x1f003fff>;
};

&wmac {
ralink,mtd-eeprom = <&factory 0>;
};

&otg {
status = "okay";
};
@@ -817,6 +817,16 @@ define Device/wl-351
endef
TARGET_DEVICES += wl-351

define Device/wn-g300dgr
DTS := WN-G300DGR
BLOCKSIZE := 64k
IMAGE_SIZE := $(ralink_default_fw_size_4M)
DEVICE_TITLE := IODATA WN-G300DGR
DEVICE_PACKAGES := kmod-switch-rtl8366rb kmod-swconfig swconfig \
kmod-usb-core kmod-usb-dwc2
endef
TARGET_DEVICES += wn-g300dgr

define Device/wnce2001
DTS := WNCE2001
IMAGE_SIZE := $(ralink_default_fw_size_4M)

0 comments on commit 0dd7329

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