net: systemport: Add support for SYSTEMPORT lite
cover net: systemport: Add support for SYSTEMPORT lite
Hi David,
This patch series adds support for SYSTEMPORT Lite which is an evolution of the existing SYSTEMPORT adapter.
The two generations are largely identical as far as the transmit/receive path are concerned, and there were just a few control path changes here and there.
Thanks!
Florian Fainelli (2):
net: systemport: Dynamically allocate number of TX rings
net: systemport: Add support for SYSTEMPORT Lite
.../devicetree/bindings/net/brcm,systemport.txt | 5 +- drivers/net/ethernet/broadcom/bcmsysport.c | 334 +++++++++++++++++---- drivers/net/ethernet/broadcom/bcmsysport.h | 80 ++++- 3 files changed, 339 insertions(+), 80 deletions(-)
Signature · 1 line
2.11.0
PATCH 1/2 net: systemport: Dynamically allocate number of TX rings
In preparation for adding SYSTEMPORT Lite, which has twice as less transmit queues than SYSTEMPORT make sure we do allocate TX rings based on the systemport,txq property to get an appropriate memory footprint.
--- drivers/net/ethernet/broadcom/bcmsysport.c | 11 +++++++++++ drivers/net/ethernet/broadcom/bcmsysport.h | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bcmsysport.c +11 -0
@@ -1752,6 +1752,10 @@ static int bcm_sysport_probe(struct platform_device *pdev)if (of_property_read_u32 (dn,"systemport,num-rxq" , &rxq)) rxq =1 ; +/* Sanity check the number of transmit queues */ +if (!txq || txq >TDMA_NUM_RINGS ) +return -EINVAL ; + dev =alloc_etherdev_mqs (sizeof (*priv), txq, rxq);if (!dev)return -ENOMEM ;
@@ -1759,6 +1763,13 @@ static int bcm_sysport_probe(struct platform_device *pdev)/* Initialize private members */ priv =netdev_priv (dev); +/* Allocate number of TX rings */ + priv->tx_rings =devm_kcalloc (&pdev->dev, txq, +sizeof (struct bcm_sysport_tx_ring ), +GFP_KERNEL ); +if (!priv->tx_rings) +return -ENOMEM ; + priv->irq0 =platform_get_irq (pdev,0 ); priv->irq1 =platform_get_irq (pdev,1 ); priv->wol_irq =platform_get_irq (pdev,2 );
drivers/net/ethernet/broadcom/bcmsysport.h +1 -1
@@ -659,7 +659,7 @@ struct bcm_sysport_priv {int wol_irq;/* Transmit rings */ -struct bcm_sysport_tx_ring tx_rings[TDMA_NUM_RINGS ]; +struct bcm_sysport_tx_ring *tx_rings;/* Receive queue */ void __iomem *rx_bds;
Signature · 1 line
2.11.0
PATCH 2/2 net: systemport: Add support for SYSTEMPORT Lite
In reply to Florian FainelliAdd supporf for the SYSTEMPORT Lite Ethernet controller, this piece of hardware is largely based on the full-blown SYSTEMPORT and differs in the following:
- no full-blown UniMAC, instead we have the MagicPacket matching from UniMAC at same offset, and a GMII Interface Block (GIB) for the MAC-level stuff, since we are always interfaced to an Ethernet switch which is fully Ethernet compliant shortcuts could be made
- 16 transmit queues, whose interrupts are moved into the first Level-2 interrupt controller bank
- slight TDMA offset change (a register was inserted after TDMA_STATUS, *sigh*)
- 256 RX descriptors (512 words) and 256 TX descriptors (not visible)
As a consequence of these two things, update the code paths accordingly to differentiate the full-blown from the light version.
--- .../devicetree/bindings/net/brcm,systemport.txt | 5 +- drivers/net/ethernet/broadcom/bcmsysport.c | 323 +++++++++++++++++---- drivers/net/ethernet/broadcom/bcmsysport.h | 78 ++++- 3 files changed, 327 insertions(+), 79 deletions(-)
Documentation/devicetree/bindings/net/brcm,systemport.txt +4 -1
@@ -1,7 +1,10 @@ * Broadcom BCM7xxx Ethernet Systemport Controller (SYSTEMPORT) Required properties: -- compatible: should be one of "brcm,systemport-v1.00" or "brcm,systemport" +- compatible: should be one of: + "brcm,systemport-v1.00" + "brcm,systemportlite-v1.00" or + "brcm,systemport" - reg: address and length of the register set for the device. - interrupts: interrupts for the device, first cell must be for the rx interrupts, and the second cell should be for the transmit queues. An
drivers/net/ethernet/broadcom/bcmsysport.c +259 -64
573 lines not on this page · raw message
drivers/net/ethernet/broadcom/bcmsysport.h +64 -14
129 lines not on this page · raw message
Signature · 1 line
2.11.0
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Fri, 20 Jan 2017 11:08:25 -0800
Quoted 6 lines
This patch series adds support for SYSTEMPORT Lite which is an evolution of the existing SYSTEMPORT adapter.
The two generations are largely identical as far as the transmit/receive path are concerned, and there were just a few control path changes here and there.
Series applied, thanks.