From patchwork Tue Feb 23 23:10:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rui Salvaterra X-Patchwork-Id: 1443670 X-Patchwork-Delegate: hauke@hauke-m.de 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=do2HrFBW; 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=fb1BV+Se; 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 4DlZcz6KdZz9sVF for ; Wed, 24 Feb 2021 10:14:27 +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: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:In-Reply-To:References:List-Owner; bh=HSvfGjsJnpOItGnaZk4NNKePt4zlqQioY0wyQO34tt0=; b=do2HrFBWeqtlRhU4Sr3wYXU80O 6MIIXxlEfIip3tAOEkw/DbaVtUp7gG/Y5IFGopLCWl0V5ABPVqFiJzpqQNNVosuS1qA3JriuHzWEW Fw31vWOu8J35dTWOiBz1RzZFeu6wNb4RZYoH3yjFVDM9xR0UqdINfErTnpWK2aD0plxmN+g+QxT5R oHcv5rDZhp7HQw5DUqV05Ohj/XvvVRjW6D/dzBUGNI7CJzGqQ2y4KD+AoEopHg59I4moMS6KjLOqs T764kTC6jfqZHYhtx5tCEViO+MmzPdcxWxUM4OxuZoQszM6WXTm0NxP5aM2wrzZLZZjahL0Zd2bhc Xeyh2cQw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEgpf-0001mV-Cc; Tue, 23 Feb 2021 23:11:07 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lEgpa-0001lx-GQ for openwrt-devel@lists.openwrt.org; Tue, 23 Feb 2021 23:11:04 +0000 Received: by mail-qt1-x829.google.com with SMTP id w6so142000qti.6 for ; Tue, 23 Feb 2021 15:10:59 -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:mime-version :content-transfer-encoding; bh=Ft01/ibXsaiQYI8liaXVNKna/mquz4keq5e8tI6IRtM=; b=fb1BV+SeJSaZ+psFARUm+z99Fz5TxZ7QiCrGjHu7bOidybiKwugaq+Y9xsCyrw3bY9 Fu9fAGkgQm79+ESsx9uCeVTJZvgSb2+xOOJ+nLkoKAPUP1xq1WITK3elmHxObhfI1X5g 5BzUX6t8k5NXiHbCn8FJK9e3VgwOLRWZ0uKJHVcA3oS/R+5IRlg6g9IPlMayP+oPdIIo Oh0jRFj2gxJ3fsvKKm5pZ5Uxsktbhi/o0X9N7x9DgX7ouyBNuacmZ3IouriyDLJY9Sex XLI5QlbSS9lRFngoEUwBS4FwkJ062a1wibx7/AnkruEsMGHKhEOrZApVUA2U0TtAqxXo aPvQ== 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:mime-version :content-transfer-encoding; bh=Ft01/ibXsaiQYI8liaXVNKna/mquz4keq5e8tI6IRtM=; b=SF0Vwv+tLR8kzFDXV30rNxSJwaF0eey6FrSZfNtSrr1czCuRE4ofy/Q7eaDlNUo6Hd pr+YJS9zjztgGX1ifhJxDoSrtu7/lbhUdyLo7VriNLMCY0HlZr4Eo/fYdjfDRzusgHju fLtsyKTTt1lCyZAyT4+G8Pzj3c30stoA6BGuwGEotkuDli7kukKuooxgDQKT2Z2uaS5v nhsbMJstD48PagH0rRaY5DSCaxBasIP5C/sebbLSgdA4QDAaWo6A/Dyuqt+y8x6nOCOi CnfLwfbjsXJzIrgsaIO7KezsszeWo4EndfS4LAr7208X6QoaRsYIUjDcS4iEPyc+R/8h hXEw== X-Gm-Message-State: AOAM533yLgvFKoauNUpmA7JAiOORT6xyFGYdhTUjJQn7AtQF4DUwyU/9 U34QC5fqybLlkx2F86UQ5s/Nw8NZDQ== X-Google-Smtp-Source: ABdhPJxDM3IJsZ27JC03vDW7xUn25jSzMW0orvuQaDp7/xLynr2hvGaxsX9a7PsRzt1B8rt+vwHZvw== X-Received: by 2002:aed:2c85:: with SMTP id g5mr2039518qtd.306.1614121858114; Tue, 23 Feb 2021 15:10:58 -0800 (PST) Received: from presler.lan (a109-49-10-113.cpe.netcabo.pt. [109.49.10.113]) by smtp.gmail.com with ESMTPSA id q6sm230215qkd.41.2021.02.23.15.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 15:10:57 -0800 (PST) From: Rui Salvaterra To: openwrt-devel@lists.openwrt.org Subject: [PATCH] mvebu/omnia: fix the device tree Date: Tue, 23 Feb 2021 23:10:52 +0000 Message-Id: <20210223231052.874019-1-rsalvaterra@gmail.com> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210223_181102_574151_D8AE5340 X-CRM114-Status: GOOD ( 25.20 ) 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:829 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [rsalvaterra[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 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: hauke@hauke-m.de, Rui Salvaterra Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Backport [1] and fix [2] hardware buffer management. Also fix the IRQ storm caused by a misconfiguration of the PCA9538 interrupt pin [3]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/arm/boot/dts/armada-385-turris-omnia.dts?id=018b88eee1a2efda26ed2f09aab33ccdc40ef18f [2] https://lore.kernel.org/linux-arm-kernel/20210217153038.1068170-1-rsalvaterra@gmail.com/ [3] https://lore.kernel.org/linux-arm-kernel/20210220231144.32325-1-kabel@kernel.org/ Signed-off-by: Rui Salvaterra --- This is against master/5.4, but it needs to be applied to the 21.02 branch too. As the stable kernel gets updated, it's expected patches 318 and 319 to become obsolete. ...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.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch create mode 100644 target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch diff --git a/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch b/target/linux/mvebu/patches-5.4/317-ARM-dts-turris-omnia-enable-HW-buffer-management.patch new file mode 100644 index 0000000000..7a4b511998 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/317-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.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch b/target/linux/mvebu/patches-5.4/318-ARM-dts-turris-omnia-fix-hardware-buffer-management.patch new file mode 100644 index 0000000000..a3f41fb5cb --- /dev/null +++ b/target/linux/mvebu/patches-5.4/318-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 +@@ -31,7 +31,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.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch b/target/linux/mvebu/patches-5.4/319-ARM-dts-turris-omnia-configure-LED-2--INTn-pin-as-interrupt-pin.patch new file mode 100644 index 0000000000..1fbbe8b506 --- /dev/null +++ b/target/linux/mvebu/patches-5.4/319-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 +@@ -254,6 +254,7 @@ + status = "okay"; + compatible = "ethernet-phy-id0141.0DD1", "ethernet-phy-ieee802.3-c22"; + reg = <1>; ++ marvell,reg-init = <3 18 0 0x4985>; + + /* irq is connected to &pcawan pin 7 */ + };