Skip to contentSkip to conversation

net: macb: add some missing caps

PATCH Applied Théo Lebrun 3 participants 5 messages Nov 13 – Nov 17

Subsystems (3)
lore
Share & tools
lore

Théo Lebrun

author maintainer
#0 lore raw

cover net: macb: add some missing caps

Out of all the compatibles modified, I only could test on Mobileye EyeQ5. The rest is information pulled from public datasheets.

- QUEUE_DISABLE is important for suspend WoL (avoiding tieoff descriptors) and will allow ethtool -L support for those platforms.

The QUEUE_DISABLE patch was sent once as part of the set_channels series [0]. Comments from Nicolai were addressed. Split to keep the series small.

- QBV is important, well, if you need QBV features.

Thanks,
Have a nice day,
Théo

[0]: https://lore.kernel.org/netdev/[email protected]/

---
Théo Lebrun (2):
net: macb: add QUEUE_DISABLE capability to 3 compatibles
net: macb: add QBV capability to 4 compatibles

 drivers/net/ethernet/cadence/macb_main.c | 34 ++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)

---
base-commit: 573af801552999954caa8347e4490b04cf4763f0
change-id: 20261113-macb-caps-be72fa7ce119

Best regards,

Signature · 1 line
Théo Lebrun <[email protected]>
author maintainer
#1 lore raw

PATCH 1/2 net: macb: add QUEUE_DISABLE capability to 3 compatibles

According to datasheets, we know those 3 IP versions support Tx and Rx queue disabling, ie bit 0 in RBQP and TBQP registers.

All revisions I've seen either support it on both Tx & Rx or don't support it at all.

Sources:

   Compatible            | Match data         | Datasheet
   ----------------------|--------------------|-------------------------
   atmel,sama5d29-gem    | sama5d29_config    | DS60001764 [0]
   microchip,mpfs-macb   | mpfs_config        | header files [1]
   microchip,sama7g5-gem | sama7g5_gem_config | DS60001765 [2]

To contrast, check out the SAM9X60 DS60001579C datasheet [3] that does not document bit 0 as anything special on page 1041 and page 1042.

This makes a big chance for those platforms when doing suspend WoL! Instead of using a tieoff descriptor, they rely on hardware capabilities of disabling queues.

[0]:
https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ProductDocuments/DataSheets/SAMA5D29-Data-Sheet-ds60001764.pdf

[1]:
https://github.com/polarfire-soc/polarfire-soc-bare-metal-library/blob/614a67ab/src/platform/drivers/mss/mss_ethernet_mac/mss_ethernet_mac_regs.h#L200-L207

[2]:
https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ProductDocuments/DataSheets/SAMA7G5-Series-Data-Sheet-DS60001765.pdf

[3]:
https://ww1.microchip.com/downloads/en/DeviceDoc/SAM9X60-Data-Sheet-DS60001579C.pdf

---
 drivers/net/ethernet/cadence/macb_main.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +4 -3
