From patchwork Sun Jul 23 16:10:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jisheng Zhang X-Patchwork-Id: 13323291 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 284BD539F for ; Sun, 23 Jul 2023 16:22:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B70DC433C7; Sun, 23 Jul 2023 16:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690129359; bh=MaxTaoMyyDWzQBV6I+FK3rgck7sS3ApGLGnjzW2cn+c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tFSME35aBjT6vZDW9QtPvsJj3vL8Jw7DHgV+gZyPMXkzG4NSP4D+lrFRLSXwXtbL9 zdLu1VVnA4MommD+Zf4IYG8ybqdroqfL0UEeXaChihhkq5IOJrqF+dV09mhxRIkvIQ KADe5leCtMBc9JMgAoL/RJp4DMANuD+9UPpQsNRAhLwrFAak9Q9DbTi727MJs+zqu9 Agb90tdhpyPnoWI98JCyWYupXpOv3/Uht+kStuVUUCMOt0MOGDhpZsZoE8F0Yj9Fc7 fVJhKx/xsOhbU6PGnMwLcyIC11xZf7rILVaOT2WasdCXAMEMquADxvCRHhWlzSQOVP h8x5Nmhhp50hw== From: Jisheng Zhang To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 08/10] net: stmmac: platform: support parsing safety irqs from DT Date: Mon, 24 Jul 2023 00:10:27 +0800 Message-Id: <20230723161029.1345-9-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230723161029.1345-1-jszhang@kernel.org> References: <20230723161029.1345-1-jszhang@kernel.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The snps dwmac IP may support safety features, and those Safety Feature Correctible Error and Uncorrectible Error irqs may be separate irqs. Add support to parse the safety irqs from DT. Signed-off-by: Jisheng Zhang --- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 23d53ea04b24..e1b7a3fefd1a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -738,6 +738,18 @@ int stmmac_get_platform_resources(struct platform_device *pdev, dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); } + stmmac_res->sfty_ce_irq = platform_get_irq_byname_optional(pdev, "sfty_ce_irq"); + if (stmmac_res->sfty_ce_irq < 0) { + if (stmmac_res->sfty_ce_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + + stmmac_res->sfty_ue_irq = platform_get_irq_byname_optional(pdev, "sfty_ue_irq"); + if (stmmac_res->sfty_ue_irq < 0) { + if (stmmac_res->sfty_ue_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0); return PTR_ERR_OR_ZERO(stmmac_res->addr);