From patchwork Tue Feb 27 18:54:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3030375dyb; Tue, 27 Feb 2024 15:42:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWniHypSViDi1z+IR8J62gVcxlMGMV+f4ePph6MSwq7+4GECkOiscf/H6Iu2ojljU2Iy9V4TGR1s5d0rf7zRU3jozjlVQ== X-Google-Smtp-Source: AGHT+IF0RmLcNauJaMRoViJX9QQtRTP+1zOYWBjKGQ5N+slTm4YRY7c57N3Wc+n0zUKJEnIJhHfW X-Received: by 2002:a17:906:1808:b0:a3e:9aa3:bbd1 with SMTP id v8-20020a170906180800b00a3e9aa3bbd1mr8108789eje.11.1709077342729; Tue, 27 Feb 2024 15:42:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709077342; cv=pass; d=google.com; s=arc-20160816; b=uOGvI7mSvAhXCIzfYoyUejIS2f2OwTy6eA+N30cWB4uO9IaJAGO9kuP6YFgcaltFQW QC6YVtn672eaQW7Ml4rp6m2iQ8mFjnX6sTF94KvyroNxKGeQnFmXZEam9WmTbsp/y7c6 NqkLO3fRZmTihTy5hk+Yhi0fmJ5XG/KUpC9hGJcdyWtuF5Q2xfLTBkKDQrzo7IUFbE2c 2Cu6rSM/2BbdlIv8+m190wPtnRJcrj6WQJoZgwtjqVdJz3tRQVAyfVeevftJujCM97ro IOANPG8qirJr+VZf1ODlV4FsuuIAuopRlFF59PA0B3WhIutMNbSesqed2gPfzq9sYTiD 4COQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HTxEJoHCY8MV3lRi7Xe4lpJ1SRIwUpDSwEsu7aJZG5A=; fh=13Lt05BdSTCgIEexJNZaoEQgNOy4mMRbylWlDhr/5Ug=; b=RTrBJ0CMD3onMOPiSv/JTax4Dxw17cPIWGll56YNUuTDfWKuAC2LRR/fsLBT/231IK jMTjBPAPy7btyOOLOByQgACq+W9EvGuW2gjzIQHQVJZbH+N/yUImvMrWjiVjAbG82jGK 6CZZTvUxMxUJ0Qo8kgwxATREoC0EXv1criZ2Wkd9LaeqsdS4WXcSbO/6Kj7xmqCQArKR 0tQco7cT4eGXU9otb37wglO2KE6DFa9Z339hyu01JSPqwqCIQSN7Nqk+2S5ItC2N0khf 0C3DAWc+42yW6V6qsDl9Ntf9misDw57/ZNi/vCsh1TEP2XezC7nhTKQ33obcDzixcW2p 3GJQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ENZhgSmn; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83866-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83866-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id r16-20020a170906c29000b00a3f17b3e98asi1155532ejz.870.2024.02.27.15.42.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:42:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83866-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ENZhgSmn; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83866-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83866-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7946C1F2CD4F for ; Tue, 27 Feb 2024 18:55:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 88C31149E0E; Tue, 27 Feb 2024 18:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ENZhgSmn" Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32A4E51C45 for ; Tue, 27 Feb 2024 18:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060103; cv=none; b=iZFuK2Wg8jHo8DwWQCEU50N6n2coYGSSDnF4+G1UEnV1nRtNSETuWZ84e2B2VtdJCEHVKUERVw15Gd/WKgzFWPP6mTgxgRxx/YLLdknL4X13ENCD0NStj9n9b+ExJsR274+DilO5XNs3hrzExX7mkNr4PaLJDC0dS599KTz8tOk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060103; c=relaxed/simple; bh=TpA76ag1YHp7m1LpSH6+0SPwwQrGfRObjpTDRFQPP5o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=cVOGZc4gBcF0acvfcbm3va5HAtBaxWfAxHyVKrcJJOsQ7XFq7KnNnxxkWVEDrFSYzAY6vWr9WbMP/O+WkYFd3nji8z450HEezM5COZMWvi0lZxvicDTRUhwXCHwM/Pfnrg94QKHiBM1E87Br3kJX8434pROY47FAdAfRKPHyW0U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=ENZhgSmn; arc=none smtp.client-ip=209.85.167.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-3c1b741aff8so34888b6e.3 for ; Tue, 27 Feb 2024 10:55:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060101; x=1709664901; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=HTxEJoHCY8MV3lRi7Xe4lpJ1SRIwUpDSwEsu7aJZG5A=; b=ENZhgSmnglASwdFHlcF3dIWOz12maQAOgCJG4OPsQRld8+8k8j7nh1H5dr285wWuoL lyNGiS/WmHeA5+WNjXjQZ9Z5ve97pUTTZp6iTJj106WuxDGjJ7BkSjcpMq6s+db3BdjB daFZXBkOqUVSg/y/6gu/5Ey3I0cT0ecj6cLPs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060101; x=1709664901; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HTxEJoHCY8MV3lRi7Xe4lpJ1SRIwUpDSwEsu7aJZG5A=; b=KWj+HGctf2TYUrtzuV91zxrGunOO5ZeIeRaP8XAhjCkJFblvAb5Q4XqgJST/D2Dnbd rwcgnYX5thqirKOZyZm5Uo5zynMl2R9Rwt7y9G7Z4MXZqbSEUfLysj+E8YqknPGvI32W 02bJpzB/raL6OZCNFPh64pcbeg5zkL5U34WUeWgQFzpkvFPMaMwqMk1Z0rkdmu6RnYeZ PW6+LrDSRDDkqI4Khn0qGeEWDPhEnuMZBB4odpaRFbDPniG4EIBAHQa9QQAF73pU0Zuz wFK/gcq4EXx8FCPBXcledEWIsKu7VfX9LlxrSS/R1XYuS6TawFa+l4thGmIvqVxxUapd WMEA== X-Forwarded-Encrypted: i=1; AJvYcCXDhyTiVWAhdx7SkrGUykNlWNi1PZt3ZUwEUwCgbKanc5o/kh+bxnyWGuecEeBRC2B7smnsEAhdYtWL0gfEsTWWb9VTJWHaBU0i3QHS X-Gm-Message-State: AOJu0YyuSVsBX3KzPsOxg8g95S1BSC0mIuDFUYcE/ADeEgVTvfvdsH2T EYx4BoN+Xqd8EdsIaPs7R4rl+dkrTR6BwmPphD6bPdrr2I22dtv5DDjWJ+eiSw== X-Received: by 2002:a05:6808:23d3:b0:3c1:b51c:ddca with SMTP id bq19-20020a05680823d300b003c1b51cddcamr1319387oib.46.1709060101243; Tue, 27 Feb 2024 10:55:01 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:00 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen , Krzysztof Kozlowski Subject: [PATCH net-next v2 1/6] dt-bindings: net: brcm,unimac-mdio: Add asp-v2.2 Date: Tue, 27 Feb 2024 10:54:49 -0800 Message-Id: <20240227185454.2767610-2-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792097483354697230 X-GMAIL-MSGID: 1792097483354697230 The ASP 2.2 Ethernet controller uses a brcm unimac. Signed-off-by: Justin Chen Acked-by: Krzysztof Kozlowski Acked-by: Florian Fainelli --- Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml b/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml index 6684810fcbf0..23dfe0838dca 100644 --- a/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml +++ b/Documentation/devicetree/bindings/net/brcm,unimac-mdio.yaml @@ -24,6 +24,7 @@ properties: - brcm,genet-mdio-v5 - brcm,asp-v2.0-mdio - brcm,asp-v2.1-mdio + - brcm,asp-v2.2-mdio - brcm,unimac-mdio reg: From patchwork Tue Feb 27 18:54:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2969271dyb; Tue, 27 Feb 2024 13:15:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlRd+sXnkBIBRMMwP5atekGf+MV3YKWVdsMjeO3zZz0Pv/D84xrQe6FZ1eaNlKkQYjktpnMKhEgSN89XZ4LVTpOsYCVQ== X-Google-Smtp-Source: AGHT+IHSHBfPdnQMnYSFK9cTFL/nNww83Jj0E6MuYwzXBnPxgnf2NZRKLq6dt5evjV4S9Jfeih5e X-Received: by 2002:a17:902:a987:b0:1dc:1c81:1b17 with SMTP id bh7-20020a170902a98700b001dc1c811b17mr8926160plb.55.1709068510838; Tue, 27 Feb 2024 13:15:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709068510; cv=pass; d=google.com; s=arc-20160816; b=PeKpI34Vq/xBcTqr+2tJArcm4HO0D+3FL5P+F5Nvis6Sp1sGBqI/gMDd3o9o3mQo4o iwfVvTkrhXMJhhMQBgT+V2ii2kplYEC+beLVPQsbvf89py12NkX3Wr2sjWYHU5woDO/5 /AqUB+OjH4w/thbKvi09L+C18t3NeL/32SupBY+URsTSH4yKPnNkvFoUgU1HTQ75LfSx SnR6negLpG0UgnCbpqjwzIqYTUaDaRTF+HE1SH/9jLpZjz3aikZmSFXajLGK4D9g30/o FXjp0xm4AyAdeZTsgE/UUi2rsfJanwZK5YkkZKenXmxe1EI2qtCexX6EZbG3LOtgPyZx XcXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cjKxJWWOM4cPJEe1AdfrK8sZmhRSTcDCHZicqxRtXfc=; fh=YThizaa1aO2ZAfG9k/WuFygapFs3iAjgLaofQ2Gf2wA=; b=NPL91iZZTHUeZHGzGVTLfHnermC4t48PO8tmsQ+5S97fyhVIsc9PD57nMp56/UZQRk yUzdO1lPa1rcTqNf89RRLgMeLe9kG0V5MFWGYu0K5R4tdzf7nvW5lrFHGRddJytjrGRz etHHrR6ePPQgYyu4OEjT5mIiLLemm0NFDZrJFBMKSbTJN10kahUeNTfsuHbIJAMZQ2r+ 1auDlZVEIfDn/XvyiGPmrMDXKz+WYjUPIbnxFqAOjUInU1eHx9Mz4AtVqmgJwunymOG+ czDHnQjLsij44Y/0MT+dwGTGhAokWhLcsnSX+ZIXzu2slb1l8qPhR07pHauOWB5FEQRd h6Fw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=IXPTrQZe; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83867-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83867-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p8-20020a170902e74800b001d99acc35b8si2034730plf.573.2024.02.27.13.15.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:15:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83867-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=IXPTrQZe; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83867-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83867-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 3F804B2839F for ; Tue, 27 Feb 2024 18:56:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C158214A4C6; Tue, 27 Feb 2024 18:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="IXPTrQZe" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73E435102A for ; Tue, 27 Feb 2024 18:55:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060104; cv=none; b=gh1PugKkyMBEzOGCulJGgzWIyJLDgutob2RwX3naNHCOBEgQcwH5x5L7aGnaAIuHWJ7kHMMXA8hwuQWojcMl+vpXrobL4bLqs8JOmaNhcbPGLiCaapusAh+M+ct86iDLJYX1H5ze5j+GSAldyIXWUagwFomv3/ZX+x9spTteMGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060104; c=relaxed/simple; bh=4Wu9VGol7LB0xjrRrqehGZS7IPRG/zGMKAyQTA7TFcY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=IB2hN06TnRffsrOuz4MHzn4f3BK45BeQnwd+a8yNx2o1GrbY2ynyXooD8nukWmPmApTROXF19eDq5pkKoPpwYT/ZCOwVQ0w8I2QfTlTOk5RfFA+4ToIKDEMv8jQ6ZrYje5sBgtT89ebgZB8/0/JqrmTGuk9M17bXoFgsxttJH8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=IXPTrQZe; arc=none smtp.client-ip=209.85.210.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-6e4f3cbb518so1710529b3a.3 for ; Tue, 27 Feb 2024 10:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060103; x=1709664903; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=cjKxJWWOM4cPJEe1AdfrK8sZmhRSTcDCHZicqxRtXfc=; b=IXPTrQZehsiCfQ7mdbZsMoa3Bp6TRYNAVjMeJlxGmIfQP8IPLOS93/A3xf82ZivAOP oo0EJIsXf3CSSwox+fbGPOjrI9YxZiZ09rqhQnGhHgA2MG17okx1WXrXWt8nWiWPtQLw exD0EK2NPPOSmSdgYlyXBJBQxCbyivgYHm3MY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060103; x=1709664903; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cjKxJWWOM4cPJEe1AdfrK8sZmhRSTcDCHZicqxRtXfc=; b=vSxBkPGGrvWX3qFrx1F7HrZ55aB1jrOSzwPSf2a1+LiQ7A8gQ53GFGblSRFhIf8Vko wnUQQl+hRXVJxvEEyAuOsEp8Tts/TZU8+RGdbDGjrpNfe3ciKt/XjIA62Qqfs08+i++5 kFdQqYvHp4X9RJpQetlH3IndLWvydjwZd/N9ReQ1wTLRyKifC5H1iAIKoZunuv8AORRj vxMzOieHvVA4wz4kbLh7VQrtUW9BSgbx+MxHNnTshEx5paqLorHMDuM/Iaer6X4cDGmt PIHGVmkqMYahSHQc7Q1r2uq3ULjNWF2zUglAyngbzaPKtOzRemP791wNcooFUL9wBi2r u9DA== X-Forwarded-Encrypted: i=1; AJvYcCWSUeDPPwaTHwPMM0JHUZEuL+/TKDPE0/XwiOu39D0gQstO0+1amFVrUSUFMuVznREVU+ggC3knDFl+RE0zLCwVsSVPY/23YLY0+PGH X-Gm-Message-State: AOJu0YzuFraj68M9uMOB3HgB+dBUqEyj+NnliR7gTGv8PziKc3howScM gEsisGbaw2mJaijUFmjmXdqeCLSUnQ++xME1IZkpKV47L5fWLeK7bBfafZQwoA== X-Received: by 2002:a05:6a00:1ac7:b0:6e4:fc2b:62d5 with SMTP id f7-20020a056a001ac700b006e4fc2b62d5mr9771626pfv.0.1709060102689; Tue, 27 Feb 2024 10:55:02 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:02 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen Subject: [PATCH net-next v2 2/6] dt-bindings: net: brcm,asp-v2.0: Add asp-v2.2 Date: Tue, 27 Feb 2024 10:54:50 -0800 Message-Id: <20240227185454.2767610-3-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792088223073196517 X-GMAIL-MSGID: 1792088223073196517 Add support for ASP 2.2. Signed-off-by: Justin Chen Acked-by: Florian Fainelli Acked-by: Krzysztof Kozlowski --- v2 - Change brcm,bcm74165-asp to brcm,bcm74165b0-asp Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml b/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml index 75d8138298fb..660e2ca42daf 100644 --- a/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml +++ b/Documentation/devicetree/bindings/net/brcm,asp-v2.0.yaml @@ -15,6 +15,10 @@ description: Broadcom Ethernet controller first introduced with 72165 properties: compatible: oneOf: + - items: + - enum: + - brcm,bcm74165b0-asp + - const: brcm,asp-v2.2 - items: - enum: - brcm,bcm74165-asp From patchwork Tue Feb 27 18:54:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207381 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2901409dyb; Tue, 27 Feb 2024 10:57:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWIHKwsaaQmZNKfV0O3kMDSDck8L0pTWVaaSXppLkgJ+dv/l35DNAl0ym2Ndl7t836JQXDzUm8mbdxe5BwSXPtHlQcEcA== X-Google-Smtp-Source: AGHT+IHqKHCNpyMXWx2d1D0+bcKskKau+vAmr8m9KDlGkRrABaZqxNe7dYidXeCsA6fU0wSlq5so X-Received: by 2002:a0c:da07:0:b0:68f:3dbd:466c with SMTP id x7-20020a0cda07000000b0068f3dbd466cmr348514qvj.22.1709060263964; Tue, 27 Feb 2024 10:57:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709060263; cv=pass; d=google.com; s=arc-20160816; b=L+FOorCTCWaQuvhwpwxHTeFn4VlCRW/DXANnX1WVWXy2QxuHDgtPpgCBYXp8HMKaX8 p3wEcYVOZeKBUSZUovqcMGUE3BCBulYhlN/SD4ZbsURJbPy8okmoi1zagdvNsnBVR1qr rddPkN9+hkJp5Vvx02WFNKSTwsU8iRBWNk3R8DdT8xkRAMz9Xt+8RNCDIz4+/YRpZPIu jO8afDZvQE+WAuaIImytF7R4BDMljklV/8e82VD/2kEd3F+XkrdiJsEraWGGsV88FTFj i+6yItnLraZ5AVp6UN6WfiATd8Rs9uXgn0FhIGmgnoQP26y6lr7dAJCUWByJTzY5ilmO WUjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KW/o7P4UxXwfiWyAIcidVjeM4feNg2QR2SSijY6gl9Y=; fh=qb4w0PmZQ5BRj88vljUTGBnx8ITryUgUlrN2nGbYnWk=; b=qb9LbkGeOrAF72mxRwCCRwTi76fY3zH6lFf2A3lGxWVMvV5G8SbWlqWmh+VIFlrZsN JBmCkqb2vpt4OwKb/oYNoHtbD/3XB7a6O0WWVP1pOQjPmr2cTvksM6dQhEEMbSISCtIM XBgyFQooBxfviaFe4IwiSnyyLpWwqDXeIvopbDTN9Z8t3qgnTrzjyaPyrTytcbtzxolz d40z7BaumMKDC2FwRZkBuaH73Fs7ODBg+YiNN5raL2F1EL/ZyJbrcOzCCbJONfS0wf6q Kl4ExQ+1XjW7NRiuhMvKzLhFvN4p61SkKkZ2qgwttglZSBEiOanpO9kLXCnzMuEuBGCx gi1A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cEOKuUzZ; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83868-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83868-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fv2-20020a056214240200b006900690c1bbsi6039835qvb.237.2024.02.27.10.57.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:57:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83868-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=cEOKuUzZ; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83868-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83868-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2B1991C23E12 for ; Tue, 27 Feb 2024 18:56:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 73FCA14DFCA; Tue, 27 Feb 2024 18:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="cEOKuUzZ" Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C5EB148FE9 for ; Tue, 27 Feb 2024 18:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060107; cv=none; b=TnLAFVy15hiVi61rneH9tLRFTlrtAYqNukveAdw5/9Wcs+cm80Nl/UTJJfQp/QSROYqvKcf27UFoZlgCqFo2sYh6AImtDHg9RhZhR8Rqz9tQj2KvAUuG1mvmpnhR0W+Sw8MvMVHpgfW8u/JAKFN6dELuXajU66Pw/ziOl82r8Pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060107; c=relaxed/simple; bh=DWx6uct97I9u1K1yr+ls7sUh8jOEQ24/b1SFyF8pTMk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=G3hN0JElVgLTjqzfTYHHhlMU48ys8ayRCUvvSr5cHyJWCSN3FTncqEwcHf4dF7z0OCnp96KIu5Wk7h+zLU/bw1oBG+NIcO7p/TiEJ1X9SAPQk8DvZE5o20e878HyrOR6oX6Vn7fU4WNI7fn/k7gYMBSKYrUFL7azfo+Om5BQN1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=cEOKuUzZ; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e544f927d4so75018b3a.0 for ; Tue, 27 Feb 2024 10:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060105; x=1709664905; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=KW/o7P4UxXwfiWyAIcidVjeM4feNg2QR2SSijY6gl9Y=; b=cEOKuUzZzS6VRncBftiGJVBqgdXW0MtU+ntZKFNTF4kZqdwXJWjtTo/l9H1TsfSVcO 8wZKOAwaCNE7wKKJ33tJuJ9Z+x1ccD3WvLkN7nZnRJ47vkQC77DDGq6plz7xNSFDHUL/ 2IQ9mYcE4gPEvHTFOgdmI21zXf86N+NI4IWak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060105; x=1709664905; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KW/o7P4UxXwfiWyAIcidVjeM4feNg2QR2SSijY6gl9Y=; b=htt1jbEg/z9hD7QVnDd9rFxnINCvvIVYxnr8yxIIuU4zw3Z9BNPaz0wJMakctRVVB/ U2Q4UIoVJ0kZQw353A+3TpZNflGA8chBVjllW/pJishOia+dvqOQxmv9kdYuVdnD14WD kOgs/genZVGQXiqtupGJxyis+PCoEk3D+UpuU+p7P6h4xLYBuSRoB+JO6PoVPkiZ75j9 6ZrJKvpDQHUEq82y6naDG+dV6MSbOWR2RGd66ugeiDli2svSBmfT0RZn7B9rHITnahUZ d4HN5IKSVQ5ZD7sNN/OFK7knah4FQ9DyUQS4rjmmtfWsJkW53MLjWFQ8H4Q8IpL78JmF om6Q== X-Forwarded-Encrypted: i=1; AJvYcCW4hmjHGUvJvSFsnEoqd1e08dfCA6krPe5MUldDmC4kgOAQ/9MKTfKhHTzs6V8EyhqcocrBapBo+2WJyiyZstJWLkSh7x6EulSQ4qXR X-Gm-Message-State: AOJu0YzJM/G/DIiiBzZczhR8lNV+0F8FQqPig5gDEc8RIv3mnlAwEqIV yAomN2k/wz1PN2FiTT7fSrzgKf32QDQ2MI+Ul9IIvXUp+Ffv794ueL5ubdqQTQ== X-Received: by 2002:a05:6a00:2d21:b0:6e4:c102:8065 with SMTP id fa33-20020a056a002d2100b006e4c1028065mr305423pfb.5.1709060104410; Tue, 27 Feb 2024 10:55:04 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:03 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen Subject: [PATCH net-next v2 3/6] net: bcmasp: Add support for ASP 2.2 Date: Tue, 27 Feb 2024 10:54:51 -0800 Message-Id: <20240227185454.2767610-4-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792079575840184755 X-GMAIL-MSGID: 1792079575840184755 ASP 2.2 improves power savings during low power modes. A new register was added to toggle to a slower clock during low power modes. EEE was broken for ASP 2.0/2.1. A HW workaround was added for ASP 2.2 that requires toggling a chicken bit. Signed-off-by: Justin Chen Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 73 +++++++++++++++++-- drivers/net/ethernet/broadcom/asp2/bcmasp.h | 18 ++++- .../net/ethernet/broadcom/asp2/bcmasp_intf.c | 6 ++ 3 files changed, 87 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index 80245c65cc90..100c69f3307a 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -972,7 +972,26 @@ static void bcmasp_core_init(struct bcmasp_priv *priv) ASP_INTR2_CLEAR); } -static void bcmasp_core_clock_select(struct bcmasp_priv *priv, bool slow) +static void bcmasp_core_clock_select_many(struct bcmasp_priv *priv, bool slow) +{ + u32 reg; + + reg = ctrl2_core_rl(priv, ASP_CTRL2_CORE_CLOCK_SELECT); + if (slow) + reg &= ~ASP_CTRL2_CORE_CLOCK_SELECT_MAIN; + else + reg |= ASP_CTRL2_CORE_CLOCK_SELECT_MAIN; + ctrl2_core_wl(priv, reg, ASP_CTRL2_CORE_CLOCK_SELECT); + + reg = ctrl2_core_rl(priv, ASP_CTRL2_CPU_CLOCK_SELECT); + if (slow) + reg &= ~ASP_CTRL2_CPU_CLOCK_SELECT_MAIN; + else + reg |= ASP_CTRL2_CPU_CLOCK_SELECT_MAIN; + ctrl2_core_wl(priv, reg, ASP_CTRL2_CPU_CLOCK_SELECT); +} + +static void bcmasp_core_clock_select_one(struct bcmasp_priv *priv, bool slow) { u32 reg; @@ -1166,6 +1185,24 @@ static void bcmasp_wol_irq_destroy_per_intf(struct bcmasp_priv *priv) } } +static void bcmasp_eee_fixup(struct bcmasp_intf *intf, bool en) +{ + u32 reg, phy_lpi_overwrite; + + reg = rx_edpkt_core_rl(intf->parent, ASP_EDPKT_SPARE_REG); + phy_lpi_overwrite = intf->internal_phy ? ASP_EDPKT_SPARE_REG_EPHY_LPI : + ASP_EDPKT_SPARE_REG_GPHY_LPI; + + if (en) + reg |= phy_lpi_overwrite; + else + reg &= ~phy_lpi_overwrite; + + rx_edpkt_core_wl(intf->parent, reg, ASP_EDPKT_SPARE_REG); + + usleep_range(50, 100); +} + static struct bcmasp_hw_info v20_hw_info = { .rx_ctrl_flush = ASP_RX_CTRL_FLUSH, .umac2fb = UMAC2FB_OFFSET, @@ -1178,6 +1215,7 @@ static const struct bcmasp_plat_data v20_plat_data = { .init_wol = bcmasp_init_wol_per_intf, .enable_wol = bcmasp_enable_wol_per_intf, .destroy_wol = bcmasp_wol_irq_destroy_per_intf, + .core_clock_select = bcmasp_core_clock_select_one, .hw_info = &v20_hw_info, }; @@ -1194,17 +1232,39 @@ static const struct bcmasp_plat_data v21_plat_data = { .init_wol = bcmasp_init_wol_shared, .enable_wol = bcmasp_enable_wol_shared, .destroy_wol = bcmasp_wol_irq_destroy_shared, + .core_clock_select = bcmasp_core_clock_select_one, .hw_info = &v21_hw_info, }; +static const struct bcmasp_plat_data v22_plat_data = { + .init_wol = bcmasp_init_wol_shared, + .enable_wol = bcmasp_enable_wol_shared, + .destroy_wol = bcmasp_wol_irq_destroy_shared, + .core_clock_select = bcmasp_core_clock_select_many, + .hw_info = &v21_hw_info, + .eee_fixup = bcmasp_eee_fixup, +}; + +static void bcmasp_set_pdata(struct bcmasp_priv *priv, const struct bcmasp_plat_data *pdata) +{ + priv->init_wol = pdata->init_wol; + priv->enable_wol = pdata->enable_wol; + priv->destroy_wol = pdata->destroy_wol; + priv->core_clock_select = pdata->core_clock_select; + priv->eee_fixup = pdata->eee_fixup; + priv->hw_info = pdata->hw_info; +} + static const struct of_device_id bcmasp_of_match[] = { { .compatible = "brcm,asp-v2.0", .data = &v20_plat_data }, { .compatible = "brcm,asp-v2.1", .data = &v21_plat_data }, + { .compatible = "brcm,asp-v2.2", .data = &v22_plat_data }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, bcmasp_of_match); static const struct of_device_id bcmasp_mdio_of_match[] = { + { .compatible = "brcm,asp-v2.2-mdio", }, { .compatible = "brcm,asp-v2.1-mdio", }, { .compatible = "brcm,asp-v2.0-mdio", }, { /* sentinel */ }, @@ -1265,16 +1325,13 @@ static int bcmasp_probe(struct platform_device *pdev) if (!pdata) return dev_err_probe(dev, -EINVAL, "unable to find platform data\n"); - priv->init_wol = pdata->init_wol; - priv->enable_wol = pdata->enable_wol; - priv->destroy_wol = pdata->destroy_wol; - priv->hw_info = pdata->hw_info; + bcmasp_set_pdata(priv, pdata); /* Enable all clocks to ensure successful probing */ bcmasp_core_clock_set(priv, ASP_CTRL_CLOCK_CTRL_ASP_ALL_DISABLE, 0); /* Switch to the main clock */ - bcmasp_core_clock_select(priv, false); + priv->core_clock_select(priv, false); bcmasp_intr2_mask_set_all(priv); bcmasp_intr2_clear_all(priv); @@ -1381,7 +1438,7 @@ static int __maybe_unused bcmasp_suspend(struct device *d) */ bcmasp_core_clock_set(priv, 0, ASP_CTRL_CLOCK_CTRL_ASP_TX_DISABLE); - bcmasp_core_clock_select(priv, true); + priv->core_clock_select(priv, true); clk_disable_unprepare(priv->clk); @@ -1399,7 +1456,7 @@ static int __maybe_unused bcmasp_resume(struct device *d) return ret; /* Switch to the main clock domain */ - bcmasp_core_clock_select(priv, false); + priv->core_clock_select(priv, false); /* Re-enable all clocks for re-initialization */ bcmasp_core_clock_set(priv, ASP_CTRL_CLOCK_CTRL_ASP_ALL_DISABLE, 0); diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h b/drivers/net/ethernet/broadcom/asp2/bcmasp.h index 312bf9b6576e..61598dc070b1 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h @@ -33,6 +33,12 @@ #define ASP_WAKEUP_INTR2_FILT_1 BIT(3) #define ASP_WAKEUP_INTR2_FW BIT(4) +#define ASP_CTRL2_OFFSET 0x2000 +#define ASP_CTRL2_CORE_CLOCK_SELECT 0x0 +#define ASP_CTRL2_CORE_CLOCK_SELECT_MAIN BIT(0) +#define ASP_CTRL2_CPU_CLOCK_SELECT 0x4 +#define ASP_CTRL2_CPU_CLOCK_SELECT_MAIN BIT(0) + #define ASP_TX_ANALYTICS_OFFSET 0x4c000 #define ASP_TX_ANALYTICS_CTRL 0x0 @@ -134,8 +140,11 @@ enum asp_rx_net_filter_block { #define ASP_EDPKT_RX_PKT_CNT 0x138 #define ASP_EDPKT_HDR_EXTR_CNT 0x13c #define ASP_EDPKT_HDR_OUT_CNT 0x140 +#define ASP_EDPKT_SPARE_REG 0x174 +#define ASP_EDPKT_SPARE_REG_EPHY_LPI BIT(4) +#define ASP_EDPKT_SPARE_REG_GPHY_LPI BIT(3) -#define ASP_CTRL 0x101000 +#define ASP_CTRL_OFFSET 0x101000 #define ASP_CTRL_ASP_SW_INIT 0x04 #define ASP_CTRL_ASP_SW_INIT_ACPUSS_CORE BIT(0) #define ASP_CTRL_ASP_SW_INIT_ASP_TX BIT(1) @@ -372,6 +381,8 @@ struct bcmasp_plat_data { void (*init_wol)(struct bcmasp_priv *priv); void (*enable_wol)(struct bcmasp_intf *intf, bool en); void (*destroy_wol)(struct bcmasp_priv *priv); + void (*core_clock_select)(struct bcmasp_priv *priv, bool slow); + void (*eee_fixup)(struct bcmasp_intf *priv, bool en); struct bcmasp_hw_info *hw_info; }; @@ -390,6 +401,8 @@ struct bcmasp_priv { void (*init_wol)(struct bcmasp_priv *priv); void (*enable_wol)(struct bcmasp_intf *intf, bool en); void (*destroy_wol)(struct bcmasp_priv *priv); + void (*core_clock_select)(struct bcmasp_priv *priv, bool slow); + void (*eee_fixup)(struct bcmasp_intf *intf, bool en); void __iomem *base; struct bcmasp_hw_info *hw_info; @@ -530,7 +543,8 @@ BCMASP_CORE_IO_MACRO(rx_analytics, ASP_RX_ANALYTICS_OFFSET); BCMASP_CORE_IO_MACRO(rx_ctrl, ASP_RX_CTRL_OFFSET); BCMASP_CORE_IO_MACRO(rx_filter, ASP_RX_FILTER_OFFSET); BCMASP_CORE_IO_MACRO(rx_edpkt, ASP_EDPKT_OFFSET); -BCMASP_CORE_IO_MACRO(ctrl, ASP_CTRL); +BCMASP_CORE_IO_MACRO(ctrl, ASP_CTRL_OFFSET); +BCMASP_CORE_IO_MACRO(ctrl2, ASP_CTRL2_OFFSET); struct bcmasp_intf *bcmasp_interface_create(struct bcmasp_priv *priv, struct device_node *ndev_dn, int i); diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index e429876c7291..36e6fae937ea 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -1333,6 +1333,9 @@ static void bcmasp_suspend_to_wol(struct bcmasp_intf *intf) ASP_WAKEUP_INTR2_MASK_CLEAR); } + if (intf->eee.eee_enabled && intf->parent->eee_fixup) + intf->parent->eee_fixup(intf, true); + netif_dbg(intf, wol, ndev, "entered WOL mode\n"); } @@ -1381,6 +1384,9 @@ static void bcmasp_resume_from_wol(struct bcmasp_intf *intf) { u32 reg; + if (intf->eee.eee_enabled && intf->parent->eee_fixup) + intf->parent->eee_fixup(intf, false); + reg = umac_rl(intf, UMC_MPD_CTRL); reg &= ~UMC_MPD_CTRL_MPD_EN; umac_wl(intf, reg, UMC_MPD_CTRL); From patchwork Tue Feb 27 18:54:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3033407dyb; Tue, 27 Feb 2024 15:50:18 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVlGrMJVUnBrmyz4lvMk8tK3wPIqV6TWyXBiI3ofw28cgXRkcrpUMuYMnlxViTTaG0S7qrO6T5tE5sMLXiQW64zyMsQ+Q== X-Google-Smtp-Source: AGHT+IFWUNpmPWZ8Zt8qoAjO+INzjV8f+K0w/MJKTp1svqzR+ah0m9O9HatUbx5GayhzWuGizu+x X-Received: by 2002:a05:6830:1089:b0:6e1:d90:c429 with SMTP id y9-20020a056830108900b006e10d90c429mr10570158oto.7.1709077818091; Tue, 27 Feb 2024 15:50:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709077818; cv=pass; d=google.com; s=arc-20160816; b=Xqq9H2//yXwc3m4p+SmzBon4Sg8hItrxuwj5o4dOSwb8OqiDTZ0/hTzBSmcKeBJCtF Oa5h9Fx6UyU3fPnKtmgBYJ56DfYGNqKFyV2w9ZanSzfSePYc0HfBtEYTipbOddkmayGW S4oaW1TTO9W0UBqXRUW+Abdeap7ae6ttu04je/hJELF4D/k1ZhrgW3JidIMCfOvNb/9d bgyVWJrloEFSW/26oKYNQlAKujbUzh3veEX1vubhZgvVfEOleMUD1JDPV4qBOsAQGsnQ e+neM/z0EGRkqQPlK2FkIIzq/mNy1vPdbe8Vuj1USgOg9RIjYmsF74VfDCjdTHOCjmWn rIZg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LqDEQb3isvkYCmw+YyaGzO1Wdj7vqUcI3EjZlXrt8N4=; fh=/A2mTzsIzXozIJTF6sVyjo6e5cCQSvubKPFWpAorp+8=; b=Yhl37qT2obias8Dw+AyL6lyT/xn6Z6oN1kPg+0PNQFKSwc5W95HFB4Wcj8pgSMlBM8 m24gAtVGjrRlExgmLgmDZYfsUTcQPj0wftTGMfESrJLU2Nwkul5giMhndpwXrXmYe2nV 75RhP3QJRWzAUVimcrob3O989h7z3Qw8oGhuQqfJ/Iz+/wfVJ0IBv7W99qu+QVH6BfUz AgRAFVTHf0CLimV7DDFLRoK8wyJJtJP48szkQSpTn3KETVdKIs7x6OY421PGIG2mW8gT eRtHfeDOO2Rys+y+hyuBKeKceTEUkO41LxpKj8ksmxE2sYfCsBMzDq2vFwJ3Vxo9cHjI 6n6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=gEYj0xio; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83869-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83869-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id u11-20020a63470b000000b005e428bf5de1si6232242pga.749.2024.02.27.15.50.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 15:50:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83869-ouuuleilei=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=@broadcom.com header.s=google header.b=gEYj0xio; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83869-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83869-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 937A828C115 for ; Tue, 27 Feb 2024 18:57:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E357A149DE2; Tue, 27 Feb 2024 18:55:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="gEYj0xio" Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1E17149E15 for ; Tue, 27 Feb 2024 18:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060110; cv=none; b=Nh6i17J6PxRUDDCnH4LLhxA4s52qxc95fAewTzGVKWvK7YNL8A4vDDVYhzv8Blf7oS08/Jn0EkpHtM1MsY/c9fsNArSdzeYo/bDDdGDw/4Hvk05RDGPCng+fTTTRPtGGfWAXMSVca9KKIoBnipxNIcQUJQ6ED5FSdZnPaEw4LYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060110; c=relaxed/simple; bh=PEVnFskS6yLQcaycAJVWtKkRjlbKL8pQFKB5iTKEjdE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=hqDGCN0kvhMA/YZ1C4XnjxJGuM4+zngoMjYq/mRWm4t+PB2xQdQuTn6xPV37ROn5KxpevfWqfM+yJ7NUsg50PvDa9kTi0i74w0QYq8OQpEidlTSL5Avc+8WjhZAhZV+RqTdTiRRPr91sKrw53uvzjIYBmYol2C27ANE2b/bu4FQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=gEYj0xio; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-6e480cd18b2so1690410a34.3 for ; Tue, 27 Feb 2024 10:55:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060107; x=1709664907; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=LqDEQb3isvkYCmw+YyaGzO1Wdj7vqUcI3EjZlXrt8N4=; b=gEYj0xioM8Lgwdq0zviyPTMpT5tFbQrfYIlqY1UlUyDDZvTHmueGaJghvOHhaU+59o hQGLOXK9ZyKhd7t33G3ygonGfiM+ElfBcfvZRRRWwJY6C5x3/y6/QSFuzXcdBd8t5jzR p/2OEblC2ky0TAOfYtYr7e36JJd3FiOzKBQJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060107; x=1709664907; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LqDEQb3isvkYCmw+YyaGzO1Wdj7vqUcI3EjZlXrt8N4=; b=SFfvIOZcWwtgm9HF/rfm5OatpZTH+m1XvYImP+Wwpzy/jiLxfeIczIdt1fG3yueY/x 5ToryNJ3X1pQmGg+xvUzFUaRgYw+1quT6nqxhOi8uOla292Z+mOpwkROfZMrOLnX0LWX 2hBfKrSDhRkcXHqUP+b6/gLTWPKbWvW+Nc9FcwhSREijdB8h0YRy/4KU/UkukbYe3SZB gLDJKEyEXdgea3Fz5gmFkK9ql+nQeI5MjGqKefq/bhWVEztbZkd+doRqaajs0tknPyCK NWVcpJ46qe1L8V/ZT7YK0TGrfSr7HSUa0LLXaBuNlOCFaR+3n6zKIeg8nwcOmhC1OukF JwoA== X-Forwarded-Encrypted: i=1; AJvYcCV0QidtC9RvOCOrKPVRbBp30+fSUdZIYiwT/dxT6hDznXIgsnd1HN9ASCXkk5EtnPqbfbQQkHXEQBoI7rYC9vUbDZ3CFFeOJxHcsPZV X-Gm-Message-State: AOJu0YyZUQJhZaH+8fmn7zFaAqVSx6iWvm3pI4P+zhixnplP9xIuYt0a Pf9KfJfYn4QxjCkSxXwnC8mRAmQ2GIOUrnKTZLTnSc8brFqs73aYU4zyrp29JQ== X-Received: by 2002:a9d:7dd6:0:b0:6e4:253f:c551 with SMTP id k22-20020a9d7dd6000000b006e4253fc551mr9813304otn.29.1709060106765; Tue, 27 Feb 2024 10:55:06 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:05 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen Subject: [PATCH net-next v2 4/6] net: phy: mdio-bcm-unimac: Add asp v2.2 support Date: Tue, 27 Feb 2024 10:54:52 -0800 Message-Id: <20240227185454.2767610-5-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792097982377677687 X-GMAIL-MSGID: 1792097982377677687 Add mdio compat string for ASP 2.0 ethernet driver. Signed-off-by: Justin Chen Acked-by: Florian Fainelli --- drivers/net/mdio/mdio-bcm-unimac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/mdio/mdio-bcm-unimac.c b/drivers/net/mdio/mdio-bcm-unimac.c index 6fe08427fdd4..f40eb50bb978 100644 --- a/drivers/net/mdio/mdio-bcm-unimac.c +++ b/drivers/net/mdio/mdio-bcm-unimac.c @@ -334,6 +334,7 @@ static SIMPLE_DEV_PM_OPS(unimac_mdio_pm_ops, NULL, unimac_mdio_resume); static const struct of_device_id unimac_mdio_ids[] = { + { .compatible = "brcm,asp-v2.2-mdio", }, { .compatible = "brcm,asp-v2.1-mdio", }, { .compatible = "brcm,asp-v2.0-mdio", }, { .compatible = "brcm,genet-mdio-v5", }, From patchwork Tue Feb 27 18:54:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207449 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2976821dyb; Tue, 27 Feb 2024 13:31:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcFw/6s6c3mAGOpsgjYbmRqN8jq7A1zudQNmcyo9UafxXDGi+MUVHU7t8rAebc6aV9XlNqj2tYOvVc/7AhQabTVf6jSg== X-Google-Smtp-Source: AGHT+IEXWwoFfTmIXiKk403zKt5aGTZl/azoYntXHHYFr+F0yaxPrwt1EO20/0wdaGvmOSPYHgEG X-Received: by 2002:a05:6402:28f:b0:566:5cd2:873 with SMTP id l15-20020a056402028f00b005665cd20873mr502512edv.4.1709069517215; Tue, 27 Feb 2024 13:31:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709069517; cv=pass; d=google.com; s=arc-20160816; b=eCYWW6rwIRX0yjUtIwyygsHgl9+2UREvZbSdjI5WEIXHK8hmYaaIHlcyRShuAgExcr XKShq0sPJg+dyBNGJW8/FCnlYmxdkjeC7dTKAee3HMhL7nCgrErx9KpGdgvxlVRcaNNo BxLkrjbeMqkpIroq19HL0pCsng3RylNoXdXjIlJGY3X1+ZPFQIGmMsNK8imVlXlZqolH Ywh/N4S7gbeRAM/RCYtvpMjNTbOunAEF53D3ikuI4KQUp+1e/HNJfOea/kf3fiK39xsI jcYgWswScm1k0UOV+pyyPMZNFtcuByeM2szThMjrGoS2HBu2IuEgvWzynYij0shvYNQQ XZ+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a7yi9PMIjR/8xd4Ghl9unLQW/peChPw21p3aXua0c4g=; fh=bCsTXt9CTbvynIZxD8nj+AF/4cYU+BiMEVRA695a7gI=; b=QIjTv6G8lCiF23FFN5eLkXIBRw/8pV+SBVth7omDS9cEjTuDLcJIVOMs8UoQboc9Kc x9xsSBx6wvaZgNnXW3YUOU/Is59gsQaDdVvcdctblRCwkxyc9nBxHbZK9CgNC0YJEAOj caz6icNQUyTucUbJDTFqR1eHgaMmKaHWxphtIuGwhkTgdAbFChw2e9eZ/pAPeVOITvur QwJ88KLfjkjl2iWIwS2D4fi8gPXc7FHdxbAlI66BYlGkI2coS5mT1wVqHwNjv9df5E0k F0T/tcXtBbeFkwtjOCGpcbKqRc4OoO5uynI2baDDh6R96iqQomC3+cKfD8TPYcu6Ve0I VWpw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ccHj7NXg; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83870-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83870-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s11-20020a50d48b000000b00565bc93ae7esi1044554edi.295.2024.02.27.13.31.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 13:31:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83870-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ccHj7NXg; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83870-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83870-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 833A91F2DDED for ; Tue, 27 Feb 2024 18:57:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5695614EFF5; Tue, 27 Feb 2024 18:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ccHj7NXg" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37D4414A4E0 for ; Tue, 27 Feb 2024 18:55:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060111; cv=none; b=muLlwCfnoyAu1HmBoPnZzN4Ll1UNT93tmBl0vud2PmmtmprIzFz6py+/2SFVxPeHgmVTaJ6rWVyq1zc/GeDX4xx7ShjZKcSarEidlo65G/xY5TCJFnI4HBatVVB2L4efaguU5PJOu1nWScp0XWUAAbgCHfhyNSm+yXhX2MBFLqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060111; c=relaxed/simple; bh=a/7XgM0h+l2i8yFOfBvZ3dnzrAU52Kgn4sQBRbpz1BU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=t4BoAiRWkc3QunDNAUONBjNezxcLlsMRRgPfHn3Guyyckt7kqNgsUeQji7c3c8hotcRRFMOWETzYnzMzIcq1Lhu+p0IrCG6PArcAl5nt4AEKPmz3bO9KK3jDL/AA7xfBE+An/1wxKxUlA6KUbE39jlOzfmyCcF15TUhVmdZ5j/I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=ccHj7NXg; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e554f64971so66276b3a.1 for ; Tue, 27 Feb 2024 10:55:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060108; x=1709664908; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=a7yi9PMIjR/8xd4Ghl9unLQW/peChPw21p3aXua0c4g=; b=ccHj7NXgJMg4UBjiCL70J0r01ajvs28y9V0ZzH6q9TerEear7nVmtnNHkxPFMLi+5w yR90dFuPWD++o5oOceNfyKxPzlbytZcYHYoS5iU2+FPMOaXOKYY/ogogqdItcBdT6YrI GICqMXk6IAHS9OVm0Zi0YL9lRCj/9Y0Tfd4fw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060108; x=1709664908; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a7yi9PMIjR/8xd4Ghl9unLQW/peChPw21p3aXua0c4g=; b=BMhxgyGpMcdkhu2vdFgjBbyoXlFRGRAqfQIOQIIexN7Qc6zEe7kCYYizKqQYAvj5DR 6oPCQZQZ6n9VFVQGT48S428B95VdkEGQoGK7lrTAomi4ZgPPEnJDtiw31jr0ekeZ6qgJ yMq81LKBgmZEUlG+MKqnKxJRDKE0YC98nLEOx/yRY8Iv9oEsqb+Kkj3bnrqQGL8MX2ID gJubsAgVxZK3bOoYEkygHUIozBvee0tYNS/RO8KgjCVMcUriA1MZXS/Iv2VDU0xXMBj3 hn+mt+ZOVWePactOzEahzCq6zS48nqOzia2RJRNbTQ6pn4OP7g2oOd9CyTiQcT2n2tli VxDw== X-Forwarded-Encrypted: i=1; AJvYcCWEc1BKUk+OcFILmNKZq7fNpbsDc7pGixW0v1jICVwqaFJ6kZ7OZTxYDoRab9SQUzEYmJQxxC710uj2BQgVbq2dGGULQMfhLK/4F+hZ X-Gm-Message-State: AOJu0Yx/wy232slYJBAZfNy7MXoYYG7vm13bgfZHvyobvhJSZVsGXRvw rnHMUs052+rx8iBVID/iAM0eKewtmZ7bv9ZfukQt1Q6GaK/o9wCvGO8JynhFag== X-Received: by 2002:a05:6a00:4f0a:b0:6e5:bb8:dc19 with SMTP id lb10-20020a056a004f0a00b006e50bb8dc19mr196805pfb.15.1709060108348; Tue, 27 Feb 2024 10:55:08 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:07 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen Subject: [PATCH net-next v2 5/6] net: bcmasp: Keep buffers through power management Date: Tue, 27 Feb 2024 10:54:53 -0800 Message-Id: <20240227185454.2767610-6-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792089277908471345 X-GMAIL-MSGID: 1792089277908471345 There is no advantage of freeing and re-allocating buffers through suspend and resume. This waste cycles and makes suspend/resume time longer. We also open ourselves to failed allocations in systems with heavy memory fragmentation. Signed-off-by: Justin Chen Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp.h | 1 + .../net/ethernet/broadcom/asp2/bcmasp_intf.c | 181 ++++++++---------- 2 files changed, 76 insertions(+), 106 deletions(-) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h b/drivers/net/ethernet/broadcom/asp2/bcmasp.h index 61598dc070b1..127a5340625e 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h @@ -315,6 +315,7 @@ struct bcmasp_intf { struct bcmasp_desc *rx_edpkt_cpu; dma_addr_t rx_edpkt_dma_addr; dma_addr_t rx_edpkt_dma_read; + dma_addr_t rx_edpkt_dma_valid; /* RX buffer prefetcher ring*/ void *rx_ring_cpu; diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 36e6fae937ea..0b378a6d43e7 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -674,40 +674,78 @@ static void bcmasp_adj_link(struct net_device *dev) phy_print_status(phydev); } -static int bcmasp_init_rx(struct bcmasp_intf *intf) +static int bcmasp_alloc_buffers(struct bcmasp_intf *intf) { struct device *kdev = &intf->parent->pdev->dev; struct page *buffer_pg; - dma_addr_t dma; - void *p; - u32 reg; - int ret; + /* Alloc RX */ intf->rx_buf_order = get_order(RING_BUFFER_SIZE); buffer_pg = alloc_pages(GFP_KERNEL, intf->rx_buf_order); if (!buffer_pg) return -ENOMEM; - dma = dma_map_page(kdev, buffer_pg, 0, RING_BUFFER_SIZE, - DMA_FROM_DEVICE); - if (dma_mapping_error(kdev, dma)) { - __free_pages(buffer_pg, intf->rx_buf_order); - return -ENOMEM; - } intf->rx_ring_cpu = page_to_virt(buffer_pg); - intf->rx_ring_dma = dma; - intf->rx_ring_dma_valid = intf->rx_ring_dma + RING_BUFFER_SIZE - 1; + intf->rx_ring_dma = dma_map_page(kdev, buffer_pg, 0, RING_BUFFER_SIZE, + DMA_FROM_DEVICE); + if (dma_mapping_error(kdev, intf->rx_ring_dma)) + goto free_rx_buffer; + + intf->rx_edpkt_cpu = dma_alloc_coherent(kdev, DESC_RING_SIZE, + &intf->rx_edpkt_dma_addr, GFP_KERNEL); + if (!intf->rx_edpkt_cpu) + goto free_rx_buffer_dma; + + /* Alloc TX */ + intf->tx_spb_cpu = dma_alloc_coherent(kdev, DESC_RING_SIZE, + &intf->tx_spb_dma_addr, GFP_KERNEL); + if (!intf->tx_spb_cpu) + goto free_rx_edpkt_dma; - p = dma_alloc_coherent(kdev, DESC_RING_SIZE, &intf->rx_edpkt_dma_addr, + intf->tx_cbs = kcalloc(DESC_RING_COUNT, sizeof(struct bcmasp_tx_cb), GFP_KERNEL); - if (!p) { - ret = -ENOMEM; - goto free_rx_ring; - } - intf->rx_edpkt_cpu = p; + if (!intf->tx_cbs) + goto free_tx_spb_dma; - netif_napi_add(intf->ndev, &intf->rx_napi, bcmasp_rx_poll); + return 0; + +free_tx_spb_dma: + dma_free_coherent(kdev, DESC_RING_SIZE, intf->tx_spb_cpu, + intf->tx_spb_dma_addr); +free_rx_edpkt_dma: + dma_free_coherent(kdev, DESC_RING_SIZE, intf->rx_edpkt_cpu, + intf->rx_edpkt_dma_addr); +free_rx_buffer_dma: + dma_unmap_page(kdev, intf->rx_ring_dma, RING_BUFFER_SIZE, + DMA_FROM_DEVICE); +free_rx_buffer: + __free_pages(buffer_pg, intf->rx_buf_order); + + return -ENOMEM; +} + +static void bcmasp_reclaim_free_buffers(struct bcmasp_intf *intf) +{ + struct device *kdev = &intf->parent->pdev->dev; + + /* RX buffers */ + dma_free_coherent(kdev, DESC_RING_SIZE, intf->rx_edpkt_cpu, + intf->rx_edpkt_dma_addr); + dma_unmap_page(kdev, intf->rx_ring_dma, RING_BUFFER_SIZE, + DMA_FROM_DEVICE); + __free_pages(virt_to_page(intf->rx_ring_cpu), intf->rx_buf_order); + + /* TX buffers */ + dma_free_coherent(kdev, DESC_RING_SIZE, intf->tx_spb_cpu, + intf->tx_spb_dma_addr); + kfree(intf->tx_cbs); +} +static void bcmasp_init_rx(struct bcmasp_intf *intf) +{ + /* Restart from index 0 */ + intf->rx_ring_dma_valid = intf->rx_ring_dma + RING_BUFFER_SIZE - 1; + intf->rx_edpkt_dma_valid = intf->rx_edpkt_dma_addr + (DESC_RING_SIZE - 1); intf->rx_edpkt_dma_read = intf->rx_edpkt_dma_addr; intf->rx_edpkt_index = 0; @@ -733,64 +771,23 @@ static int bcmasp_init_rx(struct bcmasp_intf *intf) rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_addr, RX_EDPKT_DMA_WRITE); rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_addr, RX_EDPKT_DMA_READ); rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_addr, RX_EDPKT_DMA_BASE); - rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_addr + (DESC_RING_SIZE - 1), - RX_EDPKT_DMA_END); - rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_addr + (DESC_RING_SIZE - 1), - RX_EDPKT_DMA_VALID); - - reg = UMAC2FB_CFG_DEFAULT_EN | - ((intf->channel + 11) << UMAC2FB_CFG_CHID_SHIFT); - reg |= (0xd << UMAC2FB_CFG_OK_SEND_SHIFT); - umac2fb_wl(intf, reg, UMAC2FB_CFG); + rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_valid, RX_EDPKT_DMA_END); + rx_edpkt_dma_wq(intf, intf->rx_edpkt_dma_valid, RX_EDPKT_DMA_VALID); - return 0; - -free_rx_ring: - dma_unmap_page(kdev, intf->rx_ring_dma, RING_BUFFER_SIZE, - DMA_FROM_DEVICE); - __free_pages(virt_to_page(intf->rx_ring_cpu), intf->rx_buf_order); - - return ret; + umac2fb_wl(intf, UMAC2FB_CFG_DEFAULT_EN | ((intf->channel + 11) << + UMAC2FB_CFG_CHID_SHIFT) | (0xd << UMAC2FB_CFG_OK_SEND_SHIFT), + UMAC2FB_CFG); } -static void bcmasp_reclaim_free_all_rx(struct bcmasp_intf *intf) -{ - struct device *kdev = &intf->parent->pdev->dev; - - dma_free_coherent(kdev, DESC_RING_SIZE, intf->rx_edpkt_cpu, - intf->rx_edpkt_dma_addr); - dma_unmap_page(kdev, intf->rx_ring_dma, RING_BUFFER_SIZE, - DMA_FROM_DEVICE); - __free_pages(virt_to_page(intf->rx_ring_cpu), intf->rx_buf_order); -} -static int bcmasp_init_tx(struct bcmasp_intf *intf) +static void bcmasp_init_tx(struct bcmasp_intf *intf) { - struct device *kdev = &intf->parent->pdev->dev; - void *p; - int ret; - - p = dma_alloc_coherent(kdev, DESC_RING_SIZE, &intf->tx_spb_dma_addr, - GFP_KERNEL); - if (!p) - return -ENOMEM; - - intf->tx_spb_cpu = p; + /* Restart from index 0 */ intf->tx_spb_dma_valid = intf->tx_spb_dma_addr + DESC_RING_SIZE - 1; intf->tx_spb_dma_read = intf->tx_spb_dma_addr; - - intf->tx_cbs = kcalloc(DESC_RING_COUNT, sizeof(struct bcmasp_tx_cb), - GFP_KERNEL); - if (!intf->tx_cbs) { - ret = -ENOMEM; - goto free_tx_spb; - } - intf->tx_spb_index = 0; intf->tx_spb_clean_index = 0; - netif_napi_add_tx(intf->ndev, &intf->tx_napi, bcmasp_tx_poll); - /* Make sure channels are disabled */ tx_spb_ctrl_wl(intf, 0x0, TX_SPB_CTRL_ENABLE); tx_epkt_core_wl(intf, 0x0, TX_EPKT_C_CFG_MISC); @@ -806,26 +803,6 @@ static int bcmasp_init_tx(struct bcmasp_intf *intf) tx_spb_dma_wq(intf, intf->tx_spb_dma_addr, TX_SPB_DMA_BASE); tx_spb_dma_wq(intf, intf->tx_spb_dma_valid, TX_SPB_DMA_END); tx_spb_dma_wq(intf, intf->tx_spb_dma_valid, TX_SPB_DMA_VALID); - - return 0; - -free_tx_spb: - dma_free_coherent(kdev, DESC_RING_SIZE, intf->tx_spb_cpu, - intf->tx_spb_dma_addr); - - return ret; -} - -static void bcmasp_reclaim_free_all_tx(struct bcmasp_intf *intf) -{ - struct device *kdev = &intf->parent->pdev->dev; - - /* Free descriptors */ - dma_free_coherent(kdev, DESC_RING_SIZE, intf->tx_spb_cpu, - intf->tx_spb_dma_addr); - - /* Free cbs */ - kfree(intf->tx_cbs); } static void bcmasp_ephy_enable_set(struct bcmasp_intf *intf, bool enable) @@ -915,10 +892,7 @@ static void bcmasp_netif_deinit(struct net_device *dev) bcmasp_enable_rx_irq(intf, 0); netif_napi_del(&intf->tx_napi); - bcmasp_reclaim_free_all_tx(intf); - netif_napi_del(&intf->rx_napi); - bcmasp_reclaim_free_all_rx(intf); } static int bcmasp_stop(struct net_device *dev) @@ -932,6 +906,8 @@ static int bcmasp_stop(struct net_device *dev) bcmasp_netif_deinit(dev); + bcmasp_reclaim_free_buffers(intf); + phy_disconnect(dev->phydev); /* Disable internal EPHY or external PHY */ @@ -1073,17 +1049,12 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) intf->old_link = -1; intf->old_pause = -1; - ret = bcmasp_init_tx(intf); - if (ret) - goto err_phy_disconnect; - - /* Turn on asp */ + bcmasp_init_tx(intf); + netif_napi_add_tx(intf->ndev, &intf->tx_napi, bcmasp_tx_poll); bcmasp_enable_tx(intf, 1); - ret = bcmasp_init_rx(intf); - if (ret) - goto err_reclaim_tx; - + bcmasp_init_rx(intf); + netif_napi_add(intf->ndev, &intf->rx_napi, bcmasp_rx_poll); bcmasp_enable_rx(intf, 1); /* Turn on UniMAC TX/RX */ @@ -1097,12 +1068,6 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) return 0; -err_reclaim_tx: - netif_napi_del(&intf->tx_napi); - bcmasp_reclaim_free_all_tx(intf); -err_phy_disconnect: - if (phydev) - phy_disconnect(phydev); err_phy_disable: if (intf->internal_phy) bcmasp_ephy_enable_set(intf, false); @@ -1118,6 +1083,10 @@ static int bcmasp_open(struct net_device *dev) netif_dbg(intf, ifup, dev, "bcmasp open\n"); + ret = bcmasp_alloc_buffers(intf); + if (ret) + return ret; + ret = clk_prepare_enable(intf->parent->clk); if (ret) return ret; From patchwork Tue Feb 27 18:54:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Chen X-Patchwork-Id: 207546 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp3047475dyb; Tue, 27 Feb 2024 16:22:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVf25l2tFeoVnRgcPuilUIhlFjJYtsb723TWi0B5K+UXrmIfhDK77BT4D5fzxDsFiPcPZXDYRrt0ZDDAhg4UippYzARcw== X-Google-Smtp-Source: AGHT+IEK4TV4f/adLMdj2sOR4EMerf2/A2/2EQ4HSfbO9n/ue7hEdeXAAC4XYok1H68QoljLNnKe X-Received: by 2002:aa7:d4c3:0:b0:565:ed50:81dc with SMTP id t3-20020aa7d4c3000000b00565ed5081dcmr4728333edr.28.1709079735390; Tue, 27 Feb 2024 16:22:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709079735; cv=pass; d=google.com; s=arc-20160816; b=UIWv33W62LUMpsbiXWrb0kFpaIj6r8/cpZJPi+SBk2/SUmkNlyTT0+4EHl+c9/liMT JA/jKOttOlaQV5Xvm92P7CkJBoTeo2FntPbKjDuZxVGSSqY1u/fIK2epVpxPXKpW4P7o VTj7e44mSEqKgkDp5BI+xszwyuKUhj8umkdlZd+uFVzxAEo7pPRUNu4yY/Tws9ypBz/e 1ab6pyDZJL+ltblVjr4biyWDYJ1gXySD/oMomU+Jy74L5HIW+V7TO230JHJpeUvFP5nF U6d+4s8SiImh4ubCtLGBhUEJp7jfLVNUEkOMNKK5myA8zo1uIIaS1hbN43crYhDYHxXI jEng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UaF5Tpv8En48yxR6HUAnI0ilxqIK3GzCF/CKG3bbzfQ=; fh=A/+cE8mRavbBxAMA83lbQTK/lv1tO7bftPJDFpz6pGM=; b=fspUpDLHiHnis4Mrws7aUqgIwVimpcfbrqv3Vuw/vhDHhHThgmGuoffJruJtlLm2Xu BPXlL5encec5LubvXHoDpiuylknhdjVzHImAuMzpO/Yb6V+lyzK9/ptkKMY9MCYA3L68 ZxVCgWVPU7jsoi0jDGH5KYtsoVurZUBfneXdTTJhVWsIVlldUUoROKzpHzhkhyaUBEwt QkuTPX1fjIFINbbhRatIHDNt0Eik4PSRuJRfJYi8DHXv7YJouEcGMHfZuKR5aYt/jBNm FtLK++4aWbSjZ3SkMiEKqO9v0zkZj7FqaPvMPDt27DcThZymm/4aN0ynjcJBIdmL+dJ9 YEaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=efU9Xx1x; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83871-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83871-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y7-20020a50eb07000000b005664ebf6a46si559742edp.612.2024.02.27.16.22.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 16:22:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83871-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=efU9Xx1x; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-83871-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83871-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 153EC1F2DDC0 for ; Tue, 27 Feb 2024 18:57:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FA9751C5C; Tue, 27 Feb 2024 18:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="efU9Xx1x" Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FD5314AD2E for ; Tue, 27 Feb 2024 18:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060112; cv=none; b=hX75HsWLd/KHAbdeR6lmF4XqUYEjrRdV13pzmSkThOL4PsBXq7Iz/XwkpaP1tpcCu/JFT6X847H0i9O/X2ROshtXW3voslbThCpzIQkK7OZTdYydf1cOln97YKPLPw2+fYtYAWp0E4KRVmOAOALtNIXy6MWaWqM02IRO7chEmTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709060112; c=relaxed/simple; bh=0TtnxrLLsiiu3SIY1wjXNv8ElJg3zLabGEWPjVqIoHk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=HgR7hQ9QS0qNRtrLsRbAtWN/t2c3wZlU3AWdKcPUXAB57SZs7qvWn0NeB9QgDfGWgH/oM3+SgqOipTiV9ka8ts/L7/Y5i0KLqYis/7U2vTRhVSBGk0mcV9rIw4IOP3vU0l/B+/XxaMyjwsmA2um/siPUeUjNlWFspgGISFYlUDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=efU9Xx1x; arc=none smtp.client-ip=209.85.210.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: by mail-pf1-f173.google.com with SMTP id d2e1a72fcca58-6e53f76898fso1215296b3a.0 for ; Tue, 27 Feb 2024 10:55:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1709060110; x=1709664910; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=UaF5Tpv8En48yxR6HUAnI0ilxqIK3GzCF/CKG3bbzfQ=; b=efU9Xx1xTciZtO3+M3IL+VF6v0mGCJOD+lRSzzLf5ofnc2TzwIuPL55KjeJa9Uv9Zv 5ejLL5mEGzQ6RtgUEsGNNKzCghz1LaczQDx+jKm9JbZUpufZyrIGfNvYBiZjs7S/lD6F PsSeaJQX3ICt1xihkc8s1g8hvOGFSddIoPZPM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709060110; x=1709664910; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UaF5Tpv8En48yxR6HUAnI0ilxqIK3GzCF/CKG3bbzfQ=; b=mInQd+niC7jDTTLjRIDbOl+tSAvK5Ihldga2WDxWYiie8RW3NOh3iHazjt+aOciwcS 4Y5wUZG39W0z4GqvC8ektdcEDfavhOZyul2jXfrd16ATsg/cbIjUK8H8WEYzAkx9IdNw hfqUNoDthXNp9mrpdZU981ENrA0R84+oHH+04pwjecbY9sHt4yqp7ukflPsv98SmjkRX eKVXnAsamlBZGCeD3hx4rAjk8zBnCOhH/MjQutn2sKTmcgW6BG65ocsYlri41v8UslgM FiC6IXeNx4RyTOTuc/tZQ6eCAxs/VVGrWCWOnqMFypPaeeXBmDEQcjaadJGsnLoGNMsK q1BQ== X-Forwarded-Encrypted: i=1; AJvYcCVfRX/bbizSTpPSl9spe7QKiSw2HnAJZC0nMOaCx3KHm56AnHeiHP4wTEO3GlNT/AD/896K5tUDQJs1HOCFGNMmdCsu10AeCkN6pUat X-Gm-Message-State: AOJu0Yz53iM9AjSGqjpqEO9MHQ/4N2gty+BsCDiju7M39Z4mGiZ8iXFJ IRd5epi77FvaO/E1o0MBkockY0wIHWTVCtXYsTbZOobJfoM+XKpjj1QMATn+2g== X-Received: by 2002:a05:6a00:6c99:b0:6e5:54b5:f16c with SMTP id jc25-20020a056a006c9900b006e554b5f16cmr1952800pfb.0.1709060109803; Tue, 27 Feb 2024 10:55:09 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id r6-20020aa79886000000b006e466369645sm6236898pfl.132.2024.02.27.10.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 10:55:09 -0800 (PST) From: Justin Chen To: netdev@vger.kernel.org Cc: florian.fainelli@broadcom.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, opendmb@gmail.com, bcm-kernel-feedback-list@broadcom.com, andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, rafal@milecki.pl, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Justin Chen Subject: [PATCH net-next v2 6/6] net: bcmasp: Add support for PHY interrupts Date: Tue, 27 Feb 2024 10:54:54 -0800 Message-Id: <20240227185454.2767610-7-justin.chen@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240227185454.2767610-1-justin.chen@broadcom.com> References: <20240227185454.2767610-1-justin.chen@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792099992712742526 X-GMAIL-MSGID: 1792099992712742526 Hook up the phy interrupts for internal phys to reduce mdio traffic and improve responsiveness of link changes. Signed-off-by: Justin Chen Acked-by: Florian Fainelli --- drivers/net/ethernet/broadcom/asp2/bcmasp.c | 17 +++++++++++++++++ drivers/net/ethernet/broadcom/asp2/bcmasp.h | 4 ++++ .../net/ethernet/broadcom/asp2/bcmasp_intf.c | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c index 100c69f3307a..a806dadc4196 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c @@ -31,6 +31,20 @@ static void _intr2_mask_set(struct bcmasp_priv *priv, u32 mask) priv->irq_mask |= mask; } +void bcmasp_enable_phy_irq(struct bcmasp_intf *intf, int en) +{ + struct bcmasp_priv *priv = intf->parent; + + /* Only supported with internal phys */ + if (!intf->internal_phy) + return; + + if (en) + _intr2_mask_clear(priv, ASP_INTR2_PHY_EVENT(intf->channel)); + else + _intr2_mask_set(priv, ASP_INTR2_PHY_EVENT(intf->channel)); +} + void bcmasp_enable_tx_irq(struct bcmasp_intf *intf, int en) { struct bcmasp_priv *priv = intf->parent; @@ -79,6 +93,9 @@ static void bcmasp_intr2_handling(struct bcmasp_intf *intf, u32 status) __napi_schedule_irqoff(&intf->tx_napi); } } + + if (status & ASP_INTR2_PHY_EVENT(intf->channel)) + phy_mac_interrupt(intf->ndev->phydev); } static irqreturn_t bcmasp_isr(int irq, void *data) diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.h b/drivers/net/ethernet/broadcom/asp2/bcmasp.h index 127a5340625e..f93cb3da44b0 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp.h +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.h @@ -19,6 +19,8 @@ #define ASP_INTR2_TX_DESC(intr) BIT((intr) + 14) #define ASP_INTR2_UMC0_WAKE BIT(22) #define ASP_INTR2_UMC1_WAKE BIT(28) +#define ASP_INTR2_PHY_EVENT(intr) ((intr) ? BIT(30) | BIT(31) : \ + BIT(24) | BIT(25)) #define ASP_WAKEUP_INTR2_OFFSET 0x1200 #define ASP_WAKEUP_INTR2_STATUS 0x0 @@ -556,6 +558,8 @@ void bcmasp_enable_tx_irq(struct bcmasp_intf *intf, int en); void bcmasp_enable_rx_irq(struct bcmasp_intf *intf, int en); +void bcmasp_enable_phy_irq(struct bcmasp_intf *intf, int en); + void bcmasp_flush_rx_port(struct bcmasp_intf *intf); extern const struct ethtool_ops bcmasp_ethtool_ops; diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c index 0b378a6d43e7..8fbeb506abb9 100644 --- a/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c +++ b/drivers/net/ethernet/broadcom/asp2/bcmasp_intf.c @@ -382,6 +382,7 @@ static void bcmasp_netif_start(struct net_device *dev) bcmasp_enable_rx_irq(intf, 1); bcmasp_enable_tx_irq(intf, 1); + bcmasp_enable_phy_irq(intf, 1); phy_start(dev->phydev); } @@ -890,6 +891,7 @@ static void bcmasp_netif_deinit(struct net_device *dev) /* Disable interrupts */ bcmasp_enable_tx_irq(intf, 0); bcmasp_enable_rx_irq(intf, 0); + bcmasp_enable_phy_irq(intf, 0); netif_napi_del(&intf->tx_napi); netif_napi_del(&intf->rx_napi); @@ -1028,6 +1030,9 @@ static int bcmasp_netif_init(struct net_device *dev, bool phy_connect) goto err_phy_disable; } + if (intf->internal_phy) + dev->phydev->irq = PHY_MAC_INTERRUPT; + /* Indicate that the MAC is responsible for PHY PM */ phydev->mac_managed_pm = true; } else if (!intf->wolopts) {