From patchwork Sat Aug 14 12:33:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Niklas Burfeind X-Patchwork-Id: 1516832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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=) Authentication-Results: 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=4psXIYX3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=aiyionpri.me header.i=@aiyionpri.me header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=aL4zrEvm; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4Gn0Nq0LJZz9sX3 for ; Sat, 14 Aug 2021 22:39:20 +1000 (AEST) 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:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=q/gPtrZlpCRcNT/CiEaoTZTPqInwnsc2hlTED+mWLmA=; b=4psXIYX3idfAyn wnTWMNAIy76w3mg3cgGFOa3Z3SAmocJ1bibq6RKH9Ecn+E/qZLyt9YZ0RBVnemO4dYqpqSm8aZTxU dW9T5QwZU6ItEKwQMRPFtJqfSoITRt6h7MyRAhsu3kgkTEVuFe//C5s5E9zU8U78n0aKtwmWmmryQ 0YF2d57wlUtoQS2Ic3artIVHxBcw8MxmtorFYUXVdFkpobfLezYCpXj5v/3bECrzj5vT7V3nGbQ1W wZ5CKOT+q4Gx0WF8j4OcB8FDiwvqAEd63vMTJfJhzPeCcCASptTHtFQkSgmpnmKvPHFtSt9X9JMmm khhWPfqPyWioEBcMUwcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEsre-00E99t-Jy; Sat, 14 Aug 2021 12:34:14 +0000 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mEsrW-00E99I-2i for openwrt-devel@lists.openwrt.org; Sat, 14 Aug 2021 12:34:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1628944440; s=strato-dkim-0002; d=aiyionpri.me; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=e9F9wpMXad3zDXitqybIJWF3bqmAe0ZjTyD425nQmF8=; b=aL4zrEvm+lWBHK+1L5Si0wKLMmVIu8f4Ivkg0NWPaevQwhBcU8GG1NjsdyaaaJq7YP 5UqydpJDgY12Wg3wWBeVCmr7eE1cjW0pPXSgA/UfVOf37ZK6qQ0kYcKiCcUuZPN52OBV grgHiGiBt4xWi/jDO4wk4ZlQuk7HjBGf8KDMneqZFI1lEkvdWKd1MNx3Tf4OL7E+35wo fvOVDGvPOAtNKb84902RxcyINBQwGogTJSmpKuINmd0sJ6XyMInLlQ4WGwci3vYqN0Fw MpqQYc7QVN+L7D5tvUEKrwEWhhsnNYpr4b8RHHtD20NAy0Bci10l8UDIQNTFSO8stjYe WFVQ== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":IWkkdEmxcvCtRDtHUQOu48a0Nfy9hOkboq9r6d0vrgVDHZTjCI3RMwuZyUMg713Dbl8iqSp1NadsWrHH0/WR5K7L8K5RM0ztqRwc" X-RZG-CLASS-ID: mo00 Received: from chromia.speedport.ip by smtp.strato.de (RZmta 47.31.0 AUTH) with ESMTPSA id h0631ax7ECXxcO7 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sat, 14 Aug 2021 14:33:59 +0200 (CEST) From: Jan-Niklas Burfeind To: openwrt-devel@lists.openwrt.org Cc: openwrt@sebastianschaper.net, Jan-Niklas Burfeind Subject: [PATCH v2] ath79: add support for onion omega Date: Sat, 14 Aug 2021 14:33:56 +0200 Message-Id: <20210814123356.343682-1-git@aiyionpri.me> X-Mailer: git-send-email 2.32.0 In-Reply-To: <5f4e1231-e15e-d4bb-132d-1b05f3313d16@david-bauer.net> References: <5f4e1231-e15e-d4bb-132d-1b05f3313d16@david-bauer.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210814_053406_362627_8648B1AC X-CRM114-Status: GOOD ( 14.89 ) X-Spam-Score: -0.2 (/) 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: The Onion Omega is a hardware development platform with built-in WiFi. https://onioniot.github.io/wiki/ Specifications: - QCA9331 @ 400 MHz (MIPS 24Kc Big-Endian Processor) - 64MB of DDR2 RAM running at 400 MHz - 16MB of on-board flash storage - Support for USB 2.0 - Support for Ethernet at 100 Mbps - 8 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [81.169.146.217 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [81.169.146.217 listed in wl.mailspike.net] 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 SPF_HELO_PASS SPF: HELO matches 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 The Onion Omega is a hardware development platform with built-in WiFi. https://onioniot.github.io/wiki/ Specifications: - QCA9331 @ 400 MHz (MIPS 24Kc Big-Endian Processor) - 64MB of DDR2 RAM running at 400 MHz - 16MB of on-board flash storage - Support for USB 2.0 - Support for Ethernet at 100 Mbps - 802.11b/g/n WiFi at 150 Mbps - 18 digital GPIOs - A single Serial UART - Support for SPI - Support for I2S Flash instructions: The device is running OpenWrt upon release using the ar71xx target. Both a sysupgrade and uploading the factory image using u-boots web-UI do work fine. Depending on the ssh client, it might be necessary to enable outdated KeyExchange methods e.g. in the clients ssh-config: Host 192.168.1.1 KexAlgorithms +diffie-hellman-group1-sha1 The stock credentials are: root onioneer For u-boots web-UI manually configure `192.168.1.2/24` on your computer, connect to `192.168.1.1`. MAC addresses as verified by OEM firmware: 2G phy0 label LAN eth0 label - 1 LAN is only available in combination with an optional expansion dock. Based on vendor acked commit: commit 5cd49bb067ca ("ar71xx: add support for Onion Omega") Partly reverts: commit fc553c7e4c8e ("ath79: drop unused/incomplete dts") Signed-off-by: Jan-Niklas Burfeind Reviewed-by: Tomasz Maciej Nowak --- Hello David, thanks for the review. I think I got both you as well as Sebastians suggestion patched. This revision contains them both, compiled without errors this morning and is currently running on an omega next to me; dmesg is inconspicuous. Thanks Jan-Niklas/Aiyion target/linux/ath79/dts/ar9331_onion_omega.dts | 127 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + target/linux/ath79/image/generic.mk | 13 ++ 3 files changed, 141 insertions(+) create mode 100644 target/linux/ath79/dts/ar9331_onion_omega.dts diff --git a/target/linux/ath79/dts/ar9331_onion_omega.dts b/target/linux/ath79/dts/ar9331_onion_omega.dts new file mode 100644 index 0000000000..b08c62221f --- /dev/null +++ b/target/linux/ath79/dts/ar9331_onion_omega.dts @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "Onion Omega"; + compatible = "onion,omega", "qca,ar9331"; + + aliases { + serial0 = &uart; + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + }; + + leds { + compatible = "gpio-leds"; + + led_system: system { + label = "amber:system"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + poll-interval = <100>; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <25000000>; +}; + +&gpio { + status = "okay"; +}; + +&usb { + status = "okay"; + + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +ð0 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(-1)>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <4>; + switch-phy-swap = <4>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <25000000>; + reg = <0>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_uboot_1fc00: macaddr@1fc00 { + reg = <0x1fc00 0x6>; + }; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cell-names = "mac-address"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 4fe7fbc027..b859c64633 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -45,6 +45,7 @@ ath79_setup_interfaces() netgear,ex7300|\ ocedo,koala|\ ocedo,raccoon|\ + onion,omega|\ openmesh,mr600-v1|\ openmesh,mr600-v2|\ openmesh,mr900-v1|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 2abe1b7307..5b39e89bbb 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1653,6 +1653,19 @@ define Device/ocedo_ursus endef TARGET_DEVICES += ocedo_ursus +define Device/onion_omega + $(Device/tplink-16mlzma) + SOC := ar9331 + DEVICE_VENDOR := Onion + DEVICE_MODEL := Omega + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + SUPPORTED_DEVICES += onion-omega + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma + IMAGE_SIZE := 16192k + TPLINK_HWID := 0x04700001 +endef +TARGET_DEVICES += onion_omega + define Device/openmesh_common_64k DEVICE_VENDOR := OpenMesh DEVICE_PACKAGES := uboot-envtools