index 5bd299fc85a9..25d098a46965 100644
@@ -6078,7 +6078,7 @@ static const struct macb_config sama5d2_config = {
 
 static const struct macb_config sama5d29_config = {
 	.caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP |
-		MACB_CAPS_USRIO_HAS_MII,
+		MACB_CAPS_USRIO_HAS_MII | MACB_CAPS_QUEUE_DISABLE,
 	.dma_burst_length = 16,
 	.usrio = &at91_default_usrio,
 };
@@ -6134,7 +6134,8 @@ static const struct macb_config mpfs_config = {
 	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE |
 		MACB_CAPS_JUMBO |
 		MACB_CAPS_GEM_HAS_PTP |
-		MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE,
+		MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE |
+		MACB_CAPS_QUEUE_DISABLE,
 	.dma_burst_length = 16,
 	.init = init_reset_optional,
 	.usrio = &mpfs_usrio,
@@ -6147,7 +6148,7 @@ static const struct macb_config sama7g5_gem_config = {
 		MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
 		MACB_CAPS_USRIO_HAS_REFCLK_SOURCE |
 		MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP |
-		MACB_CAPS_USRIO_HAS_MII,
+		MACB_CAPS_USRIO_HAS_MII | MACB_CAPS_QUEUE_DISABLE,
 	.dma_burst_length = 16,
 	.usrio = &sama7g5_gem_usrio,
 };
Signature · 1 line
2.56.0
author maintainer
#2 lore raw

PATCH 2/2 net: macb: add QBV capability to 4 compatibles

In reply to Théo Lebrun

Add MACB_CAPS_QBV to four compatibles. Tested on EyeQ5 hardware. The other ones are not tested. Datasheets indicate support.

Compatible | Datasheet
-----------------------+------------------------

   mobileye,eyeq5-gem     | Not public
   microchip,mpfs-macb    | Public header files [0]
   microchip,sam9x7-gem   | DS60001813 [1]
   microchip,sama7d65-gem | DS60001851 [2]

For the latter two, upstream devicetrees and bindings know about the compatible but the driver only used their "parent" compatible microchip,sama7g5-gem. Therefore add match data for those two. Instead of duplicating the long caps list, store it in a define which gets called three times.

[0]:
https://github.com/polarfire-soc/hart-software-services/blob/445664ca8ac5/baremetal/polarfire-soc-bare-metal-library/src/platform/drivers/mss/mss_ethernet_mac/mss_ethernet_registers.h#L264-L278

[1]:
https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ProductDocuments/DataSheets/SAM9X7-Series-Data-Sheet-DS60001813.pdf

[2]:
https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ProductDocuments/DataSheets/SAMA7D6-Series-Data-Sheet-DS60001851.pdf

---
 drivers/net/ethernet/cadence/macb_main.c | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)
drivers/net/ethernet/cadence/macb_main.c +24 -7
index 25d098a46965..9f6111661b40 100644
@@ -6135,7 +6135,7 @@ static const struct macb_config mpfs_config = {
 		MACB_CAPS_JUMBO |
 		MACB_CAPS_GEM_HAS_PTP |
 		MACB_CAPS_USRIO_HAS_TSUCLK_SOURCE |
-		MACB_CAPS_QUEUE_DISABLE,
+		MACB_CAPS_QUEUE_DISABLE | MACB_CAPS_QBV,
 	.dma_burst_length = 16,
 	.init = init_reset_optional,
 	.usrio = &mpfs_usrio,
@@ -6143,12 +6143,15 @@ static const struct macb_config mpfs_config = {
 	.jumbo_max_len = 4040,
 };
 
+#define MACB_SAMA7G5_CAPS ( \
+	MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | \
+	MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | \
+	MACB_CAPS_USRIO_HAS_REFCLK_SOURCE | \
+	MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP | \
+	MACB_CAPS_USRIO_HAS_MII | MACB_CAPS_QUEUE_DISABLE)
+
 static const struct macb_config sama7g5_gem_config = {
-	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG |
-		MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII |
-		MACB_CAPS_USRIO_HAS_REFCLK_SOURCE |
-		MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP |
-		MACB_CAPS_USRIO_HAS_MII | MACB_CAPS_QUEUE_DISABLE,
+	.caps = MACB_SAMA7G5_CAPS,
 	.dma_burst_length = 16,
 	.usrio = &sama7g5_gem_usrio,
 };
@@ -6163,6 +6166,18 @@ static const struct macb_config sama7g5_emac_config = {
 	.usrio = &sama7g5_emac_usrio,
 };
 
+static const struct macb_config sam9x7_config = {
+	.caps = MACB_SAMA7G5_CAPS | MACB_CAPS_QBV,
+	.dma_burst_length = 16,
+	.usrio = &sama7g5_gem_usrio,
+};
+
+static const struct macb_config sama7d65_config = {
+	.caps = MACB_SAMA7G5_CAPS | MACB_CAPS_QBV,
+	.dma_burst_length = 16,
+	.usrio = &sama7g5_gem_usrio,
+};
+
 static const struct macb_config versal_config = {
 	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
 		MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH |
@@ -6178,7 +6193,7 @@ static const struct macb_config versal_config = {
 static const struct macb_config eyeq5_config = {
 	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
 		MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_QUEUE_DISABLE |
-		MACB_CAPS_NO_LSO | MACB_CAPS_EEE,
+		MACB_CAPS_NO_LSO | MACB_CAPS_EEE | MACB_CAPS_QBV,
 	.dma_burst_length = 16,
 	.init = eyeq5_init,
 	.jumbo_max_len = 10240,
@@ -6224,6 +6239,8 @@ static const struct of_device_id macb_dt_ids[] = {
 	{ .compatible = "microchip,pic64hpsc-gem", .data = &pic64hpsc_config},
 	{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
 	{ .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config },
+	{ .compatible = "microchip,sam9x7-gem", .data = &sam9x7_config },
+	{ .compatible = "microchip,sama7d65-gem", .data = &sama7d65_config },
 	{ .compatible = "mobileye,eyeq5-gem", .data = &eyeq5_config },
 	{ .compatible = "raspberrypi,rp1-gem", .data = &raspberrypi_rp1_config },
 	{ .compatible = "xlnx,zynqmp-gem", .data = &zynqmp_config},
Signature · 1 line
2.56.0
Reviewed-by on the v1 series
#3 lore raw
In reply to Théo Lebrun
Quoted 27 lines · Théo Lebrun

Out of all the compatibles modified, I only could test on Mobileye EyeQ5. The rest is information pulled from public datasheets.

- QUEUE_DISABLE is important for suspend WoL (avoiding tieoff descriptors) and will allow ethtool -L support for those platforms.

The QUEUE_DISABLE patch was sent once as part of the set_channels series [0]. Comments from Nicolai were addressed. Split to keep the series small.

- QBV is important, well, if you need QBV features.

Thanks,
Have a nice day,
Théo

[0]: https://lore.kernel.org/netdev/[email protected]/

---
Théo Lebrun (2):
net: macb: add QUEUE_DISABLE capability to 3 compatibles
net: macb: add QBV capability to 4 compatibles

 drivers/net/ethernet/cadence/macb_main.c | 34 
++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)
Quoted 7 lines

---
base-commit: 573af801552999954caa8347e4490b04cf4763f0
change-id: 20261113-macb-caps-be72fa7ce119

Best regards,
--
Théo Lebrun <[email protected]>

For the series:

Thanks,
Nicolai

#4 lore raw
In reply to Théo Lebrun
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Fri, 13 Nov 2026 16:59:27 +0100 you wrote:

Out of all the compatibles modified, I only could test on Mobileye EyeQ5. The rest is information pulled from public datasheets.

- QUEUE_DISABLE is important for suspend WoL (avoiding tieoff descriptors) and will allow ethtool -L support for those platforms.

The QUEUE_DISABLE patch was sent once as part of the set_channels series [0]. Comments from Nicolai were addressed. Split to keep the series small.

[...]

Here is the summary with links:
- [net-next,1/2] net: macb: add QUEUE_DISABLE capability to 3 compatibles

    https://git.kernel.org/netdev/net-next/c/7175eb0400c7
  - [net-next,2/2] net: macb: add QBV capability to 4 compatibles
    https://git.kernel.org/netdev/net-next/c/3515d06ef5a4

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html