From patchwork Mon Mar 20 15:50:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= X-Patchwork-Id: 13181526 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93F5BC6FD1D for ; Mon, 20 Mar 2023 16:00:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbjCTQAy (ORCPT ); Mon, 20 Mar 2023 12:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233519AbjCTQAM (ORCPT ); Mon, 20 Mar 2023 12:00:12 -0400 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2C438B53; Mon, 20 Mar 2023 08:50:38 -0700 (PDT) Received: by mail-wm1-x330.google.com with SMTP id iw17so2507691wmb.0; Mon, 20 Mar 2023 08:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679327433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=; b=Xb9J1kzvH/7/KC9kfFPe5nfM0jOx0VqmPqlTVHQ2ICuE/eznYiDnZR2GROkiEBeSW5 aj8nTpjx/Zgj9GE1Ere9JmGDP4qH6Ms4GG1dcgxiwCZUubj8EmKPPzq+xRYgui52JXXZ GG9yZPfp/eWkFHvSgIPzHyC1iWc88F8XSN7+xdXyC7MOoEWIbvy0y04VrbuO9p8+RjCl XbF+dk2kkZAseZ7QMlgJZ2Bt8HfHx2I4D6+r4BhyVy6oIsdzkMTei+drCezAB5fFzerw y3GD2qAHDRRSrMpv7wTUuM9Erg/6k7sGs+HKjLlgmmAwT7LMqxNkXvmZeU5IucnlPzyQ zxGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679327433; h=content-transfer-encoding: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=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=; b=mx+DrcUS/RrkssaKZwtjxNb1RtQP6+pwhyW7/EaPvgWZPMBZeDHy7B+x5GRw7gA8l5 lIqtZ41yhnrcZ8wp6SSyG+pJJ2Xn4q0N8W3NJS8vZz5/ORmoRdLxyNY8IdlTQlmjV9YT jY1LCVegFoErlMPP49XZ1fzJtRPIeFv0MZphvdw7nXk5yhg4+vpnfCPKzOJdOmpEgfut GnIW/BBXCezqjF0GT9Lmp61lPf1j0PCq8lmrcrZtKwI11zyVmOPqgdWmkRh+YirD5L0P ORDeuqwz5SkyDZ+Sw+dahSLeLtZ/VB+58nFWPpxF4yUw/sKPrhpkZfGzo/VN/jDL1ZfN 1t3w== X-Gm-Message-State: AO0yUKVurWpxXw8kQLLJFFk7zmIVuc+hSmpXM9lpLIB/ByDuw5z3fAds TZs+QVHvNnvyK9ovwNMJwU0= X-Google-Smtp-Source: AK7set8fEPc92nUNA58HgNEL8eOH1DCae42kd5S11MkuO5+TV9yIVNP77n+5gS3XrTpCzsFfJmaf/A== X-Received: by 2002:a05:600c:470e:b0:3eb:42fc:fb30 with SMTP id v14-20020a05600c470e00b003eb42fcfb30mr34204824wmo.32.1679327433327; Mon, 20 Mar 2023 08:50:33 -0700 (PDT) Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net. [79.146.124.255]) by smtp.gmail.com with ESMTPSA id 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Mar 2023 08:50:32 -0700 (PDT) From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= To: f.fainelli@gmail.com, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= Subject: [PATCH 4/4] net: dsa: b53: add BCM63268 RGMII configuration Date: Mon, 20 Mar 2023 16:50:24 +0100 Message-Id: <20230320155024.164523-5-noltari@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230320155024.164523-1-noltari@gmail.com> References: <20230320155024.164523-1-noltari@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org BCM63268 requires special RGMII configuration to work. Signed-off-by: Álvaro Fernández Rojas Reviewed-by: Florian Fainelli Reviewed-by: Simon Horman --- drivers/net/dsa/b53/b53_common.c | 6 +++++- drivers/net/dsa/b53/b53_regs.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index 6e212f6f1cb9..d0a22c8a55c9 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct dsa_switch *ds, int port, break; } - if (port != dev->imp_port) + if (port != dev->imp_port) { + if (is63268(dev)) + rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE; + rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII; + } b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl); diff --git a/drivers/net/dsa/b53/b53_regs.h b/drivers/net/dsa/b53/b53_regs.h index b2c539a42154..bfbcb66bef66 100644 --- a/drivers/net/dsa/b53/b53_regs.h +++ b/drivers/net/dsa/b53/b53_regs.h @@ -138,6 +138,7 @@ #define B53_RGMII_CTRL_IMP 0x60 #define RGMII_CTRL_ENABLE_GMII BIT(7) +#define RGMII_CTRL_MII_OVERRIDE BIT(6) #define RGMII_CTRL_TIMING_SEL BIT(2) #define RGMII_CTRL_DLL_RXC BIT(1) #define RGMII_CTRL_DLL_TXC BIT(0)