From patchwork Fri Oct 22 16:17:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12578117 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EC6FC433FE for ; Fri, 22 Oct 2021 16:17:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 24CE5611CB for ; Fri, 22 Oct 2021 16:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233369AbhJVQT1 (ORCPT ); Fri, 22 Oct 2021 12:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233186AbhJVQT0 (ORCPT ); Fri, 22 Oct 2021 12:19:26 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97845C061764; Fri, 22 Oct 2021 09:17:08 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id q187so3772250pgq.2; Fri, 22 Oct 2021 09:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uk58drJFO2v53jvqlvnd1UXuMSoipvawt1I25ukhZag=; b=Q/TyobwEExbtOHj632B0PGSyw4un/DzPapYHxXlYZ1wa+eY8NAboWCK2VWZw+lLMev 8ZcW1Cd6n6DYcdHOr8qbJSRIQIlz0Uz3yNPevsWxK/VC8qkwGnVHipDHOR9guk9oOdad CvgeUS/JeCoM+82x1B78cunnSdxBDsEUdle9N9D1Vpe4jJ5VsJGSHfGbFOp8EAAgF965 uSWObIrwmjmbMmIU54a2QtIrzGryR23BI8umO927fi9Oip+Ojf5r9U4RCxRzO0jCNwHd EQMcTpykqZdo4vACRYGSl72fU6VnQ1BcxBOaDWIZxYBvSjYCNeJcnl+TojzatykuMAHm BJpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Uk58drJFO2v53jvqlvnd1UXuMSoipvawt1I25ukhZag=; b=xFnWOoZSEoc+9jGmD2ZE/nEBhve73ddbhMzHt36M3ZNWXpBz5V7uvlQQtYDjIqD0Cn Ff1TG8Hg/C1kaoWyq5E0MxoVmc5VvgtZw83sstWmn41BkFN9KvHn75vWETUU034CCgo/ 2tUFen3NP7A5Qw40tbORrVbkUPaHQBMS75dpaOkJ1rH9r8hKq0TcLd31D5SqR8cCoB1D bM8lNF1pYVOAZx17H+52ARD2cRpu5uY7sl5TniODYwGtOzJt0tJ8x9FFFr6YFNfXimkh ZrWc8OyBoSmndZgqdsfBKeXRaPX0KKFq00CNHBwhuqZSzzI3Viwp84ZI2LCd0ceahRBo apqg== X-Gm-Message-State: AOAM530KldANlvJ+xKlQeXxIrc7lU9fLX7LoPp/VZTRAu0jjv0ESTTqf l1MxA1pwM09KTLnWLWexLdAOzhH1vIs= X-Google-Smtp-Source: ABdhPJzwo2/4oFYRTKpNbtatK4cqhx4KggGw75NANSUpOa2P8uwM5IKOCccDM7k45PkbH4ex0EvARg== X-Received: by 2002:aa7:983a:0:b0:44d:8bc8:b0ac with SMTP id q26-20020aa7983a000000b0044d8bc8b0acmr664680pfl.83.1634919427749; Fri, 22 Oct 2021 09:17:07 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id nn14sm9866556pjb.27.2021.10.22.09.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 09:17:07 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Doug Berger , "David S. Miller" , Jakub Kicinski , bcm-kernel-feedback-list@broadcom.com (open list:BROADCOM GENET ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 1/3] net: phy: bcm7xxx: Add EPHY entry for 7712 Date: Fri, 22 Oct 2021 09:17:01 -0700 Message-Id: <20211022161703.3360330-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022161703.3360330-1-f.fainelli@gmail.com> References: <20211022161703.3360330-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 7712 is a 16nm process SoC with a 10/100 integrated Ethernet PHY, utilize the recently defined 16nm EPHY macro to configure that PHY. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn --- drivers/net/phy/bcm7xxx.c | 2 ++ include/linux/brcmphy.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c index 6ceadd2a0082..75593e7d1118 100644 --- a/drivers/net/phy/bcm7xxx.c +++ b/drivers/net/phy/bcm7xxx.c @@ -936,6 +936,7 @@ static struct phy_driver bcm7xxx_driver[] = { BCM7XXX_40NM_EPHY(PHY_ID_BCM7425, "Broadcom BCM7425"), BCM7XXX_40NM_EPHY(PHY_ID_BCM7429, "Broadcom BCM7429"), BCM7XXX_40NM_EPHY(PHY_ID_BCM7435, "Broadcom BCM7435"), + BCM7XXX_16NM_EPHY(PHY_ID_BCM7712, "Broadcom BCM7712"), }; static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { @@ -958,6 +959,7 @@ static struct mdio_device_id __maybe_unused bcm7xxx_tbl[] = { { PHY_ID_BCM7439, 0xfffffff0, }, { PHY_ID_BCM7435, 0xfffffff0, }, { PHY_ID_BCM7445, 0xfffffff0, }, + { PHY_ID_BCM7712, 0xfffffff0, }, { } }; diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 27d9b6683f0e..747fad264033 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h @@ -50,6 +50,7 @@ #define PHY_ID_BCM7439 0x600d8480 #define PHY_ID_BCM7439_2 0xae025080 #define PHY_ID_BCM7445 0x600d8510 +#define PHY_ID_BCM7712 0x35905330 #define PHY_ID_BCM_CYGNUS 0xae025200 #define PHY_ID_BCM_OMEGA 0xae025100 From patchwork Fri Oct 22 16:17:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12578119 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B630C433F5 for ; Fri, 22 Oct 2021 16:17:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0EB86604D2 for ; Fri, 22 Oct 2021 16:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233186AbhJVQT3 (ORCPT ); Fri, 22 Oct 2021 12:19:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233411AbhJVQT1 (ORCPT ); Fri, 22 Oct 2021 12:19:27 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B121C061764; Fri, 22 Oct 2021 09:17:10 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id m26so4085133pff.3; Fri, 22 Oct 2021 09:17:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=P1aN4WsQLFI2PdfhUjfI4iLqwcc0IEhlsHJVMk9NYus=; b=eYC04xupUIJiOhCsDqAk8SrvFshTrvSqLu0kYc1IEVsOMaZPQweyEbP372hlRNmEEv wQ2aw0KGXRiahltRZCdvZlyOROJ8vdy2kqZeHPYXDWnZTTeSlHM0OimI/h+gcJ/ifv5g CVZ5kgm7h9SgINERP0/W0twkwWTHDx3CfeBGTihhKgjPB+NFyGLM7I5EN4FoHhzU4n5R T651mCS7yBy1TYLQtPTKjX/xtwLv+tkTnYqpa/AIQb/czlmklgsf0sfbm4aVySMbkv18 9aBSmDWF100pHBjMkdf5Y23c1N0tpdPu5Jd1gIqD/aSOfOYbUK4r45i4r1UrR1vtRrgP Hgjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=P1aN4WsQLFI2PdfhUjfI4iLqwcc0IEhlsHJVMk9NYus=; b=lBU2i79K1VJXckOn9/tKEBqgZ5PU/zoydRiE+vZKAdDYI6l0RI55EG6mNAcMpg4/XV QDmnF/5ZcbvIgUAFK2aY1u4WokcJAhcYfvEEaZxe/IqlXOsPtn6LDZSKqFk3SL4bToYi 248u+E7PZEGPfQpGTUN3VNfGrnKO/0TugpEZAxrxM+imIJqkkdvC4DaPOQRNO6aNgh4X +R7DiVJ6BnsBZummVMZi6nSd9UROXCYw7Vstt7f/IcetzhMZ5AWyjDsWJHdEVWdn84LS btyjkCkuSGG6ujlohYvGRI49NEAx2ygNXW2hCYp1qWzBJLE2AQeS2bVRvbY/H+9m7pXt 9DrA== X-Gm-Message-State: AOAM531uwwvpf2e43hz7zZk4wzYSRvvKzh7+/vtPxik126y022GXn7KC C5dvNEW78PsW7WJHHoHzP//W2h0vEJg= X-Google-Smtp-Source: ABdhPJySnFdCeAb+fZRgTclObyR0yKN5FDhWINSh/YWXckFEulCX/SzWrvlgPl90ei8gnq5XNv8zkQ== X-Received: by 2002:a05:6a00:1a01:b0:44d:af99:19c9 with SMTP id g1-20020a056a001a0100b0044daf9919c9mr548023pfv.36.1634919429158; Fri, 22 Oct 2021 09:17:09 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id nn14sm9866556pjb.27.2021.10.22.09.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 09:17:08 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Doug Berger , "David S. Miller" , Jakub Kicinski , bcm-kernel-feedback-list@broadcom.com (open list:BROADCOM GENET ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 2/3] dt-bindings: net: bcmgenet: Document 7712 binding Date: Fri, 22 Oct 2021 09:17:02 -0700 Message-Id: <20211022161703.3360330-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022161703.3360330-1-f.fainelli@gmail.com> References: <20211022161703.3360330-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 7712 includes a GENETv5 adapter with an on-chip 10/100 16nm Ethernet PHY which requires us to document that controller's integration specifically for proper driver keying. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn --- Documentation/devicetree/bindings/net/brcm,bcmgenet.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt index 33a0d67e4ce5..0b5994fba35f 100644 --- a/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt +++ b/Documentation/devicetree/bindings/net/brcm,bcmgenet.txt @@ -2,7 +2,8 @@ Required properties: - compatible: should contain one of "brcm,genet-v1", "brcm,genet-v2", - "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5". + "brcm,genet-v3", "brcm,genet-v4", "brcm,genet-v5", "brcm,bcm2711-genet-v5" or + "brcm,bcm7712-genet-v5". - reg: address and length of the register set for the device - interrupts and/or interrupts-extended: must be two cells, the first cell is the general purpose interrupt line, while the second cell is the From patchwork Fri Oct 22 16:17:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 12578121 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 908FDC433EF for ; Fri, 22 Oct 2021 16:17:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F5CA604AC for ; Fri, 22 Oct 2021 16:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233580AbhJVQTa (ORCPT ); Fri, 22 Oct 2021 12:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233516AbhJVQT3 (ORCPT ); Fri, 22 Oct 2021 12:19:29 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A86EC061764; Fri, 22 Oct 2021 09:17:11 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id g184so3757793pgc.6; Fri, 22 Oct 2021 09:17:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WXbmJaulO9/0IuhRPsYWAyYuPJMPjmxreH9KY1srL8E=; b=WQyN/Zoj1RTznGl1rmGRsnJdHCRq5HTIivu9ZCk+UGjJ6inWAJlNxkDkbxPdnJPaxs v2BGufr22CaAmm+TxkU7tOYns6kZgCTaBv7gvFj3ZAGRGMUF5BcNmAkzbHOnk4dw5uxH eysVvxiIou1WOmEyRGu0RYgeaExceUKsZXXEsWFn5h4pIPl6Km4eNaRpS+mwzCCg9LM5 HZ+RasCBnGafhKy/MbB/rPGi8tdEPmnssmgwn6A29fysE/1oWJRjqNk3DEWCDYpw+ntr sL8ZBqTUg/18pJzt6p+N1UX/ujogqfIbC7l/yhHJwTlfhIoowluiJja0FlkZ0pSvOk+o dQKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WXbmJaulO9/0IuhRPsYWAyYuPJMPjmxreH9KY1srL8E=; b=Ve4V8NJBk5DkEs+FUMgez5JF1jeX49geVf+d3NAncGphOddip1mqDRdxcrimvkzaVZ DocmMe22XGsFmbFuLE67VKstNuXQWWOWpusGAy4SU6GPw9TEn7UnKDPcJEIJN39AZm4x nEdGkY3KiDAqbQRe2VzpvxJ/QqEdScaCKuKEXggMeUYYBPmO0lqPEkNZZ730guLhay9v iTPHrbWHj8e6S+qL8EKoaaBWGl7TJxPcrkZowq4CthzpvOSRAxk6bqX49D1u5LAAdpPN i7X1YGE/zhUNedQvrpdmJ0SIgalSbqZWIzHKgtH6KOfbrALSIJ8NVNt/66/5rihjQ0Ju rQnw== X-Gm-Message-State: AOAM530UBwRb1I6BaYsZNQFJXG1Hyi0EWegmIAGLlu1D+XsZ87tCT31O oedn1m5jLv/2P4yVB227cOqmMNDpSdo= X-Google-Smtp-Source: ABdhPJyIhAf9KgwZev2LZ1FuSLB8CcGyfFAKKNWq/75Blc1PJg2sqPuzNq6VVP98rQwcc4gQA7QKDw== X-Received: by 2002:a05:6a00:731:b0:44c:7c1b:fe6a with SMTP id 17-20020a056a00073100b0044c7c1bfe6amr989849pfm.44.1634919430629; Fri, 22 Oct 2021 09:17:10 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id nn14sm9866556pjb.27.2021.10.22.09.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Oct 2021 09:17:10 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Doug Berger , "David S. Miller" , Jakub Kicinski , bcm-kernel-feedback-list@broadcom.com (open list:BROADCOM GENET ETHERNET DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 3/3] net: bcmgenet: Add support for 7712 16nm internal EPHY Date: Fri, 22 Oct 2021 09:17:03 -0700 Message-Id: <20211022161703.3360330-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211022161703.3360330-1-f.fainelli@gmail.com> References: <20211022161703.3360330-1-f.fainelli@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The 16nm internal EPHY that is present in 7712 is actually a 16nm Gigabit PHY which has been forced to operate in 10/100 mode. Its controls are therefore via the EXT_GPHY_CTRL registers and not via the EXT_EPHY_CTRL which are used for all GENETv5 adapters. Add a match on the 7712 compatible string to allow that differentiation to happen. On previous GENETv4 chips the EXT_CFG_IDDQ_GLOBAL_PWR bit was cleared by default, but this is not the case with this chip, so we need to make sure we clear it to power on the EPHY. Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 13 +++++++++++-- drivers/net/ethernet/broadcom/genet/bcmgenet.h | 2 ++ drivers/net/ethernet/broadcom/genet/bcmmii.c | 7 ++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index 5da9c00b43b1..226f4403cfed 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1653,7 +1653,7 @@ static int bcmgenet_power_down(struct bcmgenet_priv *priv, /* Power down LED */ if (priv->hw_params->flags & GENET_HAS_EXT) { reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); - if (GENET_IS_V5(priv)) + if (GENET_IS_V5(priv) && !priv->ephy_16nm) reg |= EXT_PWR_DOWN_PHY_EN | EXT_PWR_DOWN_PHY_RD | EXT_PWR_DOWN_PHY_SD | @@ -1690,7 +1690,7 @@ static void bcmgenet_power_up(struct bcmgenet_priv *priv, case GENET_POWER_PASSIVE: reg &= ~(EXT_PWR_DOWN_DLL | EXT_PWR_DOWN_BIAS | EXT_ENERGY_DET_MASK); - if (GENET_IS_V5(priv)) { + if (GENET_IS_V5(priv) && !priv->ephy_16nm) { reg &= ~(EXT_PWR_DOWN_PHY_EN | EXT_PWR_DOWN_PHY_RD | EXT_PWR_DOWN_PHY_SD | @@ -3910,6 +3910,7 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv) struct bcmgenet_plat_data { enum bcmgenet_version version; u32 dma_max_burst_length; + bool ephy_16nm; }; static const struct bcmgenet_plat_data v1_plat_data = { @@ -3942,6 +3943,12 @@ static const struct bcmgenet_plat_data bcm2711_plat_data = { .dma_max_burst_length = 0x08, }; +static const struct bcmgenet_plat_data bcm7712_plat_data = { + .version = GENET_V5, + .dma_max_burst_length = DMA_MAX_BURST_LENGTH, + .ephy_16nm = true, +}; + static const struct of_device_id bcmgenet_match[] = { { .compatible = "brcm,genet-v1", .data = &v1_plat_data }, { .compatible = "brcm,genet-v2", .data = &v2_plat_data }, @@ -3949,6 +3956,7 @@ static const struct of_device_id bcmgenet_match[] = { { .compatible = "brcm,genet-v4", .data = &v4_plat_data }, { .compatible = "brcm,genet-v5", .data = &v5_plat_data }, { .compatible = "brcm,bcm2711-genet-v5", .data = &bcm2711_plat_data }, + { .compatible = "brcm,bcm7712-genet-v5", .data = &bcm7712_plat_data }, { }, }; MODULE_DEVICE_TABLE(of, bcmgenet_match); @@ -4029,6 +4037,7 @@ static int bcmgenet_probe(struct platform_device *pdev) if (pdata) { priv->version = pdata->version; priv->dma_max_burst_length = pdata->dma_max_burst_length; + priv->ephy_16nm = pdata->ephy_16nm; } else { priv->version = pd->genet_version; priv->dma_max_burst_length = DMA_MAX_BURST_LENGTH; diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h index 1cc2838e52c6..946f6e283c4e 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h @@ -329,6 +329,7 @@ struct bcmgenet_mib_counters { #define EXT_CFG_IDDQ_BIAS (1 << 0) #define EXT_CFG_PWR_DOWN (1 << 1) #define EXT_CK25_DIS (1 << 4) +#define EXT_CFG_IDDQ_GLOBAL_PWR (1 << 3) #define EXT_GPHY_RESET (1 << 5) /* DMA rings size */ @@ -612,6 +613,7 @@ struct bcmgenet_priv { phy_interface_t phy_interface; int phy_addr; int ext_phy; + bool ephy_16nm; /* Interrupt variables */ struct work_struct bcmgenet_irq_work; diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c index ad56f54eda0a..5f259641437a 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmmii.c +++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c @@ -139,14 +139,15 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) u32 reg = 0; /* EXT_GPHY_CTRL is only valid for GENETv4 and onward */ - if (GENET_IS_V4(priv)) { + if (GENET_IS_V4(priv) || priv->ephy_16nm) { reg = bcmgenet_ext_readl(priv, EXT_GPHY_CTRL); if (enable) { reg &= ~EXT_CK25_DIS; bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL); mdelay(1); - reg &= ~(EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN); + reg &= ~(EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN | + EXT_CFG_IDDQ_GLOBAL_PWR); reg |= EXT_GPHY_RESET; bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL); mdelay(1); @@ -154,7 +155,7 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) reg &= ~EXT_GPHY_RESET; } else { reg |= EXT_CFG_IDDQ_BIAS | EXT_CFG_PWR_DOWN | - EXT_GPHY_RESET; + EXT_GPHY_RESET | EXT_CFG_IDDQ_GLOBAL_PWR; bcmgenet_ext_writel(priv, reg, EXT_GPHY_CTRL); mdelay(1); reg |= EXT_CK25_DIS;