Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: xgmac: show more MAC HW features in debugfs

1. Show TSSTSSEL(Timestamp System Time Source),
ADDMACADRSEL(additional MAC addresses), SMASEL(SMA/MDIO Interface),
HDSEL(Half-duplex Support) in debugfs.
2. Show exact number of additional MAC address registers for XGMAC2 core.
3. XGMAC2 core does not have different IP checksum offload types, so just
show rx_coe instead of rx_coe_type1 or rx_coe_type2.
4. XGMAC2 core does not have rxfifo_over_2048 definition, skip it.

Signed-off-by: Furong Xu <0x1207@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Furong Xu and committed by
David S. Miller
58c1e0ba a9142847

+31 -6
+2
drivers/net/ethernet/stmicro/stmmac/common.h
··· 438 438 unsigned int tbssel; 439 439 /* Numbers of Auxiliary Snapshot Inputs */ 440 440 unsigned int aux_snapshot_n; 441 + /* Timestamp System Time Source */ 442 + unsigned int tssrc; 441 443 }; 442 444 443 445 /* RX Buffer size must be multiple of 4/8/16 bytes */
+4
drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
··· 123 123 #define XGMAC_LPI_TIMER_CTRL 0x000000d4 124 124 #define XGMAC_HW_FEATURE0 0x0000011c 125 125 #define XGMAC_HWFEAT_SAVLANINS BIT(27) 126 + #define XGMAC_HWFEAT_TSSTSSEL GENMASK(26, 25) 127 + #define XGMAC_HWFEAT_ADDMACADRSEL GENMASK(22, 18) 126 128 #define XGMAC_HWFEAT_RXCOESEL BIT(16) 127 129 #define XGMAC_HWFEAT_TXCOESEL BIT(14) 128 130 #define XGMAC_HWFEAT_EEESEL BIT(13) ··· 135 133 #define XGMAC_HWFEAT_MMCSEL BIT(8) 136 134 #define XGMAC_HWFEAT_MGKSEL BIT(7) 137 135 #define XGMAC_HWFEAT_RWKSEL BIT(6) 136 + #define XGMAC_HWFEAT_SMASEL BIT(5) 138 137 #define XGMAC_HWFEAT_VLHASH BIT(4) 138 + #define XGMAC_HWFEAT_HDSEL BIT(3) 139 139 #define XGMAC_HWFEAT_GMIISEL BIT(1) 140 140 #define XGMAC_HW_FEATURE1 0x00000120 141 141 #define XGMAC_HWFEAT_L3L4FNUM GENMASK(30, 27)
+5 -1
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
··· 391 391 { 392 392 u32 hw_cap; 393 393 394 - /* MAC HW feature 0 */ 394 + /* MAC HW feature 0 */ 395 395 hw_cap = readl(ioaddr + XGMAC_HW_FEATURE0); 396 396 dma_cap->vlins = (hw_cap & XGMAC_HWFEAT_SAVLANINS) >> 27; 397 + dma_cap->tssrc = (hw_cap & XGMAC_HWFEAT_TSSTSSEL) >> 25; 398 + dma_cap->multi_addr = (hw_cap & XGMAC_HWFEAT_ADDMACADRSEL) >> 18; 397 399 dma_cap->rx_coe = (hw_cap & XGMAC_HWFEAT_RXCOESEL) >> 16; 398 400 dma_cap->tx_coe = (hw_cap & XGMAC_HWFEAT_TXCOESEL) >> 14; 399 401 dma_cap->eee = (hw_cap & XGMAC_HWFEAT_EEESEL) >> 13; ··· 406 404 dma_cap->rmon = (hw_cap & XGMAC_HWFEAT_MMCSEL) >> 8; 407 405 dma_cap->pmt_magic_frame = (hw_cap & XGMAC_HWFEAT_MGKSEL) >> 7; 408 406 dma_cap->pmt_remote_wake_up = (hw_cap & XGMAC_HWFEAT_RWKSEL) >> 6; 407 + dma_cap->sma_mdio = (hw_cap & XGMAC_HWFEAT_SMASEL) >> 5; 409 408 dma_cap->vlhash = (hw_cap & XGMAC_HWFEAT_VLHASH) >> 4; 409 + dma_cap->half_duplex = (hw_cap & XGMAC_HWFEAT_HDSEL) >> 3; 410 410 dma_cap->mbps_1000 = (hw_cap & XGMAC_HWFEAT_GMIISEL) >> 1; 411 411 412 412 /* MAC HW feature 1 */
+20 -5
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 6237 6237 6238 6238 static int stmmac_dma_cap_show(struct seq_file *seq, void *v) 6239 6239 { 6240 + static const char * const dwxgmac_timestamp_source[] = { 6241 + "None", 6242 + "Internal", 6243 + "External", 6244 + "Both", 6245 + }; 6240 6246 struct net_device *dev = seq->private; 6241 6247 struct stmmac_priv *priv = netdev_priv(dev); 6242 6248 ··· 6263 6257 (priv->dma_cap.half_duplex) ? "Y" : "N"); 6264 6258 seq_printf(seq, "\tHash Filter: %s\n", 6265 6259 (priv->dma_cap.hash_filter) ? "Y" : "N"); 6266 - seq_printf(seq, "\tMultiple MAC address registers: %s\n", 6267 - (priv->dma_cap.multi_addr) ? "Y" : "N"); 6260 + if (priv->plat->has_xgmac) 6261 + seq_printf(seq, 6262 + "\tNumber of Additional MAC address registers: %d\n", 6263 + priv->dma_cap.multi_addr); 6264 + else 6265 + seq_printf(seq, "\tMultiple MAC address registers: %s\n", 6266 + (priv->dma_cap.multi_addr) ? "Y" : "N"); 6268 6267 seq_printf(seq, "\tPCS (TBI/SGMII/RTBI PHY interfaces): %s\n", 6269 6268 (priv->dma_cap.pcs) ? "Y" : "N"); 6270 6269 seq_printf(seq, "\tSMA (MDIO) Interface: %s\n", ··· 6284 6273 (priv->dma_cap.time_stamp) ? "Y" : "N"); 6285 6274 seq_printf(seq, "\tIEEE 1588-2008 Advanced Time Stamp: %s\n", 6286 6275 (priv->dma_cap.atime_stamp) ? "Y" : "N"); 6276 + if (priv->plat->has_xgmac) 6277 + seq_printf(seq, "\tTimestamp System Time Source: %s\n", 6278 + dwxgmac_timestamp_source[priv->dma_cap.tssrc]); 6287 6279 seq_printf(seq, "\t802.3az - Energy-Efficient Ethernet (EEE): %s\n", 6288 6280 (priv->dma_cap.eee) ? "Y" : "N"); 6289 6281 seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); 6290 6282 seq_printf(seq, "\tChecksum Offload in TX: %s\n", 6291 6283 (priv->dma_cap.tx_coe) ? "Y" : "N"); 6292 - if (priv->synopsys_id >= DWMAC_CORE_4_00) { 6284 + if (priv->synopsys_id >= DWMAC_CORE_4_00 || 6285 + priv->plat->has_xgmac) { 6293 6286 seq_printf(seq, "\tIP Checksum Offload in RX: %s\n", 6294 6287 (priv->dma_cap.rx_coe) ? "Y" : "N"); 6295 6288 } else { ··· 6301 6286 (priv->dma_cap.rx_coe_type1) ? "Y" : "N"); 6302 6287 seq_printf(seq, "\tIP Checksum Offload (type2) in RX: %s\n", 6303 6288 (priv->dma_cap.rx_coe_type2) ? "Y" : "N"); 6289 + seq_printf(seq, "\tRXFIFO > 2048bytes: %s\n", 6290 + (priv->dma_cap.rxfifo_over_2048) ? "Y" : "N"); 6304 6291 } 6305 - seq_printf(seq, "\tRXFIFO > 2048bytes: %s\n", 6306 - (priv->dma_cap.rxfifo_over_2048) ? "Y" : "N"); 6307 6292 seq_printf(seq, "\tNumber of Additional RX channel: %d\n", 6308 6293 priv->dma_cap.number_rx_channel); 6309 6294 seq_printf(seq, "\tNumber of Additional TX channel: %d\n",