[OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OYE-0001 Wireless Router
From: Tom Deng <2579131...@qq.com> Adding support for OYE-0001 Wireless Router. OYE-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> --- Index: target/linux/ramips/base-files/etc/diag.sh === --- target/linux/ramips/base-files/etc/diag.sh(revision 43797) +++ target/linux/ramips/base-files/etc/diag.sh(working copy) @@ -185,6 +185,9 @@ f7c027) status_led="belkin:orange:status" ;; +oye-0001) +status_led="oye:green:wifi" +;; na930) status_led="na930:blue:power" ;; Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds === --- target/linux/ramips/base-files/etc/uci-defaults/01_leds(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds(working copy) @@ -198,6 +198,10 @@ set_wifi_led "zbtlink:blue:air" set_usb_led "zbtlink:blue:usb" ;; +oye-0001) +ucidef_set_led_default "power" "power" "oye:green:power" "1" +set_wifi_led "oye:green:wifi" +;; wr8305rt) ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" set_usb_led "wr8305rt:usb" Index: target/linux/ramips/base-files/etc/uci-defaults/02_network === --- target/linux/ramips/base-files/etc/uci-defaults/02_network(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/02_network(working copy) @@ -103,6 +103,7 @@ dir-615-h1 | \ hlk-rm04 | \ mzk-w300nh2 | \ +oye-0001 | \ mzk-750dhp) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" @@ -220,6 +221,11 @@ wan_mac=$(mtd_get_mac_binary devdata 7) ;; +oye-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) Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac === --- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac(revision 0) +++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac(revision 0) @@ -0,0 +1,113 @@ +# +# Copyright (C) 2011 OpenWrt.org +# + +preinit_set_mac_address() { +local mac + +. /lib/functions.sh +. /lib/ramips.sh + +case $(ramips_board_name) in +3g-6200n |\ +3g-6200nl |\ +3g300m | \ +dir-620-d1 |\ +dir-300-b7 | \ +w150m | \ +mzk-w300nh2 |\ +wl-330n |\ +wl-330n3g |\ +wr8305rt) +mac=$(mtd_get_mac_binary factory 4) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +bc2 |\ +broadway |\ +d105 |\ +dir-620-a1 |\ +esr-9753 |\ +freestation5 |\ +hlk-rm04 | \ +mpr-a1 | \ +mpr-a2 | \ +dir-300-b7 | \ +dir-320-b1 | \ +psr-680w |\ +rt-n56u |\ +sl-r7205) +mac=$(mtd_get_mac_binary factory 4) +mac=$(macaddr_setbit_la "$mac") +ifconfig eth0 hw ether $mac 2>/dev/null +;; +br-6475nd) +mac=$(mtd_get_mac_binary devdata 13) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +asl26555 |\ +dir-300-b1 |\ +dir-300-b2 |\ +dir-600-b1 |\ +dir-610-a1) +mac=$(mtd_get_mac_binary devdata 16388) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +cy-swr1100 |\ +dir-645) +mac=$(mtd_get_mac_ascii nvram lanmac) +mac=$(macaddr_setbit_la "$mac") +ifconfig eth0 hw ether $mac 2>/dev/null +;; +dap-1350) +mac=$(mtd_get_mac_binary devdata 46) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +all0239-3g |\ +all0256n |\ +all5002 |\ +all5003 |\ +awm002-evb |\ +carambola |\ +dir-615-h1 |\ +fonera20n |\ +ip2202 |\ +rt-n13u |\ +hw550-3g |\ +nbg-419n |\ +omni-emb |\ +omni-emb-hpm |\ +px4885 |\ +tew-691gr |\ +tew-692gr |\ +w306r-v20 |\ +w502u|\ +wr6202 |\ +wnce2001 |\ +xdxrn502j) +mac=$(mtd_get_mac_binary factory 40) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +m3 |\ +m4 |\ +x5 |\ +x8) +mac=$(mtd_get_mac_binary factory 4) +mac=$(macaddr_add "$mac" -1) +ifconfig eth0 hw ether $mac 2>/dev/null +;; +oye-0001) +mac=$(mtd_get_mac_binary factory 40) +ifconfig eth0 hw ether $mac 2>/dev/null +
[OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OYE-0001 Wireless Router
From: Tom Deng <2579131...@qq.com> Adding support for OYE-0001 Wireless Router. OYE-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> --- Index: target/linux/ramips/base-files/etc/diag.sh === --- target/linux/ramips/base-files/etc/diag.sh(revision 43797) +++ target/linux/ramips/base-files/etc/diag.sh(working copy) @@ -185,6 +185,9 @@ f7c027) status_led="belkin:orange:status" ;; +oye-0001) +status_led="oye:green:wifi" +;; na930) status_led="na930:blue:power" ;; Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds === --- target/linux/ramips/base-files/etc/uci-defaults/01_leds(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds(working copy) @@ -198,6 +198,10 @@ set_wifi_led "zbtlink:blue:air" set_usb_led "zbtlink:blue:usb" ;; +oye-0001) +ucidef_set_led_default "power" "power" "oye:green:power" "1" +set_wifi_led "oye:green:wifi" +;; wr8305rt) ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" set_usb_led "wr8305rt:usb" Index: target/linux/ramips/base-files/etc/uci-defaults/02_network === --- target/linux/ramips/base-files/etc/uci-defaults/02_network(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/02_network(working copy) @@ -103,6 +103,7 @@ dir-615-h1 | \ hlk-rm04 | \ mzk-w300nh2 | \ +oye-0001 | \ mzk-750dhp) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" @@ -220,6 +221,11 @@ wan_mac=$(mtd_get_mac_binary devdata 7) ;; +oye-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) Index: target/linux/ramips/base-files/lib/ramips.sh === --- target/linux/ramips/base-files/lib/ramips.sh(revision 43797) +++ target/linux/ramips/base-files/lib/ramips.sh(working copy) @@ -322,6 +322,9 @@ *"Zbtlink ZBT-WA05") name="zbt-wa05" ;; +*"OYE-0001") +name="oye-0001" +;; *"ZBT WR8305RT") name="wr8305rt" ;; Index: target/linux/ramips/base-files/lib/upgrade/platform.sh === --- target/linux/ramips/base-files/lib/upgrade/platform.sh(revision 43797) +++ target/linux/ramips/base-files/lib/upgrade/platform.sh(working copy) @@ -95,6 +95,7 @@ wmr300 |\ wr8305rt |\ wrtnode |\ +oye-0001 |\ x5 |\ x8 |\ zbt-wa05 |\ Index: target/linux/ramips/dts/OYE-0001.dts === --- target/linux/ramips/dts/OYE-0001.dts(revision 0) +++ target/linux/ramips/dts/OYE-0001.dts(revision 0) @@ -0,0 +1,123 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { +compatible = "ralink,mt7620a-soc"; +model = "OYE-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
[OpenWrt-Devel] [PATCH] [generic] ramips: adding support for OYE-0001 Wireless Router
From: Tom Deng <2579131...@qq.com> Adding support for OYE-0001 Wireless Router. OYE-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> --- Index: target/linux/ramips/base-files/etc/diag.sh === --- target/linux/ramips/base-files/etc/diag.sh(revision 43797) +++ target/linux/ramips/base-files/etc/diag.sh(working copy) @@ -185,6 +185,9 @@ f7c027) status_led="belkin:orange:status" ;; +oye-0001) +status_led="oye:green:wifi" +;; na930) status_led="na930:blue:power" ;; Index: target/linux/ramips/base-files/etc/uci-defaults/01_leds === --- target/linux/ramips/base-files/etc/uci-defaults/01_leds(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/01_leds(working copy) @@ -198,6 +198,10 @@ set_wifi_led "zbtlink:blue:air" set_usb_led "zbtlink:blue:usb" ;; +oye-0001) +ucidef_set_led_default "power" "power" "oye:green:power" "1" +set_wifi_led "oye:green:wifi" +;; wr8305rt) ucidef_set_led_default "power" "power" "wr8305rt:sys" "1" set_usb_led "wr8305rt:usb" Index: target/linux/ramips/base-files/etc/uci-defaults/02_network === --- target/linux/ramips/base-files/etc/uci-defaults/02_network(revision 43797) +++ target/linux/ramips/base-files/etc/uci-defaults/02_network(working copy) @@ -103,6 +103,7 @@ dir-615-h1 | \ hlk-rm04 | \ mzk-w300nh2 | \ +oye-0001 | \ mzk-750dhp) ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2" ucidef_add_switch "switch0" "1" "1" @@ -220,6 +221,11 @@ wan_mac=$(mtd_get_mac_binary devdata 7) ;; +oye-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) Index: target/linux/ramips/base-files/lib/ramips.sh === --- target/linux/ramips/base-files/lib/ramips.sh(revision 43797) +++ target/linux/ramips/base-files/lib/ramips.sh(working copy) @@ -322,6 +322,9 @@ *"Zbtlink ZBT-WA05") name="zbt-wa05" ;; +*"OYE-0001") +name="oye-0001" +;; *"ZBT WR8305RT") name="wr8305rt" ;; Index: target/linux/ramips/base-files/lib/upgrade/platform.sh === --- target/linux/ramips/base-files/lib/upgrade/platform.sh(revision 43797) +++ target/linux/ramips/base-files/lib/upgrade/platform.sh(working copy) @@ -95,6 +95,7 @@ wmr300 |\ wr8305rt |\ wrtnode |\ +oye-0001 |\ x5 |\ x8 |\ zbt-wa05 |\ Index: target/linux/ramips/dts/OYE-0001.dts === --- target/linux/ramips/dts/OYE-0001.dts(revision 0) +++ target/linux/ramips/dts/OYE-0001.dts(revision 0) @@ -0,0 +1,123 @@ +/dts-v1/; + +/include/ "mt7620a.dtsi" + +/ { +compatible = "ralink,mt7620a-soc"; +model = "OYE-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