2
0

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. From patchwork Tue Mar 21 17:33:59 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: 13183005
  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 31BE4C761A6
  14. for <[email protected]>; Tue, 21 Mar 2023 17:35:16 +0000 (UTC)
  15. Received: ([email protected]) by vger.kernel.org via listexpand
  16. id S229674AbjCURfN (ORCPT <rfc822;[email protected]>);
  17. Tue, 21 Mar 2023 13:35:13 -0400
  18. Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47684 "EHLO
  19. lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
  20. with ESMTP id S230327AbjCURfB (ORCPT
  21. <rfc822;[email protected]>); Tue, 21 Mar 2023 13:35:01 -0400
  22. Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com
  23. [IPv6:2a00:1450:4864:20::436])
  24. by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1D855507D;
  25. Tue, 21 Mar 2023 10:34:27 -0700 (PDT)
  26. Received: by mail-wr1-x436.google.com with SMTP id i9so14537769wrp.3;
  27. Tue, 21 Mar 2023 10:34:27 -0700 (PDT)
  28. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  29. d=gmail.com; s=20210112; t=1679420066;
  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=asmFs22xWYwR1Ql9m/IrNv+MPUNDn8hSjmwDRYvO7mE=;
  34. b=Cqj2C6aG5vEOlhh9N3ybvDA0CV38nhQODnfdnr7utNddd323iDagoJty1Wmi3MAzj1
  35. 5ORmYT5fQvUnild7C4RhcCNTBn+MoYZ+wDZwZYelu6BKHkW11YFK949ax5B50by+ASR2
  36. z+rGI3wR5fVXd4VDgmcsT6zF5x69wKyhbhqIfrhG9BVFTctfaBgDS/l+bX1C56kSqv82
  37. bQkKSSAehSLGpFoCU3q62OGoZVi3jDe6HDb5M1Dp2mgHhqsW19otZpJ57DjtZ1CmtPai
  38. o7T/ew6WoIYSl6whBmV36jeNaDJ3TItOBrKc4nMJBDWaCg4DNzUSe0ei5Xz7Oik5lb3p
  39. y9ew==
  40. X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  41. d=1e100.net; s=20210112; t=1679420066;
  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=asmFs22xWYwR1Ql9m/IrNv+MPUNDn8hSjmwDRYvO7mE=;
  46. b=UdI2iQNBYwRf40ivf3ROR132t95BU/p3RUzXdZLCyz6c6JWtECQ5byyGeEwoX10n5u
  47. HlepoNTJxMFLYrAHGvNLDPpWPuLXMa645S1mCVZ7NyWp8W96XzSynNZPeXHuJdb464QU
  48. A7UTRSW3mlvKe9OR3EcB2CfBZv0yHWR0ldbnxcxGUFw8z78PNqpOVnITtjBdfpGesJ9c
  49. VJw+fiM6hCcahor4nk9LLcAryPm8xmhDLxBKaLILO8wyTUiHY8G9hsXnFCtcpetnF5wS
  50. pW13beAE+odb7ZZaXZUYpWGYhCe/hLzNjbo8YpgzHwadZthxPrT5YvNIYwyrvoViLM0n
  51. KDRQ==
  52. X-Gm-Message-State: AO0yUKW+9H/kqcAUyWeZhZJhiJjsBcYn1THmZaSDrPrk/pNuGXJXGtJd
  53. NgsGZW8iSqLEv81yK+U5Os8=
  54. X-Google-Smtp-Source:
  55. AK7set/lzQZwCSxVaOe5dZ+7TR3xaQty/vg5xvZDpRW8TwTiPQblIbw5kJJTPLp67RySehrPIlCqSg==
  56. X-Received: by 2002:a5d:65c9:0:b0:2ce:ac31:54ff with SMTP id
  57. e9-20020a5d65c9000000b002ceac3154ffmr2776515wrw.2.1679420066191;
  58. Tue, 21 Mar 2023 10:34:26 -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. b13-20020a056000054d00b002da1261aa44sm184775wrf.48.2023.03.21.10.34.24
  63. (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
  64. Tue, 21 Mar 2023 10:34:25 -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], [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. Simon Horman <[email protected]>
  73. Subject: [PATCH v2 4/4] net: dsa: b53: add BCM63268 RGMII configuration
  74. Date: Tue, 21 Mar 2023 18:33:59 +0100
  75. Message-Id: <[email protected]>
  76. X-Mailer: git-send-email 2.30.2
  77. In-Reply-To: <[email protected]>
  78. References: <[email protected]>
  79. <[email protected]>
  80. MIME-Version: 1.0
  81. Precedence: bulk
  82. List-ID: <netdev.vger.kernel.org>
  83. X-Mailing-List: [email protected]
  84. X-Patchwork-Delegate: [email protected]
  85. BCM63268 requires special RGMII configuration to work.
  86. Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  87. Reviewed-by: Florian Fainelli <[email protected]>
  88. Reviewed-by: Simon Horman <[email protected]>
  89. ---
  90. v2: no changes.
  91. drivers/net/dsa/b53/b53_common.c | 6 +++++-
  92. drivers/net/dsa/b53/b53_regs.h | 1 +
  93. 2 files changed, 6 insertions(+), 1 deletion(-)
  94. --- a/drivers/net/dsa/b53/b53_common.c
  95. +++ b/drivers/net/dsa/b53/b53_common.c
  96. @@ -1240,8 +1240,12 @@ static void b53_adjust_63xx_rgmii(struct
  97. break;
  98. }
  99. - if (port != dev->imp_port)
  100. + if (port != dev->imp_port) {
  101. + if (is63268(dev))
  102. + rgmii_ctrl |= RGMII_CTRL_MII_OVERRIDE;
  103. +
  104. rgmii_ctrl |= RGMII_CTRL_ENABLE_GMII;
  105. + }
  106. b53_write8(dev, B53_CTRL_PAGE, off, rgmii_ctrl);
  107. --- a/drivers/net/dsa/b53/b53_regs.h
  108. +++ b/drivers/net/dsa/b53/b53_regs.h
  109. @@ -138,6 +138,7 @@
  110. #define B53_RGMII_CTRL_IMP 0x60
  111. #define RGMII_CTRL_ENABLE_GMII BIT(7)
  112. +#define RGMII_CTRL_MII_OVERRIDE BIT(6)
  113. #define RGMII_CTRL_TIMING_SEL BIT(2)
  114. #define RGMII_CTRL_DLL_RXC BIT(1)
  115. #define RGMII_CTRL_DLL_TXC BIT(0)