775-net-dsa-b53-add-BCM63268-RGMII-configuration.patch 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. From patchwork Mon Mar 20 15:50:24 2023
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 8bit
  5. X-Patchwork-Submitter: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?=
  6. <[email protected]>
  7. X-Patchwork-Id: 13181526
  8. X-Patchwork-Delegate: [email protected]
  9. Return-Path: <[email protected]>
  10. X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
  11. aws-us-west-2-korg-lkml-1.web.codeaurora.org
  12. Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
  13. by smtp.lore.kernel.org (Postfix) with ESMTP id 93F5BC6FD1D
  14. for <[email protected]>; Mon, 20 Mar 2023 16:00:57 +0000 (UTC)
  15. Received: ([email protected]) by vger.kernel.org via listexpand
  16. id S233333AbjCTQAy (ORCPT <rfc822;[email protected]>);
  17. Mon, 20 Mar 2023 12:00:54 -0400
  18. Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46084 "EHLO
  19. lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
  20. with ESMTP id S233519AbjCTQAM (ORCPT
  21. <rfc822;[email protected]>); Mon, 20 Mar 2023 12:00:12 -0400
  22. Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com
  23. [IPv6:2a00:1450:4864:20::330])
  24. by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA2C438B53;
  25. Mon, 20 Mar 2023 08:50:38 -0700 (PDT)
  26. Received: by mail-wm1-x330.google.com with SMTP id iw17so2507691wmb.0;
  27. Mon, 20 Mar 2023 08:50:37 -0700 (PDT)
  28. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  29. d=gmail.com; s=20210112; t=1679327433;
  30. h=content-transfer-encoding:mime-version:references:in-reply-to
  31. :message-id:date:subject:cc:to:from:from:to:cc:subject:date
  32. :message-id:reply-to;
  33. bh=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=;
  34. b=Xb9J1kzvH/7/KC9kfFPe5nfM0jOx0VqmPqlTVHQ2ICuE/eznYiDnZR2GROkiEBeSW5
  35. aj8nTpjx/Zgj9GE1Ere9JmGDP4qH6Ms4GG1dcgxiwCZUubj8EmKPPzq+xRYgui52JXXZ
  36. GG9yZPfp/eWkFHvSgIPzHyC1iWc88F8XSN7+xdXyC7MOoEWIbvy0y04VrbuO9p8+RjCl
  37. XbF+dk2kkZAseZ7QMlgJZ2Bt8HfHx2I4D6+r4BhyVy6oIsdzkMTei+drCezAB5fFzerw
  38. y3GD2qAHDRRSrMpv7wTUuM9Erg/6k7sGs+HKjLlgmmAwT7LMqxNkXvmZeU5IucnlPzyQ
  39. zxGw==
  40. X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  41. d=1e100.net; s=20210112; t=1679327433;
  42. h=content-transfer-encoding:mime-version:references:in-reply-to
  43. :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
  44. :subject:date:message-id:reply-to;
  45. bh=WlRvHn65p7ApqB1hkWXEl334dlDtfL7sexIylSD7RF8=;
  46. b=mx+DrcUS/RrkssaKZwtjxNb1RtQP6+pwhyW7/EaPvgWZPMBZeDHy7B+x5GRw7gA8l5
  47. lIqtZ41yhnrcZ8wp6SSyG+pJJ2Xn4q0N8W3NJS8vZz5/ORmoRdLxyNY8IdlTQlmjV9YT
  48. jY1LCVegFoErlMPP49XZ1fzJtRPIeFv0MZphvdw7nXk5yhg4+vpnfCPKzOJdOmpEgfut
  49. GnIW/BBXCezqjF0GT9Lmp61lPf1j0PCq8lmrcrZtKwI11zyVmOPqgdWmkRh+YirD5L0P
  50. ORDeuqwz5SkyDZ+Sw+dahSLeLtZ/VB+58nFWPpxF4yUw/sKPrhpkZfGzo/VN/jDL1ZfN
  51. 1t3w==
  52. X-Gm-Message-State: AO0yUKVurWpxXw8kQLLJFFk7zmIVuc+hSmpXM9lpLIB/ByDuw5z3fAds
  53. TZs+QVHvNnvyK9ovwNMJwU0=
  54. X-Google-Smtp-Source:
  55. AK7set8fEPc92nUNA58HgNEL8eOH1DCae42kd5S11MkuO5+TV9yIVNP77n+5gS3XrTpCzsFfJmaf/A==
  56. X-Received: by 2002:a05:600c:470e:b0:3eb:42fc:fb30 with SMTP id
  57. v14-20020a05600c470e00b003eb42fcfb30mr34204824wmo.32.1679327433327;
  58. Mon, 20 Mar 2023 08:50:33 -0700 (PDT)
  59. Received: from atlantis.lan (255.red-79-146-124.dynamicip.rima-tde.net.
  60. [79.146.124.255])
  61. by smtp.gmail.com with ESMTPSA id
  62. 3-20020a05600c020300b003eddefd8792sm4812333wmi.14.2023.03.20.08.50.32
  63. (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
  64. Mon, 20 Mar 2023 08:50:32 -0700 (PDT)
  65. From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <[email protected]>
  66. To: [email protected], [email protected], [email protected],
  67. [email protected], [email protected], [email protected],
  68. [email protected], [email protected],
  69. [email protected], [email protected],
  70. [email protected], [email protected]
  71. Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <[email protected]>
  72. Subject: [PATCH 4/4] net: dsa: b53: add BCM63268 RGMII configuration
  73. Date: Mon, 20 Mar 2023 16:50:24 +0100
  74. Message-Id: <[email protected]>
  75. X-Mailer: git-send-email 2.30.2
  76. In-Reply-To: <[email protected]>
  77. References: <[email protected]>
  78. MIME-Version: 1.0
  79. Precedence: bulk
  80. List-ID: <netdev.vger.kernel.org>
  81. X-Mailing-List: [email protected]
  82. X-Patchwork-Delegate: [email protected]
  83. BCM63268 requires special RGMII configuration to work.
  84. Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  85. ---
  86. drivers/net/dsa/b53/b53_common.c | 6 +++++-
  87. drivers/net/dsa/b53/b53_regs.h | 1 +
  88. 2 files changed, 6 insertions(+), 1 deletion(-)
  89. --- a/drivers/net/dsa/b53/b53_common.c
  90. +++ b/drivers/net/dsa/b53/b53_common.c
  91. @@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct
  92. break;
  93. }
  94. - if (port != dev->imp_port)
  95. + if (port != dev->imp_port) {
  96. + if (is63268(dev))
  97. + rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE;
  98. +
  99. rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
  100. + }
  101. b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
  102. --- a/drivers/net/dsa/b53/b53_regs.h
  103. +++ b/drivers/net/dsa/b53/b53_regs.h
  104. @@ -138,6 +138,7 @@
  105. #define B53_RGMII_CTRL_IMP 0x60
  106. #define RGMII_CTRL_ENABLE_GMII BIT(7)
  107. +#define RGMII_CTRL_MII_OVERRIDE BIT(6)
  108. #define RGMII_CTRL_TIMING_SEL BIT(2)
  109. #define RGMII_CTRL_DLL_RXC BIT(1)
  110. #define RGMII_CTRL_DLL_TXC BIT(0)