2
0

702-02-v6.7-net-phy-aquantia-move-MMD_VEND-define-to-header.patch 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. From e1fbfa4a995d42e02e22b0dff2f8b4fdee1504b3 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Tue, 14 Nov 2023 15:08:42 +0100
  4. Subject: [PATCH 2/3] net: phy: aquantia: move MMD_VEND define to header
  5. Move MMD_VEND define to header to clean things up and in preparation for
  6. firmware loading support that require some define placed in
  7. aquantia_main.
  8. Signed-off-by: Christian Marangi <[email protected]>
  9. Reviewed-by: Andrew Lunn <[email protected]>
  10. Signed-off-by: David S. Miller <[email protected]>
  11. ---
  12. drivers/net/phy/aquantia/aquantia.h | 69 +++++++++++++++++++++++
  13. drivers/net/phy/aquantia/aquantia_hwmon.c | 14 -----
  14. drivers/net/phy/aquantia/aquantia_main.c | 55 ------------------
  15. 3 files changed, 69 insertions(+), 69 deletions(-)
  16. --- a/drivers/net/phy/aquantia/aquantia.h
  17. +++ b/drivers/net/phy/aquantia/aquantia.h
  18. @@ -9,6 +9,75 @@
  19. #include <linux/device.h>
  20. #include <linux/phy.h>
  21. +/* Vendor specific 1, MDIO_MMD_VEND1 */
  22. +#define VEND1_GLOBAL_FW_ID 0x0020
  23. +#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8)
  24. +#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0)
  25. +
  26. +/* The following registers all have similar layouts; first the registers... */
  27. +#define VEND1_GLOBAL_CFG_10M 0x0310
  28. +#define VEND1_GLOBAL_CFG_100M 0x031b
  29. +#define VEND1_GLOBAL_CFG_1G 0x031c
  30. +#define VEND1_GLOBAL_CFG_2_5G 0x031d
  31. +#define VEND1_GLOBAL_CFG_5G 0x031e
  32. +#define VEND1_GLOBAL_CFG_10G 0x031f
  33. +/* ...and now the fields */
  34. +#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7)
  35. +#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0
  36. +#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1
  37. +#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2
  38. +
  39. +/* Vendor specific 1, MDIO_MMD_VEND2 */
  40. +#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421
  41. +#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422
  42. +#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423
  43. +#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424
  44. +#define VEND1_THERMAL_STAT1 0xc820
  45. +#define VEND1_THERMAL_STAT2 0xc821
  46. +#define VEND1_THERMAL_STAT2_VALID BIT(0)
  47. +#define VEND1_GENERAL_STAT1 0xc830
  48. +#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14)
  49. +#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13)
  50. +#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12)
  51. +#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11)
  52. +
  53. +#define VEND1_GLOBAL_GEN_STAT2 0xc831
  54. +#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15)
  55. +
  56. +#define VEND1_GLOBAL_RSVD_STAT1 0xc885
  57. +#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4)
  58. +#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0)
  59. +
  60. +#define VEND1_GLOBAL_RSVD_STAT9 0xc88d
  61. +#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0)
  62. +#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23
  63. +
  64. +#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00
  65. +#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01
  66. +
  67. +#define VEND1_GLOBAL_INT_STD_MASK 0xff00
  68. +#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15)
  69. +#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14)
  70. +#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13)
  71. +#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12)
  72. +#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11)
  73. +#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10)
  74. +#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9)
  75. +#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8)
  76. +#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7)
  77. +#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6)
  78. +#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0)
  79. +
  80. +#define VEND1_GLOBAL_INT_VEND_MASK 0xff01
  81. +#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15)
  82. +#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14)
  83. +#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13)
  84. +#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12)
  85. +#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11)
  86. +#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2)
  87. +#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1)
  88. +#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0)
  89. +
  90. #if IS_REACHABLE(CONFIG_HWMON)
  91. int aqr_hwmon_probe(struct phy_device *phydev);
  92. #else
  93. --- a/drivers/net/phy/aquantia/aquantia_hwmon.c
  94. +++ b/drivers/net/phy/aquantia/aquantia_hwmon.c
  95. @@ -13,20 +13,6 @@
  96. #include "aquantia.h"
  97. -/* Vendor specific 1, MDIO_MMD_VEND2 */
  98. -#define VEND1_THERMAL_PROV_HIGH_TEMP_FAIL 0xc421
  99. -#define VEND1_THERMAL_PROV_LOW_TEMP_FAIL 0xc422
  100. -#define VEND1_THERMAL_PROV_HIGH_TEMP_WARN 0xc423
  101. -#define VEND1_THERMAL_PROV_LOW_TEMP_WARN 0xc424
  102. -#define VEND1_THERMAL_STAT1 0xc820
  103. -#define VEND1_THERMAL_STAT2 0xc821
  104. -#define VEND1_THERMAL_STAT2_VALID BIT(0)
  105. -#define VEND1_GENERAL_STAT1 0xc830
  106. -#define VEND1_GENERAL_STAT1_HIGH_TEMP_FAIL BIT(14)
  107. -#define VEND1_GENERAL_STAT1_LOW_TEMP_FAIL BIT(13)
  108. -#define VEND1_GENERAL_STAT1_HIGH_TEMP_WARN BIT(12)
  109. -#define VEND1_GENERAL_STAT1_LOW_TEMP_WARN BIT(11)
  110. -
  111. #if IS_REACHABLE(CONFIG_HWMON)
  112. static umode_t aqr_hwmon_is_visible(const void *data,
  113. --- a/drivers/net/phy/aquantia/aquantia_main.c
  114. +++ b/drivers/net/phy/aquantia/aquantia_main.c
  115. @@ -91,61 +91,6 @@
  116. #define MDIO_C22EXT_STAT_SGMII_TX_FRAME_ALIGN_ERR 0xd31a
  117. #define MDIO_C22EXT_STAT_SGMII_TX_RUNT_FRAMES 0xd31b
  118. -/* Vendor specific 1, MDIO_MMD_VEND1 */
  119. -#define VEND1_GLOBAL_FW_ID 0x0020
  120. -#define VEND1_GLOBAL_FW_ID_MAJOR GENMASK(15, 8)
  121. -#define VEND1_GLOBAL_FW_ID_MINOR GENMASK(7, 0)
  122. -
  123. -#define VEND1_GLOBAL_GEN_STAT2 0xc831
  124. -#define VEND1_GLOBAL_GEN_STAT2_OP_IN_PROG BIT(15)
  125. -
  126. -/* The following registers all have similar layouts; first the registers... */
  127. -#define VEND1_GLOBAL_CFG_10M 0x0310
  128. -#define VEND1_GLOBAL_CFG_100M 0x031b
  129. -#define VEND1_GLOBAL_CFG_1G 0x031c
  130. -#define VEND1_GLOBAL_CFG_2_5G 0x031d
  131. -#define VEND1_GLOBAL_CFG_5G 0x031e
  132. -#define VEND1_GLOBAL_CFG_10G 0x031f
  133. -/* ...and now the fields */
  134. -#define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7)
  135. -#define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0
  136. -#define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1
  137. -#define VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE 2
  138. -
  139. -#define VEND1_GLOBAL_RSVD_STAT1 0xc885
  140. -#define VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID GENMASK(7, 4)
  141. -#define VEND1_GLOBAL_RSVD_STAT1_PROV_ID GENMASK(3, 0)
  142. -
  143. -#define VEND1_GLOBAL_RSVD_STAT9 0xc88d
  144. -#define VEND1_GLOBAL_RSVD_STAT9_MODE GENMASK(7, 0)
  145. -#define VEND1_GLOBAL_RSVD_STAT9_1000BT2 0x23
  146. -
  147. -#define VEND1_GLOBAL_INT_STD_STATUS 0xfc00
  148. -#define VEND1_GLOBAL_INT_VEND_STATUS 0xfc01
  149. -
  150. -#define VEND1_GLOBAL_INT_STD_MASK 0xff00
  151. -#define VEND1_GLOBAL_INT_STD_MASK_PMA1 BIT(15)
  152. -#define VEND1_GLOBAL_INT_STD_MASK_PMA2 BIT(14)
  153. -#define VEND1_GLOBAL_INT_STD_MASK_PCS1 BIT(13)
  154. -#define VEND1_GLOBAL_INT_STD_MASK_PCS2 BIT(12)
  155. -#define VEND1_GLOBAL_INT_STD_MASK_PCS3 BIT(11)
  156. -#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS1 BIT(10)
  157. -#define VEND1_GLOBAL_INT_STD_MASK_PHY_XS2 BIT(9)
  158. -#define VEND1_GLOBAL_INT_STD_MASK_AN1 BIT(8)
  159. -#define VEND1_GLOBAL_INT_STD_MASK_AN2 BIT(7)
  160. -#define VEND1_GLOBAL_INT_STD_MASK_GBE BIT(6)
  161. -#define VEND1_GLOBAL_INT_STD_MASK_ALL BIT(0)
  162. -
  163. -#define VEND1_GLOBAL_INT_VEND_MASK 0xff01
  164. -#define VEND1_GLOBAL_INT_VEND_MASK_PMA BIT(15)
  165. -#define VEND1_GLOBAL_INT_VEND_MASK_PCS BIT(14)
  166. -#define VEND1_GLOBAL_INT_VEND_MASK_PHY_XS BIT(13)
  167. -#define VEND1_GLOBAL_INT_VEND_MASK_AN BIT(12)
  168. -#define VEND1_GLOBAL_INT_VEND_MASK_GBE BIT(11)
  169. -#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL1 BIT(2)
  170. -#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL2 BIT(1)
  171. -#define VEND1_GLOBAL_INT_VEND_MASK_GLOBAL3 BIT(0)
  172. -
  173. /* Sleep and timeout for checking if the Processor-Intensive
  174. * MDIO operation is finished
  175. */