From patchwork Fri Oct 8 00:22:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 12543941 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 E9249C433EF for ; Fri, 8 Oct 2021 00:23:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8E886109F for ; Fri, 8 Oct 2021 00:23:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243016AbhJHAZ0 (ORCPT ); Thu, 7 Oct 2021 20:25:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242668AbhJHAZG (ORCPT ); Thu, 7 Oct 2021 20:25:06 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFD8CC06176A; Thu, 7 Oct 2021 17:23:11 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id g10so28703897edj.1; Thu, 07 Oct 2021 17:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=kPyIko2PRzv//D0aLqaiF08VDVNoIeOA63B50bJM/Ws=; b=i0hDdGvkdVMEhTUi6K4PUhUjL/p1e/HdYgBpX6aX6qiHUoOG9w49PvcU2J44wTQY+r IhD+pJIhz8ZSUQZds1WFUtVQCK+arwpTqYnFoySgZMBL54Az5CkxEGoi2+L4J5Zcf4to XO8Hayru+dYuacxpFcRZg9Y5bVCW9tSyRTRyyp9PqaAlmH9Qf6Bndoal2ECQGsqRDNw4 ApgCSaFdzCN25As3VNU+RlFTCKrsvC1DW63qhyilMIsvEEggwa02i8U6F4DCSnJl4Dyu 4RsLcoQJNbRYvPhLi3/99sFvmsQ+jnPx98r4t0nt9cDmZo5SiMZhbQ71+HTnL05kteVy g40w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kPyIko2PRzv//D0aLqaiF08VDVNoIeOA63B50bJM/Ws=; b=cxIJf7SHv3JiEmhjl8ZUNv0ciCRSDTNrRWSwLAUA0/869iNIsFcX1gZM7j5RdtvHNJ ZYL+QQZNouKDpKsHjOE+7QMu9DnhcrR6ziz1bq+i2uB4J6rYqpwrV4MLKjnH0AiQFyV0 MEXS7Tn19KoTVtBt1881KZKVaYq8mCp4hcqwDNCW3mg6g9YaWNgviLDqQkbr+w9pcbfx w+mVlO4E+HUppXhhYTDM2C5zf2vXuJIbq67+nyD37TnRzqJKJFehUcDFikzt67ERsyru xpINZ/52cc1hM7fyrHpmYc5S4nLyETMG5niCiY/WXBp4vg+HemSXg+Y4ormM00R6bLr+ fnEQ== X-Gm-Message-State: AOAM5310NG4/FZV4ni2sT8zb1+/eoi2kqNZNVyN0czYakZv64xpGjGNY k7Ir2g2/LcxLBj14UkprbjY= X-Google-Smtp-Source: ABdhPJynpYNG5T39kdAmuQGDrNOf9a5ge3Swc3UUIn6cJtwTo33gY1lD7d/WYKQ7kJ0w0wGo76BnnA== X-Received: by 2002:a17:906:640f:: with SMTP id d15mr91856ejm.419.1633652590282; Thu, 07 Oct 2021 17:23:10 -0700 (PDT) Received: from Ansuel-xps.localdomain (93-42-71-246.ip85.fastwebnet.it. [93.42.71.246]) by smtp.googlemail.com with ESMTPSA id ke12sm308592ejc.32.2021.10.07.17.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 17:23:09 -0700 (PDT) From: Ansuel Smith To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Heiner Kallweit , Russell King , Ansuel Smith , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next PATCH v2 10/15] net: dsa: qca8k: add explicit SGMII PLL enable Date: Fri, 8 Oct 2021 02:22:20 +0200 Message-Id: <20211008002225.2426-11-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211008002225.2426-1-ansuelsmth@gmail.com> References: <20211008002225.2426-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Support enabling PLL on the SGMII CPU port. Some device require this special configuration or no traffic is transmitted and the switch doesn't work at all. A dedicated binding is added to the CPU node port to apply the correct reg on mac config. Signed-off-by: Ansuel Smith --- drivers/net/dsa/qca8k.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 05ecec4ebc01..8917bb154e8f 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -1237,6 +1237,8 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, break; case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_1000BASEX: + dp = dsa_to_port(ds, port); + /* Enable SGMII on the port */ qca8k_write(priv, reg, QCA8K_PORT_PAD_SGMII_EN); @@ -1255,8 +1257,11 @@ qca8k_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode, if (ret) return; - val |= QCA8K_SGMII_EN_PLL | QCA8K_SGMII_EN_RX | - QCA8K_SGMII_EN_TX | QCA8K_SGMII_EN_SD; + val |= QCA8K_SGMII_EN_SD; + + if (of_property_read_bool(dp->dn, "qca,sgmii-enable-pll")) + val |= QCA8K_SGMII_EN_PLL | QCA8K_SGMII_EN_RX | + QCA8K_SGMII_EN_TX; if (dsa_is_cpu_port(ds, port)) { /* CPU port, we're talking to the CPU MAC, be a PHY */