Skip to content

Commit

Permalink
stmmac: Read tx-fifo-depth and rx-fifo-depth from the devicetree
Browse files Browse the repository at this point in the history
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 <vbridger@opensource.altera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Vince Bridgers authored and David S. Miller committed Apr 16, 2015
1 parent 2453beb commit e7877f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ static int stmmac_probe_config_dt(struct platform_device *pdev,
sizeof(struct stmmac_mdio_bus_data),
GFP_KERNEL);

of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);

of_property_read_u32(np, "rx-fifo-depth", &plat->rx_fifo_size);

plat->force_sf_dma_mode =
of_property_read_bool(np, "snps,force_sf_dma_mode");

Expand Down
2 changes: 2 additions & 0 deletions include/linux/stmmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ struct plat_stmmacenet_data {
int maxmtu;
int multicast_filter_bins;
int unicast_filter_entries;
int tx_fifo_size;
int rx_fifo_size;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
void *(*setup)(struct platform_device *pdev);
Expand Down

0 comments on commit e7877f5

Please sign in to comment.