Skip to content

Commit e7877f5

Browse files
Vince Bridgersdavem330
authored andcommitted
stmmac: Read tx-fifo-depth and rx-fifo-depth from the devicetree
Read the tx-fifo-depth and rx-fifo-depth from the devicetree. The Synopsys stmmac controller fifos are configurable per product instance, and the fifo sizes are needed to configure certain features correctly such as flow control. Signed-off-by: Vince Bridgers <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2453beb commit e7877f5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
181181
sizeof(struct stmmac_mdio_bus_data),
182182
GFP_KERNEL);
183183

184+
of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);
185+
186+
of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);
187+
184188
plat->force_sf_dma_mode =
185189
of_property_read_bool(np, "snps,force_sf_dma_mode");
186190

include/linux/stmmac.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ struct plat_stmmacenet_data {
114114
int maxmtu;
115115
int multicast_filter_bins;
116116
int unicast_filter_entries;
117+
int tx_fifo_size;
118+
int rx_fifo_size;
117119
void (*fix_mac_speed)(void *priv, unsigned int speed);
118120
void (*bus_setup)(void __iomem *ioaddr);
119121
void *(*setup)(struct platform_device *pdev);

0 commit comments

Comments
 (0)