ramips: add support for Comfast CF-WR800N
authorJohn Crispin <john@openwrt.org>
Sat, 23 May 2015 15:26:39 +0000 (15:26 +0000)
committerJohn Crispin <john@openwrt.org>
Sat, 23 May 2015 15:26:39 +0000 (15:26 +0000)
This patch adds support for Comfast CF-WR800N, a wall-plug wireless router
based on the MT7620N SoC with one Ethernet port and a 802.11n 2.4 GHz radio.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
SVN-Revision: 45722

target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/etc/diag.sh
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/CF-WR800N.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile

index 56ba3b73cee0edfcebf803d051ec34b53220042e..80623f4a8d182956b0c135b3cec7419717abf5cd 100755 (executable)
@@ -73,6 +73,10 @@ case $board in
        br6524n)
                set_wifi_led "edimax:blue:wlan"
                ;;
+       cf-wr800n)
+               ucidef_set_led_netdev "lan" "lan" "comfast:white:ethernet" eth0.1
+               set_wifi_led "comfast:white:wifi"
+               ;;
        cy-swr1100)
                ucidef_set_led_default "wps" "WPS" "samsung:blue:wps" "0"
                set_usb_led "samsung:blue:usb"
index 24e1ba85027cd8e01bdc13c42f40bcbca6a4f8a6..c8ef69f2c009ad7da37e72fedc14b3ddaf90eace 100755 (executable)
@@ -108,6 +108,12 @@ ramips_setup_interfaces()
                ucidef_add_switch_vlan "switch0" "1" "1 2 3 4 6t"
                ;;
 
+       cf-wr800n)
+               ucidef_set_interface_lan "eth0.1"
+               ucidef_add_switch "switch0" "1" "1"
+               ucidef_add_switch_vlan "switch0" "1" "4 6t"
+               ;;
+
        cy-swr1100)
                ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
                ucidef_add_switch "switch0" "1" "1"
index 5301593f650fa8f7a1ea486e98104ef03f122faa..caede7bcc86964969ef58ea82654cd610a64b9d8 100644 (file)
@@ -36,6 +36,9 @@ get_status_led() {
        br6425 | br-6475nd)
                status_led="edimax:green:power"
                ;;
+       cf-wr800n)
+               status_led="comfast:white:wps"
+               ;;
        cy-swr1100)
                status_led="samsung:blue:wps"
                ;;
index 616f4a1a26808eef7e4b7d28be9fdac779e078d7..5769d26c2c1c449c77259cdf369e47cee8c73f62 100755 (executable)
@@ -91,6 +91,9 @@ ramips_board_detect() {
        *"Buffalo WSR-1166DHP")
                name="wsr-1166"
                ;;
+       *"Comfast CF-WR800N")
+               name="cf-wr800n"
+               ;;
        *"Firefly FireWRT")
                name="firewrt"
                ;;
index 17b456ba19372115f5b6e7f1b77cd9f0bcbc0d7d..4ecf3314dc15456d2beff42d4ece70f05c17ef2e 100755 (executable)
@@ -33,6 +33,7 @@ platform_check_image() {
        bc2 | \
        broadway | \
        carambola | \
+       cf-wr800n | \
        d105 | \
        dap-1350 | \
        dcs-930 | \
diff --git a/target/linux/ramips/dts/CF-WR800N.dts b/target/linux/ramips/dts/CF-WR800N.dts
new file mode 100644 (file)
index 0000000..5db6c83
--- /dev/null
@@ -0,0 +1,114 @@
+/dts-v1/;
+
+/include/ "mt7620n.dtsi"
+
+/ {
+       compatible = "cf-wr800n", "ralink,mt7620n-soc";
+       model = "Comfast CF-WR800N";
+
+       chosen {
+               bootargs = "console=ttyS0,115200";
+        };
+
+       palmbus@10000000 {
+               gpio0: gpio@600 {
+                       status = "okay";
+               };
+
+               gpio1: gpio@638 {
+                       status = "okay";
+               };
+
+               gpio2: gpio@660 {
+                       status = "okay";
+               };
+
+               gpio3: gpio@688 {
+                       status = "okay";
+               };
+
+               spi@b00 {
+                       status = "okay";
+
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "mx25l6405d";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "w25q64";
+                               spi-max-frequency = <10000000>;
+
+                               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 = "firmware";
+                                       reg = <0x50000 0x7b0000>;
+                               };
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
+       wmac@10180000 {
+               ralink,mtd-eeprom = <&factory 0>;
+       };
+
+       pinctrl {
+               state_default: pinctrl0 {
+                       default {
+                               ralink,group = "ephy", "wled", "spi refclk", "i2c";
+                               ralink,function = "gpio";
+                       };
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               ethernet {
+                       label = "comfast:white:ethernet";
+                       gpios = <&gpio2 4 1>;
+               };
+
+               wifi {
+                       label = "comfast:white:wifi";
+                       gpios = <&gpio3 0 1>;
+               };
+
+               wps {
+                       label = "comfast:white:wps";
+                       gpios = <&gpio1 15 1>;
+               };
+       };
+
+        gpio-keys-polled {
+                compatible = "gpio-keys-polled";
+                #address-cells = <1>;
+                #size-cells = <0>;
+                poll-interval = <20>;
+                reset {
+                        label = "reset";
+                        gpios = <&gpio0 2 1>;
+                        linux,code = <0x198>;
+                };
+        };
+};
index e6b5112d3e8df35b61331a2f6989d21481f474fa..2f4fdf16edc66a27c77d81b7bf77449684a13800 100644 (file)
@@ -848,6 +848,7 @@ Image/Build/Profile/WHR600D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-600d,
 whr_1166d_mtd_size=15400960
 Image/Build/Profile/WHR1166D=$(call BuildFirmware/CustomFlash/$(1),$(1),whr-1166d,WHR-1166D,$(whr_1166hd_mtd_size))
 dlink810l_mtd_size=6881280
+Image/Build/Profile/CF-WR800N=$(call BuildFirmware/Default8M/$(1),$(1),cf-wr800n,CF-WR800N)
 Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
 na930_mtd_size=20971520
 Image/Build/Profile/NA930=$(call BuildFirmware/CustomFlash/$(1),$(1),na930,NA930,$(na930_mtd_size))
@@ -877,6 +878,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/MT7620a_MT7530,$(1))
        $(call Image/Build/Profile/MT7620a_V22SG,$(1))
        $(call Image/Build/Profile/AIBR100,$(1))
+       $(call Image/Build/Profile/CF-WR800N,$(1))
        $(call Image/Build/Profile/RP-N53,$(1))
        $(call Image/Build/Profile/DIR-810L,$(1))
        $(call Image/Build/Profile/WHR300HP2,$(1))