From patchwork Tue Apr 28 18:47:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Roger Pueyo Centelles | Guifi.net" X-Patchwork-Id: 465737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BE73140320 for ; Wed, 29 Apr 2015 04:48:06 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=permerror reason="key not found" header.d=guifi.net header.i=@guifi.net header.b=vuo9TOEO; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 5205A28ACF0; Tue, 28 Apr 2015 20:46:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 3718D2805F2 for ; Tue, 28 Apr 2015 20:46:43 +0200 (CEST) X-policyd-weight: using cached result; rate: -7.6 Received: from smtp1.guifi.net (smtp1.guifi.net [109.69.9.53]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 28 Apr 2015 20:46:42 +0200 (CEST) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.guifi.net (Postfix) with ESMTP id 1DAAD4B4096D for ; Tue, 28 Apr 2015 20:47:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=guifi.net; h= x-mailer:message-id:date:date:subject:subject:from:from:received :received:received; s=dkim; t=1430246860; x=1432061261; bh=5zWt+ a1S3xwzRlpwNSgnyQ4btcDL4c1V8mbq1MrdwDk=; b=vuo9TOEO/LCFb3HjiRzWG V9k7hKdKpfycbT6vQVEjt4pwqnbg8rUhtnie0qfFAP5QO/Nx+fRMwq3XTn5hr6yN aszzUSdlwJmgwzJRBY1gCdZA8dzy5pWWZ2PRC4UKH6o7FSezBTScm87Q1Kv6+FKe 3IqDZGWMtyKanLNNr5YK5h14r1upbUjUchullUnajkUWRwmep4S9WiFhLSfFKMy4 mAaK+hY9+aTuLZ+GJdd6OKZQUKfQwcteaHvvYCncIfqkL7EeQrbek0zLGApWL/y9 YHaf8RmovOrFS2knajE76FjUdmZS8CXQXchz7c4ho+VLjGn44j1dTP9/DzSFX5Bk Q== X-Amavis-Modified: Mail body modified (using disclaimer) - smtp1.elserrat.org X-Virus-Scanned: Scrollout F1 on Debian amavisd-new at elserrat.org Received: from smtp1.guifi.net ([127.0.0.1]) by localhost (smtp1.elserrat.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id khEYrUojgEZV for ; Tue, 28 Apr 2015 20:47:40 +0200 (CEST) Received: from mail.elserrat.org (109-69-9-9-guifi-gurb.ip4.guifi.net [109.69.9.9]) by smtp1.guifi.net (Postfix) with ESMTP id 4094B4B40969 for ; Tue, 28 Apr 2015 20:47:40 +0200 (CEST) Received: from localhost.localdomain (unknown [84.88.85.1]) by mail.elserrat.org (Postfix) with ESMTPSA id 19F926A99A3 for ; Tue, 28 Apr 2015 20:47:40 +0200 (CEST) From: Roger Pueyo Centelles To: openwrt-devel@lists.openwrt.org Date: Tue, 28 Apr 2015 20:47:35 +0200 Message-Id: <1430246855-7639-1-git-send-email-roger.pueyo@guifi.net> X-Mailer: git-send-email 2.1.4 Subject: [OpenWrt-Devel] [PATCH] [ramips] Add support for Comfast CF-WR800N X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" 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 --- target/linux/ramips/base-files/etc/board.d/01_leds | 4 + .../linux/ramips/base-files/etc/board.d/02_network | 6 ++ target/linux/ramips/base-files/etc/diag.sh | 3 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/CF-WR800N.dts | 114 +++++++++++++++++++++ target/linux/ramips/image/Makefile | 2 + 7 files changed, 133 insertions(+) create mode 100644 target/linux/ramips/dts/CF-WR800N.dts 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 56ba3b7..80623f4 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -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" 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 24e1ba8..c8ef69f 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -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" diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 5301593..caede7b 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -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" ;; diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 616f4a1..5769d26 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -91,6 +91,9 @@ ramips_board_detect() { *"Buffalo WSR-1166DHP") name="wsr-1166" ;; + *"Comfast CF-WR800N") + name="cf-wr800n" + ;; *"Firefly FireWRT") name="firewrt" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 17b456b..4ecf331 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -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 index 0000000..5db6c83 --- /dev/null +++ b/target/linux/ramips/dts/CF-WR800N.dts @@ -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>; + }; + }; +}; diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index e6b5112..2f4fdf1 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -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))