Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp598602rdb; Thu, 21 Dec 2023 21:46:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgSNsyF6YoXHffqj+oBKnqBTi85MuJwjkszuP2xogShA0f0t9lR416ngyv5cYX+UPEvCwq X-Received: by 2002:a17:902:e882:b0:1d2:ecd9:9088 with SMTP id w2-20020a170902e88200b001d2ecd99088mr559817plg.42.1703224018476; Thu, 21 Dec 2023 21:46:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703224018; cv=none; d=google.com; s=arc-20160816; b=whWFuLiD6nDsFGEsh5JpBqjdv2o+WpJPwpmjFsi4GfTjM6/uBUCoaC+b/WeVC4qj7Q v5+ggpbNKWfwelMQQR/QUG5n00vtqwyMJTFzhQ729kudaVlQUaTGDs3YdVXsF/4cDVNi wLssKtdvZyEKnPpGtqSJhkNkEHhlbS+EiS45MX4qaQSKzhrQjg0pu6J9UW7lzHp/R+ev xiNp0e9tA1EWXx4MnS+vwDIJf4K2pOedp3AxB91rxIzm7/SlrTClJmEJiqolP36yshcv v5USZf8qTyQfB04V0jiaGi2O3xC/AaQZKDJMrtKir3dhQtlILBmJqiXAdSTYj13bbc12 udeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=m5Q8tjORGLNX8W3q64YvuTQ9AR2LBeccZeTs6lGx6qU=; fh=jIY1HQBkctO5LjQPcp1JyYy68FbXwda6Gh4lXOHUJAc=; b=Qs4kAk9ZZsWHyfWLEeqyPoKoeJJE4FBcMxNZ9zDzumMxHESTbU+hcrZCItQ3Xnu/Hz +BHxKmdjwd8Sh1W59Yne1Qg30LWg6e+asilAdH5NgPGg1TKGxlUBXqWjopsjsNDLk3Wn WWdpsHaqFCjLSoX1zA9rmIxjB2yj9ZsxNZ6eUAcB74lN1c8rU+ekwUYDbl2+vuq3iljY IKiet8utKOt+n5A5PYTOOV8Lhk2N76cwZNg++vKxhyUqtdPVMCFKO6XVaaEykBa0Wy7i 6OKrXyjx65q1WhWY6Cm+uIQTg/YNr2si6n3qNZ9aIvHfIjaMvwzjl1lxrjKQVbTddwRw 55tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="cAOlTO/8"; spf=pass (google.com: domain of linux-kernel+bounces-9376-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b18-20020a170902d31200b001c62cfff799si2731374plc.176.2023.12.21.21.46.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:46:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9376-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="cAOlTO/8"; spf=pass (google.com: domain of linux-kernel+bounces-9376-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9376-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0C6AD2880F2 for ; Fri, 22 Dec 2023 05:46:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88814C2D4; Fri, 22 Dec 2023 05:46:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="cAOlTO/8" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 2F1F0C2DA; Fri, 22 Dec 2023 05:46:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703223974; x=1734759974; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n0Gp5OLNE//xWw9yHCmOFyQdR4GTfHiilxz7KaWheEQ=; b=cAOlTO/8dciY/z1ueaoEE8SsWoNawEMFqcAOz27rb3ddjPCl/bc4KgmI hkGpQn+1q/4RJXOvFTUDz/tjONiwjOtVH6IolsthEFX0tRxkNx2EE5dPf LTdCT6g45h9T+aSi+W6kobSlnY6mjFTdS31LOjFLi81mPlWMNmuyXhEPE xe2ec1m/dM509CxiEOkyqgo1SoMsxP+MeLBgymnea0JuRYxMxbrlIaOJ4 AXAxhG6nfP520msvlAzwl+TINTROLrFzb/9ntMa5FSbMW7/Cv7HFGz667 GgFFVwJGRqYl5n+ilXUPYtQSwwKfsjqAIp5xsMbtFm6CGBKTdYqXsZc8s w==; X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="9470574" X-IronPort-AV: E=Sophos;i="6.04,294,1695711600"; d="scan'208";a="9470574" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Dec 2023 21:46:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10931"; a="900324224" X-IronPort-AV: E=Sophos;i="6.04,294,1695711600"; d="scan'208";a="900324224" Received: from pg-esw-build.png.intel.com ([10.226.214.57]) by orsmga004.jf.intel.com with ESMTP; 21 Dec 2023 21:46:09 -0800 From: Leong Ching Swee To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, Swee Leong Ching , Teoh Ji Sheng Subject: [PATCH net-next v1 3/4] net: stmmac: Add support for TX/RX channel interrupt Date: Fri, 22 Dec 2023 13:44:50 +0800 Message-Id: <20231222054451.2683242-4-leong.ching.swee@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231222054451.2683242-1-leong.ching.swee@intel.com> References: <20231222054451.2683242-1-leong.ching.swee@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Swee Leong Ching Enable TX/RX channel interrupt registration for MAC that interrupts CPU through shared peripheral interrupt (SPI). Per channel interrupts and interrupt-names are registered through, Eg: 4 tx and 4 rx channels: interrupts = , , , ; ; ; ; ; interrupt-names = "dma_tx0", "dma_tx1", "dma_tx2", "dma_tx3", "dma_rx0", "dma_rx1", "dma_rx2", "dma_rx3"; Signed-off-by: Teoh Ji Sheng Signed-off-by: Swee Leong Ching --- .../ethernet/stmicro/stmmac/stmmac_platform.c | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 70eadc83ca68..f857907f13a0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -710,6 +710,8 @@ EXPORT_SYMBOL_GPL(devm_stmmac_probe_config_dt); int stmmac_get_platform_resources(struct platform_device *pdev, struct stmmac_resources *stmmac_res) { + char irq_name[8]; + int i; memset(stmmac_res, 0, sizeof(*stmmac_res)); /* Get IRQ information early to have an ability to ask for deferred @@ -719,6 +721,28 @@ int stmmac_get_platform_resources(struct platform_device *pdev, if (stmmac_res->irq < 0) return stmmac_res->irq; + /* For RX Channel */ + for (i = 0; i < MTL_MAX_RX_QUEUES; i++) { + snprintf(irq_name, sizeof(irq_name), "dma_rx%i", i); + stmmac_res->rx_irq[i] = platform_get_irq_byname_optional(pdev, irq_name); + if (stmmac_res->rx_irq[i] < 0) { + if (stmmac_res->rx_irq[i] == -EPROBE_DEFER) + return -EPROBE_DEFER; + break; + } + } + + /* For TX Channel */ + for (i = 0; i < MTL_MAX_TX_QUEUES; i++) { + snprintf(irq_name, sizeof(irq_name), "dma_tx%i", i); + stmmac_res->tx_irq[i] = platform_get_irq_byname_optional(pdev, irq_name); + if (stmmac_res->tx_irq[i] < 0) { + if (stmmac_res->rx_irq[i] == -EPROBE_DEFER) + return -EPROBE_DEFER; + break; + } + } + /* On some platforms e.g. SPEAr the wake up irq differs from the mac irq * The external wake up irq can be passed through the platform code * named as "eth_wake_irq" -- 2.34.1