Re: [OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 Wireless Router

2015-07-10 Thread LiWeijian
Hi,
Thanks very much for your comments and taking time to check the name. Regarding 
the 'OY-0001', it's for business reason to use 'OY-0001' but not 'OYE-0001'. 
The 'old' name in the website also will be updated afterward.

Regards,
Weijian

> Subject: Re: [OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 
> Wireless Router
> From: ka...@tweak.net.au
> To: younfa...@hotmail.com
> CC: openwrt-devel@lists.openwrt.org
> Date: Fri, 10 Jul 2015 11:27:55 +
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Isn't this normally called the "OYE-0001" ? not "OY-0001" ?  The website
> and all literature I've seen uses the "OYE-0001" name...
> 
> Regardless, in many places, you have not followed the existing
> alphabetical order.
> 
> LiWeijian  wrote:
> > From: Tom Deng <2579131...@qq.com>
> > 
> > Adding support for OY-0001 Wireless Router.
> > OY-0001 is a wireless router made by oyewifi.com. Below is the details:
> > MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.
> > Signed-off-by: Tom Deng <2579131...@qq.com>
> > ---
> > diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds
> > b/target/linux/ramips/base-files/etc/board.d/01_leds
> > index 545bd70..fe3a79d 100755
> > --- a/target/linux/ramips/base-files/etc/board.d/01_leds
> > +++ b/target/linux/ramips/base-files/etc/board.d/01_leds
> > @@ -238,6 +238,10 @@ case $board in
> > set_wifi_led "zbtlink:blue:air"
> > set_usb_led "zbtlink:blue:usb"
> > ;;
> > +   oy-0001)
> > +   ucidef_set_led_default "power" "power" "oy:green:power" "1"
> > +   set_wifi_led "oy:green:wifi"
> > +   ;;
> > wr8305rt)
> > ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
> > set_usb_led "wr8305rt:usb"
> > diff --git a/target/linux/ramips/base-files/etc/board.d/02_network
> > b/target/linux/ramips/base-files/etc/board.d/02_network
> > index bc1fc01..9fb3535 100755
> > --- a/target/linux/ramips/base-files/etc/board.d/02_network
> > +++ b/target/linux/ramips/base-files/etc/board.d/02_network
> > @@ -139,6 +139,7 @@ ramips_setup_interfaces()
> > mzk-750dhp | \
> > whr-300hp2 | \
> > whr-600d | \
> > +   oy-0001 | \
> > wsr-600 | \
> > wsr-1166 | \
> > wt1520 | \
> > @@ -283,6 +284,11 @@ ramips_setup_macs()
> > wan_mac=$(mtd_get_mac_binary devdata 7)
> > ;;
> >  
> > +   oy-0001)
> > +   lan_mac=$(mtd_get_mac_binary factory 40)
> > +   wan_mac=$(mtd_get_mac_binary factory 46)
> > +   ;;
> > +
> > w306r-v20)
> > lan_mac=$(cat /sys/class/net/eth0/address)
> > wan_mac=$(macaddr_add "$lan_mac" 5)
> > diff --git a/target/linux/ramips/base-files/lib/ramips.sh
> > b/target/linux/ramips/base-files/lib/ramips.sh
> > index d2a1856..3d40ab9 100755
> > --- a/target/linux/ramips/base-files/lib/ramips.sh
> > +++ b/target/linux/ramips/base-files/lib/ramips.sh
> > @@ -400,6 +400,9 @@ ramips_board_detect() {
> > *"Zbtlink ZBT-WA05")
> > name="zbt-wa05"
> > ;;
> > +   *"OY-0001")
> > +   name="oy-0001"
> > +   ;;
> > *"ZBT WR8305RT")
> > name="wr8305rt"
> > ;;
> > diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > index cedd62b..8f45a84 100755
> > --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
> > @@ -116,6 +116,7 @@ platform_check_image() {
> > wr6202 |\
> > wr8305rt |\
> > wrtnode |\
> > +   oy-0001 |\
> > wt1520 |\
> > wt3020 |\
> > x5 |\
> > diff --git a/target/linux/ramips/dts/OY-0001.dts
> > b/target/linux/ramips/dts/OY-0001.dts
> > new file mode 100644
> > index 000..48b7099
> > --- /dev/null
> > +++ b/target/linux/ramips/dts/OY-0001.dts
> > @@ -0,0 +1,123 @@
> > +/dts-v1/;
> > +
> > +/include/ "mt7620a.dtsi"
> > +
> > +/ {
> > +   compatible = "ralink,mt7620a-soc";
> > +   model = &

[OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 Wireless Router

2015-07-09 Thread LiWeijian
From: Tom Deng <2579131...@qq.com>

Adding support for OY-0001 Wireless Router.
OY-0001 is a wireless router made by oyewifi.com. Below is the details:
MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.
Signed-off-by: Tom Deng <2579131...@qq.com>
---
diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds 
b/target/linux/ramips/base-files/etc/board.d/01_leds
index 545bd70..fe3a79d 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -238,6 +238,10 @@ case $board in
set_wifi_led "zbtlink:blue:air"
set_usb_led "zbtlink:blue:usb"
;;
+   oy-0001)
+   ucidef_set_led_default "power" "power" "oy:green:power" "1"
+   set_wifi_led "oy:green:wifi"
+   ;;
wr8305rt)
ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
set_usb_led "wr8305rt:usb"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network 
b/target/linux/ramips/base-files/etc/board.d/02_network
index bc1fc01..9fb3535 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -139,6 +139,7 @@ ramips_setup_interfaces()
mzk-750dhp | \
whr-300hp2 | \
whr-600d | \
+   oy-0001 | \
wsr-600 | \
wsr-1166 | \
wt1520 | \
@@ -283,6 +284,11 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_binary devdata 7)
;;
 
