From patchwork Sun Nov 7 20:28:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Hnatiuk X-Patchwork-Id: 1552011 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0AFrPOnA; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=alexconst.sh header.i=@alexconst.sh header.a=rsa-sha256 header.s=MBO0001 header.b=KGwuSeJs; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) 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=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HnQqz2Qlmz9s5P for ; Mon, 8 Nov 2021 07:31:11 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:Message-ID:To:From :Date: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=L1hUWQJeh5F25bEWHC+kg4UfuOL9EFmo2TjWxW4ad/s=; b=0AFrPOnAdRDjwX M0q54Ecz/ZFwP1stsYv8QqJ1hxamV2m2ofP2OI+XfFOXM71QhEmm6F740T6qLHFcFutfZpIiN/ays gq9EWZp9S5PnzaKjtFwAWICKzq5JiRMAXvUffvrAxR4zjisGNrtwMifz6KsOvwuMaMWcWEpgPu3E0 acg4WTLrcDcSwuHSvTDt/exrsj7OXBnN5Ib8k8KBDi3DwBO/BCdENetS03lrekdia7of6kWczowPy ymCWd9qolnbxsXj+9Cs3QMpRB/RcIU4GXHUCwL9rE5SZDdLqUQhaYcEgIWJaDuoFLD4ZWYxIPnpsS 0JXkJIo4zQ9lBavk7s+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjomt-00EoWv-1V; Sun, 07 Nov 2021 20:29:11 +0000 Received: from mout-p-102.mailbox.org ([2001:67c:2050::465:102]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjomo-00EoW8-Cx for openwrt-devel@lists.openwrt.org; Sun, 07 Nov 2021 20:29:08 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4HnQnS0YXKzQjgT for ; Sun, 7 Nov 2021 21:29:00 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alexconst.sh; s=MBO0001; t=1636316936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wsoJhmbE8Rw3EYrJRLvKfLZMumbWkhtWBPyfcMs1pMI=; b=KGwuSeJsZl0oLWO4iMU+SQfyuChlYN7+vqEr3EV9dQmLOit99Z0etBs6VmKd5qMm+HvK8w 5mhQw19+wC5ISV7cVmyWaB7HuhwxJKHQh3GZ/4eaZT2HaXSqoQ0whmOJsAkOfA/4LvpIoh gLNFbJCgJddZr6zH1mmHy60ma8Bbt3BJvqG8PGzzXmoArnQUtRQQxZS/lWFCPjNW7433ta 65joomHWWb0qWJ1ufACSguuUf4eLPL+Mobd8NGgqEYCaVIsk06v8sVhSbYJX1Fj75V5Jub SBkutC2VowFxq9HMa2bylo9IdpX/Fi8l9Go78pt64B9Hf8qijIT5ou35aeqDGw== Date: Sun, 7 Nov 2021 22:28:53 +0200 (EET) From: Oleksandr Hnatiuk To: "openwrt-devel@lists.openwrt.org" Message-ID: <2056350891.278465.1636316933856@office.mailbox.org> Subject: mips: [RFC] adding support for APJET01 ref board MIME-Version: 1.0 X-Priority: 3 Importance: Normal X-Rspamd-Queue-Id: F038A11F5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211107_122906_727291_2BA20330 X-CRM114-Status: GOOD ( 16.65 ) X-Spam-Score: -0.8 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Oleksandr Hnatiuk Signed-off-by: Oleksandr Hnatiuk Wrote incomplete device tree. Added new device to the build system. --- Hi! I'm trying to add support for a new board based on QCN5502 SoC and I'm unsure about how to proceed with my device tree. Belo [...] Content analysis details: (-0.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2001:67c:2050:0:0:0:465:102 listed in] [list.dnswl.org] 0.1 URIBL_SBL_A Contains URL's A record listed in the Spamhaus SBL blocklist [URIs: alexconst.sh] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List 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 From: Oleksandr Hnatiuk Signed-off-by: Oleksandr Hnatiuk Wrote incomplete device tree. Added new device to the build system. --- Hi! I'm trying to add support for a new board based on QCN5502 SoC and I'm unsure about how to proceed with my device tree. Below are the information about hardware on the device and my current patches. Another device with the same SoC is partially supported in this PR: https://github.com/openwrt/openwrt/pull/4271. The patches to get the CPU working seem trivial. Arch: mips/ath79 SoC: QCN5502 Board: Qualcomm Atheros APJET01 reference board Sold by ASUS under these names: RT-AC57U v2, RT-AC58U v2, RT-AC59U Flash: 16 MiB (Winbond SPI nor flash) RAM: 128 MiB (Winbond W971GG6SB-25) Switch: Qualcomm Atheros QCA8337 2.4 GHz Wi-Fi: 802.11n 4T4R QCN5502 (integrated into the CPU?) 5 GHz Wi-Fi: 802.11ac 2T2R QCA9888 Other: USB 2.0 Additional info: https://wikidevi.wi-cat.ru/ASUS_RT-AC59U Questions regarding device tree: 1. Is there anything else I should add to it or change? 2. How would I describe switch and ports on the board? 3. The clock of what chip does clock-frequency refer to? 4. Which partitions should be made read-only? Questions regarding modifications to OpenWrt files for new device support: 5. How do I figure out which case is suitable for my device in target/linux/ath79/generic/base-files/etc/board.d/02_network? 6. In target/linux/ath79/image/generic.mk, what does LOADER_FLASH_OFFS variabe mean? 7. How do I know the IMAGE_SIZE for my device? Can I omit it? 8. Does the patch to target/linux/ath79/image/generic.mk look OK? +define Device/qca_apjet01 + SOC := qcn5502 + DEVICE_VENDOR := Qualcomm Atheros + DEVICE_MODEL := APJET01 + DEVICE_PACKAGES := kmod-usb2 + SUPPORTED_DEVICES += apjet01 + LOADER_TYPE := bin + KERNEL := kernel-bin | append-dtb | lzma -d20 | uImage lzma + COMPILE := loader-$(1).bin loader-$(1).uImage + COMPILE/loader-$(1).bin := loader-okli-compile + COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \ + uImage lzma +endef + +define Device/qca_apjet01-16m + $(Device/qca_apjet01) + DEVICE_VARIANT := (16M) + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | check-size | pad-to 14528k | \ + append-loader-okli-uimage $(1) | pad-to 64k +endef +TARGET_DEVICES += qca_apjet01-16m + define Device/qihoo_c301 $(Device/seama) SOC := ar9344 diff --git a/target/linux/ath79/dts/qcn5502_asus_rtac59u.dts b/target/linux/ath79/dts/qcn5502_asus_rtac59u.dts new file mode 100644 index 0000000000..364bf4b502 --- /dev/null +++ b/target/linux/ath79/dts/qcn5502_asus_rtac59u.dts @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include +#include + +#include "qca956x.dtsi" + +/ { + compatible = "asus,rt-ac59u", "qca,qcn5502", "qca,qca9560"; + model = "ASUS RT-AC59U"; + + aliases { + serial0 = &uart; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "mips,mips74Kc"; + clocks = <&pll ATH79_CLK_CPU>; + reg = <0>; + }; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + leds { + compatible = "gpio-leds"; + + wlan { + label = "apjet01:green:wlan"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "apjet01:green:usb", + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + lan@1 { + label = "apjet01:green:lan"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + lan@2 { + label = "apjet01:green:lan"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + lan@3 { + label = "apjet01:green:lan"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + lan@4 { + label = "apjet01:green:lan"; + gpios = <&gpio 5 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + + button@0 { + label = "wps"; + linux,code = ; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + button@1 { + label = "reset"; + linux,code = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + // TODO + //clock-frequency = <25000000>; +}; + +&uart { + status = "okay"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "winbond,w25q128", "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 0x040000>; + }; + + partition@040000 { + label = "nvram"; + reg = <0x040000 0x010000>; + }; + + partition@050000 { + label = "factory"; + reg = <0x050000 0x010000>; + }; + + partition@060000 { + label = "linux"; + reg = <0x060000 0xf20000>; + }; + + partition@19ab80 { + label = "rootfs"; + reg = <0x19ab80 0xde5480>; + }; + + partition@f80000 { + label = "jffs2"; + reg = <0xf80000 0x080000>; + }; + + partition@0 { + label = "ALL"; + reg = <0x000000 0x1000000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 9d0be2b86b..2b571a61d8 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1963,6 +1963,30 @@ define Device/qca_ap143-16m endef TARGET_DEVICES += qca_ap143-16m