From patchwork Sun Mar 27 20:17:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Maciej Nowak X-Patchwork-Id: 1609929 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=ZnE1s7LU; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=iXjGRCaS; 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 4KRRzH492Cz9sFy for ; Mon, 28 Mar 2022 07:20:43 +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:Message-Id:Date:Subject: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=7VdYNCaRjoQ1/FOGu9CeFlWUzMG5gWVIih+mSSIF+TE=; b=ZnE1s7LUwpJiGK NO8VUB/z0nixMMgo6t1ArXPxYrMzSfWE56tc4+aqFT3BOVoFCFGtoo1LXsNpy7b4C2scN3SGhblxg eBWOdQbkvyicjLrFJNO8jeP7ay0LN29qJDtr2Yhj1cbuBvMxmggVsCJisYMc2hCHTWN6innOGDlww kurnikb2xpMqb3OAN875nN5kBH6RtdDAbsP87r4PSS9m7pjuee3408d2LOgNnntpR4pWAI1EBdptV 8ZHGaVNVJ4u00t1gyJDf1UgtBpBQVVRESzprg/AwbGY03P22sFwEZEIHnLkxHPAjZflzX0rDPkHT6 Vj8XgfN/Evsz2jYmw1mw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYZLA-006EpB-1Y; Sun, 27 Mar 2022 20:18:20 +0000 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nYZKP-006Eep-Ec for openwrt-devel@lists.openwrt.org; Sun, 27 Mar 2022 20:17:35 +0000 Received: by mail-lj1-x22d.google.com with SMTP id c15so16641971ljr.9 for ; Sun, 27 Mar 2022 13:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KEqK4BxXddpHAH+N5CRTRfRIIPSWtL/+XYt6ghhJFds=; b=iXjGRCaSbcuKk5tbmm4gc3y1jf9s7ct+pfx7qkjpgyOJf/LxMINd/oU30FmbLsuDAK Us5Q8+K4HHV/tzRDuPHsFujNA3lTcGCYiy7aqz1xclbUWcwC3Ic6gGuAR+M0Vc6nFNTT Of7MfhxJ0UuH/sienaeUimwYNXyK6LuC81twEMTMrJyoDabg2NC2QxyEYp314Zgj3Q2/ mk2ZrwJTrEgV/zwwf0I2cWyN8b+3+GKU+FiHS3NnuQ47KZnoIsECFhWLgWKJXqwaJdsx 2kON+SA8iuS31cBdmOo//ngz3+3aagFWxnnWujXxSoM1aRQxmNcflYQkRJpcsZB1Tg7j /JCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=KEqK4BxXddpHAH+N5CRTRfRIIPSWtL/+XYt6ghhJFds=; b=XGP0mjkd1Ewn8kOcpY3UiO4TYzSheiC3iLkeL3kL+6okKpqHFFX2Mcpscm2WMoW5Dk fCFD3MxvCwurc8rv1x1V2W+ExRIwyeufUSwvRptlzenfT4LNUpDVSgjJOQ45gxzlVdC4 z7nhjogzzaZ94IESgst56cpUqy4sQM+GzrSvSCgHURjNYD21KyZw8yw5R+G48U97vzRl u+/UwpGe+BNFlenoxbMcPddv9FQ1+qex3Dp0YlJY6rDzrgK1RvcleLVJmBtfvNcLZuc0 dijuUbHC5EgdtUiXh/mXMeEVM6a5rlbbSDewj2tap/BjC02USR2kfxitL+jSldpwV3hI 4/hA== X-Gm-Message-State: AOAM530Z2U2/ho2C7zDJbto1uk2Y8LqGN/Y65yRPmht825KhVavKh3AX dmYkEckNA2wUMYBRaqS9zigtGnb6q8U5hA== X-Google-Smtp-Source: ABdhPJyDaxFeNVqocGTVpURHBgDcOMJJ+tVeSBM+0nv1MpDmlw1Ab4ZbAsGyBim0VfD3SjYIrmr1dA== X-Received: by 2002:a05:651c:311:b0:246:1250:d6f with SMTP id a17-20020a05651c031100b0024612500d6fmr16733865ljp.455.1648412251325; Sun, 27 Mar 2022 13:17:31 -0700 (PDT) Received: from localhost.localdomain ([212.106.161.171]) by smtp.googlemail.com with ESMTPSA id u7-20020a2e1407000000b00247f17646b4sm1503869ljd.59.2022.03.27.13.17.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Mar 2022 13:17:30 -0700 (PDT) From: Tomasz Maciej Nowak To: openwrt-devel@lists.openwrt.org Subject: [PATCH 1/3] ath79: mikrotik: stack ar9344 devices to single dtsi Date: Sun, 27 Mar 2022 22:17:09 +0200 Message-Id: <20220327201711.377491-1-tmn505@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220327_131733_561241_8A2A3B49 X-CRM114-Status: GOOD ( 14.21 ) X-Spam-Score: 0.1 (/) 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: Most of boards from MikroTik with AR9344 SoC (supported and un-supported) replicate the same schematic, so stack common device nodes to a single dtsi. Signed-off-by: Tomasz Maciej Nowak --- .../ar9344_mikrotik_routerboard-16m-nor.dtsi | 8 - .../ar9344_mikrotik_routerboard-lhg-5nd.dts | 90 ++------- .../ar9344_mikrotik_routerboard-sxt-5n.dtsi | 185 [...] Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [tmn505[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [tmn505[at]gmail.com] -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 Most of boards from MikroTik with AR9344 SoC (supported and un-supported) replicate the same schematic, so stack common device nodes to a single dtsi. Signed-off-by: Tomasz Maciej Nowak --- .../ar9344_mikrotik_routerboard-16m-nor.dtsi | 8 - .../ar9344_mikrotik_routerboard-lhg-5nd.dts | 90 ++------- .../ar9344_mikrotik_routerboard-sxt-5n.dtsi | 185 ------------------ ...ar9344_mikrotik_routerboard-sxt-5nd-r2.dts | 108 +++++++++- .../dts/ar9344_mikrotik_routerboard.dtsi | 78 ++++++++ 5 files changed, 198 insertions(+), 271 deletions(-) delete mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi create mode 100644 target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi index 4bf0731b1afe..727ea074c060 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9344.dtsi" - &spi { status = "okay"; @@ -57,9 +55,3 @@ }; }; }; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts index 194a789fb216..b6de8c4b7b11 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts @@ -1,91 +1,27 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT +#include "ar9344_mikrotik_routerboard.dtsi" #include "ar9344_mikrotik_routerboard-16m-nor.dtsi" -#include -#include - / { compatible = "mikrotik,routerboard-lhg-5nd", "qca,ar9344"; model = "MikroTik RouterBOARD LHG 5nD"; +}; - aliases { - led-boot = &led_user; - led-failsafe = &led_user; - led-running = &led_user; - led-upgrade = &led_user; - }; - - leds { - compatible = "gpio-leds"; - - power { - label = "blue:power"; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - rssilow { - label = "green:rssilow"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - rssimediumlow { - label = "green:rssimediumlow"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - - rssimedium { - label = "green:rssimedium"; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - }; - - rssimediumhigh { - label = "green:rssimediumhigh"; - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; - }; - - rssihigh { - label = "green:rssihigh"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - }; - - led_user: user { - label = "white:user"; - gpios = <&gpio 20 GPIO_ACTIVE_LOW>; - }; - - lan { - label = "green:lan"; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; +&leds { + power { + label = "blue:power"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + default-state = "on"; }; - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; + led_user: user { + label = "white:user"; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; }; -}; - -ð0 { - status = "okay"; - phy-handle = <&swphy0>; - - gmac-config { - device = <&gmac>; - switch-phy-swap = <1>; + lan { + label = "green:lan"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; }; - -ð1 { - status = "okay"; - - compatible = "syscon", "simple-mfd"; -}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi deleted file mode 100644 index 86136289de3c..000000000000 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi +++ /dev/null @@ -1,185 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MIT - -#include "ar9344.dtsi" - -#include -#include - -/ { - compatible = "mikrotik,routerboard-sxt-5n", "qca,ar9344"; - model = "MikroTik SXT 5N platform"; - - aliases { - led-boot = &led_user; - led-failsafe = &led_user; - led-running = &led_user; - led-upgrade = &led_user; - }; - - leds { - compatible = "gpio-leds"; - - power { - label = "green:power"; - gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; - default-state = "on"; - }; - - rssilow { - label = "green:rssilow"; - gpios = <&gpio 13 GPIO_ACTIVE_LOW>; - }; - - rssimediumlow { - label = "green:rssimediumlow"; - gpios = <&gpio 12 GPIO_ACTIVE_LOW>; - }; - - rssimedium { - label = "green:rssimedium"; - gpios = <&gpio 4 GPIO_ACTIVE_LOW>; - }; - - rssimediumhigh { - label = "green:rssimediumhigh"; - gpios = <&gpio 21 GPIO_ACTIVE_LOW>; - }; - - rssihigh { - label = "green:rssihigh"; - gpios = <&gpio 18 GPIO_ACTIVE_LOW>; - }; - - led_user: user { - label = "green:user"; - gpios = <&gpio 3 GPIO_ACTIVE_LOW>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = ; - gpios = <&gpio 15 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - - gpio-export { - compatible = "gpio-export"; - - gpio_nand_power { - gpio-export,name = "sxt5n:power:nand"; - gpio-export,output = <0>; - gpios = <&gpio 14 GPIO_ACTIVE_LOW>; - }; - }; - - beeper { - compatible = "gpio-beeper"; - gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; - }; -}; - -&spi { - status = "okay"; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <40000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "RouterBoot"; - reg = <0x0 0x20000>; - compatible = "mikrotik,routerboot-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "bootloader1"; - reg = <0x0 0x0>; - read-only; - }; - - hard_config: hard_config { - read-only; - }; - - bios { - size = <0x1000>; - read-only; - }; - - soft_config { - }; - - partition@10000 { - label = "bootloader2"; - reg = <0x10000 0x10000>; - read-only; - }; - }; - }; - }; -}; - -&nand { - status = "okay"; - - nand-ecc-mode = "soft"; - qca,nand-swap-dma; - qca,nand-scan-fixup; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "booter"; - reg = <0x0000000 0x0040000>; - read-only; - }; - - partition@40000 { - label = "kernel"; - reg = <0x0040000 0x03c0000>; - }; - - partition@400000 { - label = "ubi"; - reg = <0x0400000 0x7c00000>; - }; - }; -}; - -ð0 { - status = "okay"; - - phy-handle = <&swphy0>; - - gmac-config { - device = <&gmac>; - switch-phy-swap = <1>; - }; -}; - -ð1 { - status = "okay"; - - compatible = "syscon", "simple-mfd"; -}; - -&wmac { - status = "okay"; - - qca,no-eeprom; -}; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts index 3d0b941c24c6..b128417ab4f1 100644 --- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts @@ -1,8 +1,114 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "ar9344_mikrotik_routerboard-sxt-5n.dtsi" +#include "ar9344_mikrotik_routerboard.dtsi" / { compatible = "mikrotik,routerboard-sxt-5nd-r2", "qca,ar9344"; model = "MikroTik RouterBOARD SXT 5nD r2 (SXT Lite5)"; + + gpio-export { + compatible = "gpio-export"; + + gpio_nand_power { + gpio-export,name = "sxt5n:power:nand"; + gpio-export,output = <0>; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; + + beeper { + compatible = "gpio-beeper"; + gpios = <&gpio 19 GPIO_ACTIVE_HIGH>; + }; +}; + +&leds { + power { + label = "green:power"; + gpios = <&gpio 11 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + led_user: user { + label = "green:user"; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "RouterBoot"; + reg = <0x0 0x20000>; + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader1"; + reg = <0x0 0x0>; + read-only; + }; + + hard_config: hard_config { + read-only; + }; + + bios { + size = <0x1000>; + read-only; + }; + + soft_config { + }; + + partition@10000 { + label = "bootloader2"; + reg = <0x10000 0x10000>; + read-only; + }; + }; + }; + }; +}; + +&nand { + status = "okay"; + + nand-ecc-mode = "soft"; + qca,nand-swap-dma; + qca,nand-scan-fixup; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "booter"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "kernel"; + reg = <0x0040000 0x03c0000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x0400000 0x7c00000>; + }; + }; }; diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi new file mode 100644 index 000000000000..10233e3d4eef --- /dev/null +++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include + +/ { + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds: leds { + compatible = "gpio-leds"; + + rssilow { + label = "green:rssilow"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + rssimediumlow { + label = "green:rssimediumlow"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + rssimediumhigh { + label = "green:rssimediumhigh"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <1>; + }; +}; + +ð1 { + status = "okay"; + + compatible = "syscon", "simple-mfd"; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +};