From patchwork Tue Nov 13 12:10:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 997049 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AfKzxcvH"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="CYuCxGRB"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42vRLP6R64z9s5c for ; Tue, 13 Nov 2018 23:11:25 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BUIknlEmctE7Qme/+cf1h9DYLQ9JUiERueqc59MtCyQ=; b=AfKzxcvHa7nuxG duk2gfpI5UvkF9Q61J9BKx/7iWEr56BONvwFS5vaGZTTd1GOdiVg1O/JmYMBk+dzkMfPFZBowtEAF Vm16TUmCWRHwQOcMFwt37TB/I5IQv4ph8NKAnHn9ZDOqLMu16wGU1xCyUbTH7WYasqfGi+xH46zZG PeNcMTZzBR2h+dEtNpP70xzSqZ8uOnO/jO47XxynNgfWbmc7cvJW4tTfal1lOb3IMfBCoD3hjbAur jolab2UU0VA0C0kidcA0G0eKQ4UM8LrDatZcTNA2S6NDOZKRo1Sw20NI2adpouV5ouRuCFNgUtPem bNzq7/Dwcm/8aNqMG3xQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMXXM-00023A-BO; Tue, 13 Nov 2018 12:11:20 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMXXJ-000230-UR for openwrt-devel@bombadil.infradead.org; Tue, 13 Nov 2018 12:11:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=myWD7Jb0YbkAHL7nO7u9i47YvBIEQg5qEtaJUaAP1aA=; b=CYuCxGRBihBCLo+fp0JaOciI2/ RJdAcOJFpyf7u1uyePRfKe6fXb6C7KjfOu9+2yJD7dGkKQ18SwL8+KsYntKMUwQ8tprrW6JB9d1Mf 5X7RipoS3ooOgaQVJJTWsyhdVpHAWHsYzyPD9O379tgdLcH/f5fvJxpAB583iX/wda61Xpkckyw9z eEvAcGzRCJV+BZzLKJ/Ou2A7Xn/+dNa28NX5IVoJ3CoWjxZJx+ep7lskNo2wlTvxzkWz7+frxFnQ3 Qwg7kF21/rtMiHBZ7j1K15+lqDBELwbeU2qI2wt2X6+KWm52Zor5j1uLSqY/dQDwQicpAfG0mMO2w 4rz9FfSg==; Received: from smtp-out.xnet.cz ([178.217.244.18]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gMXXF-0004IT-Dr for openwrt-devel@lists.openwrt.org; Tue, 13 Nov 2018 12:11:15 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 82AD345F8; Tue, 13 Nov 2018 13:10:46 +0100 (CET) Received: from localhost.localdomain (localhost [127.0.0.1]) by meh.true.cz (OpenSMTPD) with ESMTP id 1360df47; Tue, 13 Nov 2018 13:10:45 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Tue, 13 Nov 2018 13:10:40 +0100 Message-Id: <1542111040-32723-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181113_071113_751601_D2E43ED1 X-CRM114-Status: GOOD ( 17.45 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] 0.0 NORMAL_HTTP_TO_IP URI: URI host has a public dotted-decimal IPv4 address Subject: [OpenWrt-Devel] [PATCH] ramips: Add support for ZTE ZXECS EBG3130 aka BDCOM WAP2100-SK X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= , =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org From: Petr Štetiar On the bottom sticker it's branded as ZTE ZXECS EBG3130 device, but in factory OpenWrt image it's referenced as BDCOM WAP2100-SK device. Specifications: - SoC: MediaTek MT7620A - RAM: 128 MB - Flash: 16 MB - Ethernet: 5 FE ports - Wireless radio: 2T2R 2.4 GHz and 1T1R 5 GHz (MT7610EN, unsupported) - UART: 1 x UART on PCB marked as J2 (R=RX, T=TX, G=GND) with 115200 8N1 config - LEDs: Power, FE ports 1-5, WPS, USB, RF 2.4G, RF 5G - Other: USB port, SD card slot and 2x external antennas (non-detachable) Flashing instructions: A) The U-Boot has HTTP based firmware upgrade A1) Flashing notes We've identified so far two different batches of units, unfortunately each batch has different U-Boot bootloader flashed with different default environment variables, thus each batch has different IP address for accessing web based firmware updater. * First batch has web based bootloader IP address 1.1.1.1 * Second batch has web based bootloader IP address 192.168.1.250 In case you can't connect to either of those IPs, you can try to get the default IP address via two methods: A1.1) Serial console, then the IP address is visible during the boot ... HTTP server is starting at IP: 1.1.1.1 raspi_read: from:40004 len:6 HTTP server is ready! ... A1.2) Over telnet/SSH using this command: root@bdcom:/# grep ipaddr= /dev/mtd0 ipaddr=1.1.1.1 A2) Flashing with browser * Change IP address of PC to 1.1.1.2 with 255.255.255.0 netmask * Reboot the device and try to reach web based bootloader in the browser with the following URL http://1.1.1.1 * Quickly select the firmware sysupgrade file and click on the `Update firmware` button, this all has to be done within 10 seconds, bootloader doesn't wait any longer If done correctly, the web page should show UPDATE IN PROGRESS page with progress indicator. Once the flashing completes (it takes roughly around 1 minute), the device will reboot to the OpenWrt firmware A3) Flashing with curl sudo ip addr add 1.1.1.2/24 dev eth0 curl \ --verbose \ --retry 3 \ --retry-delay 1 \ --retry-max-time 30 \ --connect-timeout 30 \ --form "firmware=@openwrt-ramips-mt7620-BDCOM-WAP2100-SK-squashfs-sysupgrade.bin" \ http://1.1.1.1 Now power on the router. B) The U-boot is based on Ralink SDK so we can flash the firmware using UART. 1. Configure PC with a static IP address and setup an TFTP server. 2. Put the firmware into the tftp directory. 3. Connect the UART line as described on the PCB (G=GND, R=RX, T=TX) 4. Power up the device and press 2, follow the instruction to set device and tftp server IP address and input the firmware file name. U-boot will then load the firmware and write it into the flash. Signed-off-by: Petr Štetiar --- target/linux/ramips/base-files/etc/board.d/01_leds | 4 + .../linux/ramips/base-files/etc/board.d/02_network | 1 + target/linux/ramips/base-files/lib/ramips.sh | 3 + .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/BDCOM-WAP2100-SK.dts | 130 +++++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 9 ++ 6 files changed, 148 insertions(+) create mode 100644 target/linux/ramips/dts/BDCOM-WAP2100-SK.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 2644bc0..aa6525d 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -364,6 +364,10 @@ vocore-16M) w502u) set_wifi_led "rt2800pci-phy0::radio" ;; +wap2100-sk) + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wlan2g" + ;; we1026-5g-16m) ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" set_wifi_led "we1026-5g:green:wifi" 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 9e9ecbc..a7ebd04 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -224,6 +224,7 @@ ramips_setup_interfaces() ubnt-erx|\ ubnt-erx-sfp|\ ur-326n4g|\ + wap2100-sk|\ wrtnode|\ wrtnode2p | \ wrtnode2r | \ diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 5741cbd..ba6a13b 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -553,6 +553,9 @@ ramips_board_detect() { *"W502U") name="w502u" ;; + *"WAP2100-SK") + name="wap2100-sk" + ;; *"WCR-1166DS") name="wcr-1166ds" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 7558b4e..bc77836 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -216,6 +216,7 @@ platform_check_image() { y1|\ y1s|\ youhua,wr1200js|\ + wap2100-sk|\ we1026-5g-16m|\ zbt-ape522ii|\ zbt-cpe102|\ diff --git a/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts b/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts new file mode 100644 index 0000000..7f9cbe7 --- /dev/null +++ b/target/linux/ramips/dts/BDCOM-WAP2100-SK.dts @@ -0,0 +1,130 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "bdcom,bdcom-wap2100-sk", "ralink,mt7620a-soc"; + model = "BDCOM WAP2100-SK"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + usb { + label = "wap2100-sk:green:usb"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wap2100-sk:green:wps"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "wap2100-sk:green:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + wps { + label = "wps"; + gpios = <&gpio0 12 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&spi0 { + status = "okay"; + + en25q128@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + 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; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xf70000>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&sdhci { + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "wdt", "mdio", "spi refclk", "uartf", "wled"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index b0d2b2a..a3d6888 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -79,6 +79,15 @@ define Device/ArcherMR200 endef TARGET_DEVICES += ArcherMR200 +define Device/BDCOM-WAP2100-SK + DTS := BDCOM-WAP2100-SK + IMAGE_SIZE := $(ralink_default_fw_size_16M) + SUPPORTED_DEVICES += wap2100-sk + DEVICE_TITLE := BDCOM WAP2100-SK (ZTE ZXECS EBG3130) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620 +endef +TARGET_DEVICES += BDCOM-WAP2100-SK + define Device/bocco DTS := BOCCO DEVICE_TITLE := YUKAI Engineering BOCCO