From patchwork Tue Mar 19 12:33:13 2019 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: 1058379 X-Patchwork-Delegate: ynezz@true.cz 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=guifi.net Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UIdrgsmB"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=guifi.net header.i=@guifi.net header.b="ZCouO3xu"; 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 44NtFb42FWz9s9h for ; Tue, 19 Mar 2019 23:50:43 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=M/diOafZr4RoE6YZYmlgYeI0618eG0/1Aln/nV/g558=; b=UIdrgsmBPvhVDI wzIhQhtmEb7SP94Ir7JjSVDYUkq4kg0Il/Ts8cvi7sCZisRCBgxEUh2Jm3PF5G2bhGoWOrqdtEOXd fmol/Mzgw2Kqtelau5emJmw27OF2+w5LLkiT62Kp8M1kwgDLyQZ0Et6D9/7r0s1Vuj4FqiZrEPVOa 8UuPayekaKVHL14C+JmxiBIv8o/kAU8jQx+4P6pEVPxdW/vY0oRS0fPKjJJqxbReGOjkwT3vXQDKO KBHPu4p5/BaFTqX4mzpC5d1+R36Sa6hp8RhfAdIMHsIewZd31Oc6QzR6J9xmf4oyx7RPtscnBDBv3 sUQworA6wRykpTlUg76Q==; 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 1h6ECJ-0002Rx-Hf; Tue, 19 Mar 2019 12:50:27 +0000 Received: from smtp1.guifi.net ([109.69.9.53] helo=smtp1.elserrat.org) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6ECE-0001Ef-Ao for openwrt-devel@lists.openwrt.org; Tue, 19 Mar 2019 12:50:26 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.elserrat.org (Postfix) with ESMTP id 44NtDf6zHxz3vyF for ; Tue, 19 Mar 2019 13:49:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=guifi.net; h= content-transfer-encoding:mime-version:x-mailer:message-id:date :date:subject:subject:from:from:received:received:received; s= dkim; t=1552999794; x=1554814195; bh=3jeunA4yABK3yD8HHHJ42hWkrxM tTuFVg8XylDbbcD0=; b=ZCouO3xuQugowJiVsrs9rDBVDSPEsilezdBvjrLpvUk xYReMRH9QIYgOQzFNrgfd4hPfOqY7XzlDhCLmJmvhcZWCkIXkeYt5sAyu+WFaxUg oatdczlu1e/AlIzGEzUKj4R78AFMimKtTzAOWJ3MwX8LOW/MuC8Clu+iK+dgAI6G S7i7AiJMpl2gImEQFQK9OKE8oPsOh/0orw4u+BVmfC0tuDUzQ2zMsgGtbRH+VD54 H/lHOyL8isE/Mxx+n2lWWvkFMBb7uZNRWwv7Z44/+hvD2iuVw5b0hivvChX03hr6 9Nobn5L9txLArOELOkjFBbWIOc2l2LOlYJvQxz/sflA== X-Amavis-Modified: Mail body modified (using disclaimer) - smtp1.elserrat.org X-Virus-Scanned: Scrollout F1 at elserrat.org Received: from smtp1.elserrat.org ([127.0.0.1]) by localhost (smtp1.elserrat.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sin8IIrDPiPJ for ; Tue, 19 Mar 2019 13:49:54 +0100 (CET) Received: from mail.guifi.net (mail.guifi.net [109.69.9.9]) by smtp1.elserrat.org (Postfix) with ESMTP id 44NtDf5Lpnz3vtT for ; Tue, 19 Mar 2019 13:49:54 +0100 (CET) Received: from 7018 (dync-42-185.ac.upc.es [147.83.42.185]) by mail.guifi.net (Postfix) with ESMTPSA id 5FE7D6A781B; Tue, 19 Mar 2019 13:49:54 +0100 (CET) From: Roger Pueyo Centelles To: openwrt-devel@lists.openwrt.org Date: Tue, 19 Mar 2019 13:33:13 +0100 Message-Id: <20190319123312.10567-1-roger.pueyo@guifi.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_055024_308620_ABC8BD0B X-CRM114-Status: GOOD ( 15.80 ) X-Spam-Score: 0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [109.69.9.53 listed in list.dnswl.org] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid Subject: [OpenWrt-Devel] [RFC] ath79: add support for COMFAST CF-E313AC 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: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Hi, I've just added support for the COMFAST CF-E313AC, an outdoor wireless CPE with two Ethernet ports and a 802.11ac radio (see patch below). Everything is working fine but I've got two issues for which I'd like to get some advise: 1) target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata I had to add "rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin", since the driver tries to board-2.bin (the default calibration data from the firmware package) first and, when that file is not found, falls back to board.bin (the calibration data read from the flash). I haven't seen this on any other device, so I guess there must be a more elegant way to deal with it. Any idea? 2) target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts The device is equipped with a "w25q128" flash chip (16384 Kbytes) but the stock firmware image only used half of it (nvram partition finishes at 0x000000800000, i.e., 8192 Kbytes): *** stock firmware bootlog *** [...] [ 0.730000] 0x000000000000-0x000000010000 : "u-boot" [ 0.740000] 0x000000010000-0x000000020000 : "art" [ 0.740000] 0x000000020000-0x0000001a0000 : "kernel" [ 0.750000] 0x0000001a0000-0x0000007e0000 : "rootfs" [ 0.760000] mtd: device 3 (rootfs) set to be root filesystem [ 0.760000] 1 squashfs-split partitions found on MTD device rootfs [ 0.770000] 0x0000006c0000-0x0000007e0000 : "rootfs_data" [ 0.780000] 0x0000007e0000-0x0000007f0000 : "configs" [ 0.780000] 0x0000007f0000-0x000000800000 : "nvram" [ 0.790000] 0x000000020000-0x0000007e0000 : "firmware" [...] Is there a way to use the remaining half of the flash? Any comments regarding these or other issues will be highly appreciated. Thanks! --- .../ath79/base-files/etc/board.d/01_leds | 9 ++ .../etc/hotplug.d/firmware/11-ath10k-caldata | 7 + .../ath79/dts/qca9531_comfast_cf-e313ac.dts | 143 ++++++++++++++++++ target/linux/ath79/image/generic.mk | 8 + 4 files changed, 167 insertions(+) create mode 100644 target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index db5a6a4578..50c9ca2a8d 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -47,6 +47,15 @@ comfast,cf-e120a-v3) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" ;; +comfast,cf-e313ac) + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ucidef_set_led_switch "wan" "WAN" "$boardname:green:wan" "switch0" "0x02" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "rssilow" "RSSILOW" "$boardname:red:rssilow" "wlan0" "1" "100" + ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "$boardname:red:rssimediumlow" "wlan0" "26" "100" + ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "$boardname:green:rssimediumhigh" "wlan0" "51" "100" + ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "$boardname:green:rssihigh" "wlan0" "76" "100" + ;; dlink,dir-859-a1) ucidef_set_led_switch "internet" "WAN" "$boardname:green:internet" "switch0" "0x20" ;; diff --git a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 8651c97099..3096c4e1e8 100644 --- a/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -162,6 +162,13 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0000:00:00.0.bin") case $board in + comfast,cf-e313ac) + ath10kcal_extract "art" 20480 12064 + ath10kcal_patch_mac_crc $(mtd_get_mac_binary art 4098) + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin + ;; phicomm,k2t) ath10kcal_extract "art" 20480 12064 ath10kcal_patch_mac_crc $(k2t_get_mac "5g_mac") diff --git a/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts new file mode 100644 index 0000000000..cf6587b615 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_comfast_cf-e313ac.dts @@ -0,0 +1,143 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "qca953x.dtsi" + +/ { + compatible = "comfast,cf-e313ac", "qca,qca9531"; + model = "COMFAST CF-E313AC"; + + aliases { + serial0 = &uart; + led-boot = &wan; + led-failsafe = &wan; + led-upgrade = &wan; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + + wan: wan { + label = "cf-e313ac:green:wan"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + + lan: lan { + label = "cf-e313ac:green:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + wlan: wlan { + label = "cf-e313ac:green:wlan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + rssilow { + label = "cf-e313ac:red:rssilow"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "cf-e313ac:red:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "cf-e313ac:green:rssimediumhigh"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "cf-e313ac:green:rssihigh"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x010000>; + read-only; + }; + + art: partition@10000 { + label = "art"; + reg = <0x010000 0x010000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0x7c0000>; + }; + + partition@7e0000 { + label = "configs"; + reg = <0x7e0000 0x010000>; + read-only; + }; + + partition@7f0000 { + label = "nvram"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + phy-handle = <&swphy4>; +}; + +ð1 { + status = "okay"; + mtd-mac-address = <&art 0x6>; + + gmac-config { + device = <&gmac>; + }; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index ddf0e62898..69a29ab8fd 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -171,6 +171,14 @@ define Device/comfast_cf-e120a-v3 endef TARGET_DEVICES += comfast_cf-e120a-v3 +define Device/comfast_cf-e313ac + ATH_SOC := qca9531 + DEVICE_TITLE := COMFAST CF-E313AC + DEVICE_PACKAGES := rssileds kmod-leds-gpio kmod-ath10k-ct ath10k-firmware-qca9888-ct + IMAGE_SIZE := 8000k +endef +TARGET_DEVICES += comfast_cf-e313ac + define Device/devolo_dvl1200e ATH_SOC := qca9558 DEVICE_TITLE := devolo WiFi pro 1200e