]> www.infradead.org Git - users/willy/linux.git/commitdiff
net: macb: Add capability-based QBV detection and Versal support
authorVineeth Karumanchi <vineeth.karumanchi@amd.com>
Thu, 14 Aug 2025 07:10:58 +0000 (12:40 +0530)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 19 Aug 2025 10:13:03 +0000 (12:13 +0200)
The 'exclude_qbv' bit in the designcfg_debug1 register varies across
MACB/GEM IP revisions, making direct probing unreliable for detecting
QBV support. This patch introduces a capability-based approach for
consistent QBV feature identification across the IP family.

Platform support updates:
- Establish foundation for QBV detection in TAPRIO implementation
- Enable MACB_CAPS_QBV for Xilinx Versal platform configuration
- Fix capability line wrapping, ensuring code stays within 80 columns

Signed-off-by: Vineeth Karumanchi <vineeth.karumanchi@amd.com>
Link: https://patch.msgid.link/20250814071058.3062453-3-vineeth.karumanchi@amd.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/cadence/macb.h
drivers/net/ethernet/cadence/macb_main.c

index d1a98b45c92ceec288aaf08c80cdb99a512950ff..9049546106116e1a6ce7abf2a9e17fc819d76bc9 100644 (file)
 #define MACB_CAPS_MIIONRGMII                   0x00000200
 #define MACB_CAPS_NEED_TSUCLK                  0x00000400
 #define MACB_CAPS_QUEUE_DISABLE                        0x00000800
+#define MACB_CAPS_QBV                          0x00001000
 #define MACB_CAPS_PCS                          0x01000000
 #define MACB_CAPS_HIGH_SPEED                   0x02000000
 #define MACB_CAPS_CLK_HW_CHG                   0x04000000
index a42304eb2bf87d5e0df266a1f1a8f45f4b26b2e2..124ef0b0bcad2fc30adca80c75a37cb563987b70 100644 (file)
@@ -4602,6 +4602,10 @@ static int macb_init(struct platform_device *pdev)
                dev->hw_features |= NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
        if (bp->caps & MACB_CAPS_SG_DISABLED)
                dev->hw_features &= ~NETIF_F_SG;
+       /* Enable HW_TC if hardware supports QBV */
+       if (bp->caps & MACB_CAPS_QBV)
+               dev->hw_features |= NETIF_F_HW_TC;
+
        dev->features = dev->hw_features;
 
        /* Check RX Flow Filters support.
@@ -5354,8 +5358,9 @@ static const struct macb_config sama7g5_emac_config = {
 
 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 | MACB_CAPS_NEED_TSUCLK |
-               MACB_CAPS_QUEUE_DISABLE,
+               MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH |
+               MACB_CAPS_NEED_TSUCLK | MACB_CAPS_QUEUE_DISABLE |
+               MACB_CAPS_QBV,
        .dma_burst_length = 16,
        .clk_init = macb_clk_init,
        .init = init_reset_optional,