From patchwork Mon Feb 22 08:59:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Salvaterra X-Patchwork-Id: 1442996 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.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=merlin.20170209 header.b=uYLyJpvR; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Y3s+yYUU; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 4DkbmC1C4pz9sVV for ; Mon, 22 Feb 2021 20:02:18 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YAFGFUS4p5mCSmkqOJhYBaHeeoy8c/lKmO85ZSBGtlg=; b=uYLyJpvR6/1nUe6w23bcm0meH b0mpByVGI78SyRCCpyFv8tzVlh0DXoLU+R7LKNj9/h/NjgMAyVrEO6xWJtvU6VDwzZvdFT2P1AFMW xv4cCZ3NlTMF+B6RKQqzpCoBzQbK61iC53O0DeHMf2gj0B5+1ENeMSbRV7r3IXwyan3v7pJ9zs4v9 5FxF/Z5pXYFUyhNAlELFPV6qXa9+vmnBg1RB1QgnoSD85Dd614yMs3TE+V6Le6Vg4/qFRK4ZHWnjG gsVTMxYsS1G+/FCOXfyEiJ2WBYOJM8jZ1mBu/XfdGwyDLDK80RDvmQ4pFAH6WUe1MqY6T/H5stPpj Zdp82ammw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE74l-00051v-AB; Mon, 22 Feb 2021 09:00:19 +0000 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lE74V-0004xW-My for openwrt-devel@lists.openwrt.org; Mon, 22 Feb 2021 09:00:07 +0000 Received: by mail-qv1-xf31.google.com with SMTP id e9so5714584qvy.3 for ; Mon, 22 Feb 2021 01:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VPgDGMFwSkliWligOFV3BnnDeK3eeKGkmlW27sEfmwo=; b=Y3s+yYUUVb4UVqcSNRMOw3fdAsZRHs5Zm1Alr99Ki/wOrrcWuaYqSa3CXrpPfDu1Ir 9X4Y+CR8dcx18+G2GLNn30fm2RCjxxsrl+bH80eWSDx3NJZkvPDmCH/oqvoz0RAVKpIy N+aMnk9rMpcVDqIAGhArBYDWQAPleQ+7DX9Mi53xwgeNyWthD46mzqDiA6a9UkacyZ5d ZwSylLHP0tqldRUqo/xKa+OtTHG/p2+Ba+yNlx+ISO6Zk3az2o9dsVeCD2PFyRNNGlTU m4vwra6WTL11C+qW4f3/1aSKXYphRXhg+yf8/aggh050BN/oiLZ3QFD48gJTHdSDl11c Vh5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VPgDGMFwSkliWligOFV3BnnDeK3eeKGkmlW27sEfmwo=; b=NcLJYkWwb8J/tYrcnCnr2G4y8pWyvNyU8MvyGLywHvUo8mgKhkxb9dn+fuLDlufKrC RPHXhVGuuyGqkgRjj7KFMbQbXtkOYWFvNMuS9k1JsRkcfifUn5IBIZRY1tsjoDbtvdEO Yoyge9q4sKBDICTWDRLaWFGpWF36QEubVcmrUjo2xItAAIZuSEuJdALTLGwJRlAg64gI Z6UYA3SuPHmUqxEr7imcZH2YqiqosEeL9Dt9UZZ3BPfFfdaeaq7aLbylae0jHgPZ0RZE dSmAyoXnqa1xcfKifqDIgDw03iKlHB+HsShEvXwVSo0xV3tpo4HxBBuOkoQ0cCD2OeXF 8+EQ== X-Gm-Message-State: AOAM530B8h0k0zKcRiyVJDBXKLiaXlHPFzPBlp+5j4CluBsHZsRgYywA gal5erI9CFPnssqsmHNLWfFEGu54gXaL X-Google-Smtp-Source: ABdhPJzQ6JybhIuzyj9Vf8IfBD3VI2HM4N+WUmBYLe2GWGkzNCLZClXb9it47O//r2UyfOMQEnBEzQ== X-Received: by 2002:a05:6214:cad:: with SMTP id s13mr19464204qvs.53.1613984401811; Mon, 22 Feb 2021 01:00:01 -0800 (PST) Received: from presler.lan (a109-49-10-113.cpe.netcabo.pt. [109.49.10.113]) by smtp.gmail.com with ESMTPSA id q20sm12042416qke.26.2021.02.22.01.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Feb 2021 01:00:01 -0800 (PST) From: Rui Salvaterra To: openwrt-devel@lists.openwrt.org Subject: [PATCH v3 7/8] mvebu: fix the Turris Omnia device tree Date: Mon, 22 Feb 2021 08:59:36 +0000 Message-Id: <20210222085937.3195-8-rsalvaterra@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210222085937.3195-1-rsalvaterra@gmail.com> References: <20210222085937.3195-1-rsalvaterra@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210222_040003_859476_55168FB2 X-CRM114-Status: GOOD ( 24.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.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 [2607:f8b0:4864:20:0:0:0:f31 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 [rsalvaterra[at]gmail.com] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tmn505@gmail.com, freifunk@adrianschmutzler.de, Rui Salvaterra , nitroshift@yahoo.com, hauke@hauke-m.de Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Enable and fix hardware buffer management. Also fix the IRQ storm caused by a misconfiguration of the PCA9538 interrupt pin. Signed-off-by: Rui Salvaterra --- ...is-omnia-enable-HW-buffer-management.patch | 74 +++++++++++++++++++ ...omnia-fix-hardware-buffer-management.patch | 27 +++++++ ...ure-LED-2--INTn-pin-as-interrupt-pin.patch | 64 ++++++++++++++++ 3 files changed, 165 insertions(+) create mode 100644 target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch diff --git a/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch new file mode 100644 index 0000000000..7a4b511998 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/002-ARM-dts-turris-omnia-enable-HW-buffer-management.patch @@ -0,0 +1,74 @@ +From 018b88eee1a2efda26ed2f09aab33ccdc40ef18f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Beh=C3=BAn?= +Date: Sun, 15 Nov 2020 14:59:17 +0100 +Subject: ARM: dts: turris-omnia: enable HW buffer management +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The buffer manager is available on Turris Omnia but needs to be +described in device-tree to be used. + +Signed-off-by: Marek Behún +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: linux-arm-kernel@lists.infradead.org +Cc: Uwe Kleine-König +Cc: Jason Cooper +Cc: Gregory CLEMENT +Cc: Andreas Färber +Cc: Andrew Lunn +Cc: Rob Herring +Cc: devicetree@vger.kernel.org +Signed-off-by: Gregory CLEMENT +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +(limited to 'arch/arm/boot/dts/armada-385-turris-omnia.dts') + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -84,12 +84,23 @@ + }; + }; + ++&bm { ++ status = "okay"; ++}; ++ ++&bm_bppi { ++ status = "okay"; ++}; ++ + /* Connected to 88E6176 switch, port 6 */ + ð0 { + pinctrl-names = "default"; + pinctrl-0 = <&ge0_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <0>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -103,6 +114,9 @@ + pinctrl-0 = <&ge1_rgmii_pins>; + status = "okay"; + phy-mode = "rgmii"; ++ buffer-manager = <&bm>; ++ bm,pool-long = <1>; ++ bm,pool-short = <3>; + + fixed-link { + speed = <1000>; +@@ -115,6 +129,9 @@ + status = "okay"; + phy-mode = "sgmii"; + phy = <&phy1>; ++ buffer-manager = <&bm>; ++ bm,pool-long = <2>; ++ bm,pool-short = <3>; + }; + + &i2c0 { diff --git a/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch new file mode 100644 index 0000000000..2ebdc06f61 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/100-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch @@ -0,0 +1,27 @@ +From 9704292ed3230ee19dc4dd64f7484301b728ffb7 Mon Sep 17 00:00:00 2001 +From: Rui Salvaterra +Date: Wed, 17 Feb 2021 15:19:30 +0000 +Subject: [PATCH] ARM: dts: turris-omnia: fix hardware buffer management + +Hardware buffer management has never worked on the Turris Omnia, as the +required MBus window hadn't been reserved. Fix thusly. + +Fixes: 018b88eee1a2 ("ARM: dts: turris-omnia: enable HW buffer management") + +Signed-off-by: Rui Salvaterra +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -32,7 +32,8 @@ + ranges = ; ++ MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 ++ MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; + + internal-regs { + diff --git a/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch new file mode 100644 index 0000000000..c7509950e0 --- /dev/null +++ b/target/linux/mvebu/patches-5.10/101-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch @@ -0,0 +1,64 @@ +From: "Marek Behún" +To: Gregory CLEMENT +Cc: "Marek Behún" , Rui Salvaterra , "Uwe Kleine-König" , linux-arm-kernel@lists.infradead.org, Andrew Lunn , stable@vger.kernel.org +Subject: [PATCH mvebu-dt] ARM: dts: turris-omnia: configure LED[2]/INTn pin as interrupt pin +Date: Sun, 21 Feb 2021 00:11:44 +0100 +Message-Id: <20210220231144.32325-1-kabel@kernel.org> +X-Mailer: git-send-email 2.26.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Use the `marvell,reg-init` DT property to configure the LED[2]/INTn pin +of the Marvell 88E1514 ethernet PHY on Turris Omnia into interrupt mode. + +Without this the pin is by default in LED[2] mode, and the Marvell PHY +driver configures LED[2] into "On - Link, Blink - Activity" mode. + +This fixes the issue where the pca9538 GPIO/interrupt controller (which +can't mask interrupts in HW) received too many interrupts and after a +time started ignoring the interrupt with error message: + IRQ 71: nobody cared + +There is a work in progress to have the Marvell PHY driver support +parsing PHY LED nodes from OF and registering the LEDs as Linux LED +class devices. Once this is done the PHY driver can also automatically +set the pin into INTn mode if it does not find LED[2] in OF. + +Until then, though, we fix this via `marvell,reg-init` DT property. + +Signed-off-by: Marek Behún +Reported-by: Rui Salvaterra +Fixes: 26ca8b52d6e1 ("ARM: dts: add support for Turris Omnia") +Cc: Uwe Kleine-König +Cc: linux-arm-kernel@lists.infradead.org +Cc: Andrew Lunn +Cc: Gregory CLEMENT +Cc: + +--- + +This patch fixes bug introduced with the commit that added Turris +Omnia's DTS (26ca8b52d6e1), but will not apply cleanly because there is +commit 8ee4a5f4f40d which changed node name and node compatible +property and this commit did not go into stable. + +So either commit 8ee4a5f4f40d has also to go into stable before this, or +this patch has to be fixed a little in order to apply to 4.14+. + +Please let me know how should I handle this. + +--- + arch/arm/boot/dts/armada-385-turris-omnia.dts | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/boot/dts/armada-385-turris-omnia.dts ++++ b/arch/arm/boot/dts/armada-385-turris-omnia.dts +@@ -390,6 +390,7 @@ + phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; ++ marvell,reg-init = <3 18 0 0x4985>; + + /* irq is connected to &pcawan pin 7 */ + };