777-net-dsa-b53-mdio-add-support-for-BCM53134.patch 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. From patchwork Fri Mar 24 08:41:38 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: 13186549
  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 EF744C76195
  14. for <[email protected]>; Fri, 24 Mar 2023 08:42:01 +0000 (UTC)
  15. Received: ([email protected]) by vger.kernel.org via listexpand
  16. id S231807AbjCXImA (ORCPT <rfc822;[email protected]>);
  17. Fri, 24 Mar 2023 04:42:00 -0400
  18. Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32956 "EHLO
  19. lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
  20. with ESMTP id S231272AbjCXIly (ORCPT
  21. <rfc822;[email protected]>); Fri, 24 Mar 2023 04:41:54 -0400
  22. Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
  23. [IPv6:2a00:1450:4864:20::535])
  24. by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113A517CF3;
  25. Fri, 24 Mar 2023 01:41:46 -0700 (PDT)
  26. Received: by mail-ed1-x535.google.com with SMTP id ek18so4877175edb.6;
  27. Fri, 24 Mar 2023 01:41:45 -0700 (PDT)
  28. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  29. d=gmail.com; s=20210112; t=1679647304;
  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=OfUWRaFIQIQw/lRivER+LHryfdLliXzvabGrcmkQVEU=;
  34. b=JMrl6Eay1FS0JZqgPHsbcVzuNAbFELc0SLNGyzYtOVQXcI+YwKDM9Ls7I9PsQVEPoZ
  35. CthomCTYoz5G9DU7uBuia207rnjOhssZJRu0syrCoU+O/ZiQyGLJDvq61z5oZJxC2S40
  36. kzRsUsC6MRjn64DKPWmxhsSTMKLzn2+P233LKNFbHtfi3NWF5Qu/85sUkxMurnfUgja0
  37. qQhl25qYY7ZIvmlFHYefaI5UkITQFuiybrqJW9tztCdHf/gS+f33YkkvQ8njmMQa1DW0
  38. ppedfOUotX+6kmHZGX1yea2V5ezEGGvRourZtYMoecTiD0E5d1J1bKhktKslVLIDm0ig
  39. oc2g==
  40. X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  41. d=1e100.net; s=20210112; t=1679647304;
  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=OfUWRaFIQIQw/lRivER+LHryfdLliXzvabGrcmkQVEU=;
  46. b=b3Gmga5ZDbnmQfnw1GCz+eU2JwgsVzfciZuSmfYAiVxpW4c6cur3MHbpzDPhi99wzA
  47. ZYAM7ryLv88rXl/tQB5g2Nte5rvMfxUeHXsT/JpsRcSSocFRbRrk0QJyiA/Xj86NiD5N
  48. C1sKz50Im190FmrvPcBh6OHQbv/3MQyE+1fQx+9q3jW5rQiAWQaYk4Ng8GlWA7gtG3jB
  49. fHO6Fuoenn32pgkveJbQLYL/2t2f53wGf3QLQ3IeKW7jdfIHNThwrwqBMxdHoIDaTBT9
  50. UWMeJuiYtylIibo/3zbORbWOgIERlWxZRf3BCOFpnzUn4eBzio4LgjtNxZ77ITRxsmbk
  51. 3+Hg==
  52. X-Gm-Message-State: AAQBX9dfyBfbR7Sdd5wqxMiAv3Yhk47pK1XzD87MZyAF3AxyoFyKcMaF
  53. EbwJLyRvTGQEFdVWCGw1eMU=
  54. X-Google-Smtp-Source:
  55. AKy350bpDVLq7k1FxG2Mek/VIobZL4KhufiKx8qfmpxpcWmLI3bLg8wfQKEAKJRNJBleo/7CZuCL5g==
  56. X-Received: by 2002:aa7:c711:0:b0:4a2:588f:b3c5 with SMTP id
  57. i17-20020aa7c711000000b004a2588fb3c5mr2261236edq.21.1679647304260;
  58. Fri, 24 Mar 2023 01:41:44 -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. z21-20020a50cd15000000b004acbda55f6bsm10323728edi.27.2023.03.24.01.41.43
  63. (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
  64. Fri, 24 Mar 2023 01:41:43 -0700 (PDT)
  65. From: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <[email protected]>
  66. To: [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. [email protected], [email protected]
  72. Cc: =?utf-8?q?=C3=81lvaro_Fern=C3=A1ndez_Rojas?= <[email protected]>
  73. Subject: [PATCH v2 2/2] net: dsa: b53: mdio: add support for BCM53134
  74. Date: Fri, 24 Mar 2023 09:41:38 +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. From: Paul Geurts <[email protected]>
  86. Add support for the BCM53134 Ethernet switch in the existing b53 dsa driver.
  87. BCM53134 is very similar to the BCM58XX series.
  88. Signed-off-by: Paul Geurts <[email protected]>
  89. Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  90. ---
  91. v2: add BCM53134 to is531x5() and remove special RGMII config
  92. drivers/net/dsa/b53/b53_common.c | 15 +++++++++++++++
  93. drivers/net/dsa/b53/b53_mdio.c | 5 ++++-
  94. drivers/net/dsa/b53/b53_priv.h | 7 +++++--
  95. 3 files changed, 24 insertions(+), 3 deletions(-)
  96. --- a/drivers/net/dsa/b53/b53_common.c
  97. +++ b/drivers/net/dsa/b53/b53_common.c
  98. @@ -2613,6 +2613,20 @@ static const struct b53_chip_data b53_sw
  99. .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
  100. .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
  101. },
  102. + {
  103. + .chip_id = BCM53134_DEVICE_ID,
  104. + .dev_name = "BCM53134",
  105. + .vlans = 4096,
  106. + .enabled_ports = 0x12f,
  107. + .imp_port = 8,
  108. + .cpu_port = B53_CPU_PORT,
  109. + .vta_regs = B53_VTA_REGS,
  110. + .arl_bins = 4,
  111. + .arl_buckets = 1024,
  112. + .duplex_reg = B53_DUPLEX_STAT_GE,
  113. + .jumbo_pm_reg = B53_JUMBO_PORT_MASK,
  114. + .jumbo_size_reg = B53_JUMBO_MAX_SIZE,
  115. + },
  116. };
  117. static int b53_switch_init(struct b53_device *dev)
  118. @@ -2790,6 +2804,7 @@ int b53_switch_detect(struct b53_device
  119. case BCM53012_DEVICE_ID:
  120. case BCM53018_DEVICE_ID:
  121. case BCM53019_DEVICE_ID:
  122. + case BCM53134_DEVICE_ID:
  123. dev->chip_id = id32;
  124. break;
  125. default:
  126. --- a/drivers/net/dsa/b53/b53_mdio.c
  127. +++ b/drivers/net/dsa/b53/b53_mdio.c
  128. @@ -286,6 +286,7 @@ static const struct b53_io_ops b53_mdio_
  129. #define B53_BRCM_OUI_2 0x03625c00
  130. #define B53_BRCM_OUI_3 0x00406000
  131. #define B53_BRCM_OUI_4 0x01410c00
  132. +#define B53_BRCM_OUI_5 0xae025000
  133. static int b53_mdio_probe(struct mdio_device *mdiodev)
  134. {
  135. @@ -313,7 +314,8 @@ static int b53_mdio_probe(struct mdio_de
  136. if ((phy_id & 0xfffffc00) != B53_BRCM_OUI_1 &&
  137. (phy_id & 0xfffffc00) != B53_BRCM_OUI_2 &&
  138. (phy_id & 0xfffffc00) != B53_BRCM_OUI_3 &&
  139. - (phy_id & 0xfffffc00) != B53_BRCM_OUI_4) {
  140. + (phy_id & 0xfffffc00) != B53_BRCM_OUI_4 &&
  141. + (phy_id & 0xfffffc00) != B53_BRCM_OUI_5) {
  142. dev_err(&mdiodev->dev, "Unsupported device: 0x%08x\n", phy_id);
  143. return -ENODEV;
  144. }
  145. @@ -375,6 +377,7 @@ static const struct of_device_id b53_of_
  146. { .compatible = "brcm,bcm53115" },
  147. { .compatible = "brcm,bcm53125" },
  148. { .compatible = "brcm,bcm53128" },
  149. + { .compatible = "brcm,bcm53134" },
  150. { .compatible = "brcm,bcm5365" },
  151. { .compatible = "brcm,bcm5389" },
  152. { .compatible = "brcm,bcm5395" },
  153. --- a/drivers/net/dsa/b53/b53_priv.h
  154. +++ b/drivers/net/dsa/b53/b53_priv.h
  155. @@ -80,6 +80,7 @@ enum {
  156. BCM583XX_DEVICE_ID = 0x58300,
  157. BCM7445_DEVICE_ID = 0x7445,
  158. BCM7278_DEVICE_ID = 0x7278,
  159. + BCM53134_DEVICE_ID = 0x5075,
  160. };
  161. struct b53_pcs {
  162. @@ -187,7 +188,8 @@ static inline int is531x5(struct b53_dev
  163. {
  164. return dev->chip_id == BCM53115_DEVICE_ID ||
  165. dev->chip_id == BCM53125_DEVICE_ID ||
  166. - dev->chip_id == BCM53128_DEVICE_ID;
  167. + dev->chip_id == BCM53128_DEVICE_ID ||
  168. + dev->chip_id == BCM53134_DEVICE_ID;
  169. }
  170. static inline int is63xx(struct b53_device *dev)
  171. @@ -215,7 +217,8 @@ static inline int is58xx(struct b53_devi
  172. return dev->chip_id == BCM58XX_DEVICE_ID ||
  173. dev->chip_id == BCM583XX_DEVICE_ID ||
  174. dev->chip_id == BCM7445_DEVICE_ID ||
  175. - dev->chip_id == BCM7278_DEVICE_ID;
  176. + dev->chip_id == BCM7278_DEVICE_ID ||
  177. + dev->chip_id == BCM53134_DEVICE_ID;
  178. }
  179. #define B53_63XX_RGMII0 4