+   oy-0001)
+   lan_mac=$(mtd_get_mac_binary factory 40)
+   wan_mac=$(mtd_get_mac_binary factory 46)
+   ;;
+
w306r-v20)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 5)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index d2a1856..3d40ab9 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -400,6 +400,9 @@ ramips_board_detect() {
*"Zbtlink ZBT-WA05")
name="zbt-wa05"
;;
+   *"OY-0001")
+   name="oy-0001"
+   ;;
*"ZBT WR8305RT")
name="wr8305rt"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index cedd62b..8f45a84 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -116,6 +116,7 @@ platform_check_image() {
wr6202 |\
wr8305rt |\
wrtnode |\
+   oy-0001 |\
wt1520 |\
wt3020 |\
x5 |\
diff --git a/target/linux/ramips/dts/OY-0001.dts 
b/target/linux/ramips/dts/OY-0001.dts
new file mode 100644
index 000..48b7099
--- /dev/null
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -0,0 +1,123 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "ralink,mt7620a-soc";
+   model = "OY-0001";
+
+chosen {
+bootargs = "console=ttyS0,115200";
+};
+
+   palmbus@1000 {
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "w25q128";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "w25q128";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+   };
+
+   factory: partition@4 {
+   label = "factory";
+   reg = <0x4 0x1>;
+   read-only;
+   };
+
+   partition@5 {
+   label = "firmware";
+   reg = <0x5 0xfb>;
+   };
+
+   };
+   };
+   };
+
+   pinctrl {
+   state_default: pinctrl0 {
+  

[OpenWrt-Devel] [PATCH] ramips: adding support for OY-0001 Wireless Router

2015-07-06 Thread LiWeijian
From: Tom Deng <2579131...@qq.com>

Adding support for OY-0001 Wireless Router.
OY-0001 is a wireless router made by oyewifi.com. Below is the details:
MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.
Signed-off-by: Tom Deng <2579131...@qq.com>
---
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 74b8867..35a64dd 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -186,6 +186,9 @@ get_status_led() {
f7c027)
status_led="belkin:orange:status"
;;
+   oy-0001)
+   status_led="oy:green:wifi"
+   ;;
na930)
status_led="na930:blue:power"
;;
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 5d6ed2b..265525a 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -199,6 +199,10 @@ case $board in
set_wifi_led "zbtlink:blue:air"
set_usb_led "zbtlink:blue:usb"
;;
+   oy-0001)
+   ucidef_set_led_default "power" "power" "oy:green:power" "1"
+   set_wifi_led "oy:green:wifi"
+   ;;
wr8305rt)
ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
set_usb_led "wr8305rt:usb"
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index c3ea489..b847a1b 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -104,6 +104,7 @@ ramips_setup_interfaces()
dir-615-h1 | \
hlk-rm04 | \
mzk-w300nh2 | \
+   oy-0001 | \
mzk-750dhp)
ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
ucidef_add_switch "switch0" "1" "1"
@@ -221,6 +222,11 @@ ramips_setup_macs()
wan_mac=$(mtd_get_mac_binary devdata 7)
;;
 
+   oy-0001)
+   lan_mac=$(mtd_get_mac_binary factory 40)
+   wan_mac=$(mtd_get_mac_binary factory 46)
+   ;;
+
w306r-v20)
lan_mac=$(cat /sys/class/net/eth0/address)
wan_mac=$(macaddr_add "$lan_mac" 5)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index fd03423..f95adc5 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -325,6 +325,9 @@ ramips_board_detect() {
*"Zbtlink ZBT-WA05")
name="zbt-wa05"
;;
+   *"OY-0001")
+   name="oy-0001"
+   ;;
*"ZBT WR8305RT")
name="wr8305rt"
;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index ba69a89..ad35f9d 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -96,6 +96,7 @@ platform_check_image() {
wmr300 |\
wr8305rt |\
wrtnode |\
+   oy-0001 |\
x5 |\
x8 |\
zbt-wa05 |\
diff --git a/target/linux/ramips/dts/OY-0001.dts 
b/target/linux/ramips/dts/OY-0001.dts
new file mode 100644
index 000..48b7099
--- /dev/null
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -0,0 +1,123 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+   compatible = "ralink,mt7620a-soc";
+   model = "OY-0001";
+
+chosen {
+bootargs = "console=ttyS0,115200";
+};
+
+   palmbus@1000 {
+   gpio2: gpio@660 {
+   status = "okay";
+   };
+
+   gpio3: gpio@688 {
+   status = "okay";
+   };
+
+   spi@b00 {
+   status = "okay";
+
+   m25p80@0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "w25q128";
+   reg = <0 0>;
+   linux,modalias = "m25p80", "w25q128";
+   spi-max-frequency = <1000>;
+
+   partition@0 {
+   label = "u-boot";
+   reg = <0x0 0x3>;
+   read-only;
+   };
+
+   partition@3 {
+   label = "u-boot-env";
+   reg = <0x3 0x1>;
+   read-only;
+

[OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OY-0001 Wireless Router

2015-07-02 Thread LiWeijian

From: Tom Deng <2579131...@qq.com>
 
Adding support for OY-0001 Wireless Router.
OY-0001 is a wireless router made by oyewifi.com. Below is the details:
MT7620A, 128MB DDR2, 16MB FLASH, SD Slot, USB 2.0, 4 x LAN + 1 x WAN.
Signed-off-by: Tom Deng <2579131...@qq.com>
---
diff --git a/target/linux/ramips/base-files/etc/diag.sh 
b/target/linux/ramips/base-files/etc/diag.sh
index 74b8867..35a64dd 100755
--- a/target/linux/ramips/base-files/etc/diag.sh
+++ b/target/linux/ramips/base-files/etc/diag.sh
@@ -186,6 +186,9 @@ get_status_led() {
 f7c027)
 status_led="belkin:orange:status"
 ;;
+oy-0001)
+status_led="oy:green:wifi"
+;;
 na930)
 status_led="na930:blue:power"
 ;;
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/01_leds 
b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
index 5d6ed2b..265525a 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/01_leds
@@ -199,6 +199,10 @@ case $board in
 set_wifi_led "zbtlink:blue:air"
 set_usb_led "zbtlink:blue:usb"
 ;;
+oy-0001)
+ucidef_set_led_default "power" "power" "oy:green:power" "1"
+set_wifi_led "oy:green:wifi"
+;;
 wr8305rt)
 ucidef_set_led_default "power" "power" "wr8305rt:sys" "1"
 set_usb_led "wr8305rt:usb"
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/02_network 
b/target/linux/ramips/base-files/etc/uci-defaults/02_network
index c3ea489..b847a1b 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/02_network
+++ b/target/linux/ramips/base-files/etc/uci-defaults/02_network
@@ -104,6 +104,7 @@ ramips_setup_interfaces()
 dir-615-h1 | \
 hlk-rm04 | \
 mzk-w300nh2 | \
+oy-0001 | \
 mzk-750dhp)
 ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 ucidef_add_switch "switch0" "1" "1"
@@ -221,6 +222,11 @@ ramips_setup_macs()
 wan_mac=$(mtd_get_mac_binary devdata 7)
 ;;
 
+oy-0001)
+lan_mac=$(mtd_get_mac_binary factory 40)
+wan_mac=$(mtd_get_mac_binary factory 46)
+;;
+
 w306r-v20)
 lan_mac=$(cat /sys/class/net/eth0/address)
 wan_mac=$(macaddr_add "$lan_mac" 5)
diff --git a/target/linux/ramips/base-files/lib/ramips.sh 
b/target/linux/ramips/base-files/lib/ramips.sh
index fd03423..f95adc5 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -325,6 +325,9 @@ ramips_board_detect() {
 *"Zbtlink ZBT-WA05")
 name="zbt-wa05"
 ;;
+*"OY-0001")
+name="oy-0001"
+;;
 *"ZBT WR8305RT")
 name="wr8305rt"
 ;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh 
b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index ba69a89..ad35f9d 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -96,6 +96,7 @@ platform_check_image() {
 wmr300 |\
 wr8305rt |\
 wrtnode |\
+oy-0001 |\
 x5 |\
 x8 |\
 zbt-wa05 |\
diff --git a/target/linux/ramips/dts/OY-0001.dts 
b/target/linux/ramips/dts/OY-0001.dts
new file mode 100644
index 000..48b7099
--- /dev/null
+++ b/target/linux/ramips/dts/OY-0001.dts
@@ -0,0 +1,123 @@
+/dts-v1/;
+
+/include/ "mt7620a.dtsi"
+
+/ {
+compatible = "ralink,mt7620a-soc";
+model = "OY-0001";
+
+chosen {
+bootargs = "console=ttyS0,115200";
+};
+
+palmbus@1000 {
+gpio2: gpio@660 {
+status = "okay";
+};
+
+gpio3: gpio@688 {
+status = "okay";
+};
+
+spi@b00 {
+status = "okay";
+
+m25p80@0 {
+#address-cells = <1>;
+#size-cells = <1>;
+compatible = "w25q128";
+reg = <0 0>;
+linux,modalias = "m25p80", "w25q128";
+spi-max-frequency = <1000>;
+
+partition@0 {
+label = "u-boot";
+reg = <0x0 0x3>;
+read-only;
+};
+
+partition@3 {
+label = "u-boot-env";
+reg = <0x3 0x1>;
+read-only;
+};
+
+factory: partition@4 {
+label = "factory";
+reg = <0x4 0x1>;
+read-only;
+};
+
+partition@5 {
+label = "firmware";
+reg = <0x5 0xfb>;
+};
+
+};
+};
+};
+
+pinctrl {
+state_default: pinctrl0 {
+gpio {
+ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", 
"nd_sd";
+ralink,function = "gpio";
+};
+};
+};
+