1. 23 Apr, 2018 1 commit
    • Jose Abreu's avatar
      net: stmmac: Implement logic to automatically select HW Interface · 5f0456b4
      Jose Abreu authored
      
      
      Move all the core version detection to a common place ("hwif.c") and
      implement a table which can be used to lookup the correct callbacks for
      each IP version.
      
      This simplifies the initialization flow of each IP version and eases
      future implementation of new IP versions.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Vitor Soares <soares@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5f0456b4
  2. 19 Apr, 2018 1 commit
    • Jose Abreu's avatar
      net: stmmac: Disable ACS Feature for GMAC >= 4 · 565020aa
      Jose Abreu authored
      ACS Feature is currently enabled for GMAC >= 4 but the llc_snap status
      is never checked in descriptor rx_status callback. This will cause
      stmmac to always strip packets even that ACS feature is already
      stripping them.
      
      Lets be safe and disable the ACS feature for GMAC >= 4 and always strip
      the packets for this GMAC version.
      
      Fixes: 477286b5
      
       ("stmmac: add GMAC4 core support")
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      565020aa
  3. 30 Mar, 2018 1 commit
    • Jose Abreu's avatar
      net: stmmac: Add support for DWMAC5 and implement Safety Features · 8bf993a5
      Jose Abreu authored
      
      
      This adds initial suport for DWMAC5 and implements the Automotive Safety
      Package which is available from core version 5.10.
      
      The Automotive Safety Pacakge (also called Safety Features) offers us
      with error protection in the core by implementing ECC Protection in
      memories, on-chip data path parity protection, FSM parity and timeout
      protection and Application/CSR interface timeout protection.
      
      In case of an uncorrectable error we call stmmac_global_err() and
      reconfigure the whole core.
      
      Signed-off-by: default avatarJose Abreu <joabreu@synopsys.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8bf993a5
  4. 20 Feb, 2018 1 commit
  5. 09 Feb, 2018 3 commits
  6. 22 Jan, 2018 1 commit
    • Florian Fainelli's avatar
      net: stmmac: Fix reception of Broadcom switches tags · 8cad443e
      Florian Fainelli authored
      
      
      Broadcom tags inserted by Broadcom switches put a 4 byte header after
      the MAC SA and before the EtherType, which may look like some sort of 0
      length LLC/SNAP packet (tcpdump and wireshark do think that way). With
      ACS enabled in stmmac the packets were truncated to 8 bytes on
      reception, whereas clearing this bit allowed normal reception to occur.
      
      In order to make that possible, we need to pass a net_device argument to
      the different core_init() functions and we are dependent on the Broadcom
      tagger padding packets correctly (which it now does). To be as little
      invasive as possible, this is only done for gmac1000 when the network
      device is DSA-enabled (netdev_uses_dsa() returns true).
      
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8cad443e
  7. 14 Nov, 2017 1 commit
    • Niklas Cassel's avatar
      net: stmmac: fix LPI transitioning for dwmac4 · 4497478c
      Niklas Cassel authored
      
      
      The LPI transitioning logic in stmmac_main uses
      priv->tx_path_in_lpi_mode to enter/exit LPI.
      
      However, priv->tx_path_in_lpi_mode is assigned
      using the return value from host_irq_status().
      
      So for dwmac4, priv->tx_path_in_lpi_mode was always false,
      so stmmac_tx_clean() would always try to put us in eee mode,
      and stmmac_xmit() would never take us out of eee mode.
      
      To fix this, make host_irq_status() read and return the LPI
      irq status also for dwmac4.
      
      This also increments the existing LPI counters, so that
      ethtool --statistics shows LPI transitions also for dwmac4.
      
      For dwmac1000, irqs are enabled/disabled using the register
      named "Interrupt Mask Register", and thus setting a bit disables
      that specific irq.
      
      For dwmac4 the matching register is named "MAC_Interrupt_Enable",
      and thus setting a bit enables that specific irq.
      
      Looking at dwmac1000_core.c, the irqs that are always enabled are:
      LPI and PMT.
      
      Looking at dwmac4_core.c, the irqs that are always enabled are:
      PMT.
      
      To be able to read the LPI irq status, we need to enable the LPI
      irq also for dwmac4.
      
      Signed-off-by: default avatarNiklas Cassel <niklas.cassel@axis.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4497478c
  8. 28 Sep, 2017 1 commit
  9. 13 Jul, 2017 1 commit
  10. 25 May, 2017 1 commit
    • LABBE Corentin's avatar
      net-next: stmmac: rework the speed selection · ca84dfb9
      LABBE Corentin authored
      
      
      The current stmmac_adjust_link() part which handle speed have
      some if (has_platform) code and my dwmac-sun8i will add more of them.
      
      So we need to handle better speed selection.
      Moreover the struct link member speed and port are hard to guess their
      purpose. And their unique usage are to be combined for writing speed.
      
      So this patch replace speed/port by simpler
      speed10/speed100/speed1000/speed_mask variables.
      
      In dwmac4_core_init and dwmac1000_core_init, port/speed value was used
      directly without using the struct link. This patch convert also their
      usage to speedxxx.
      
      Signed-off-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca84dfb9
  11. 24 Mar, 2017 1 commit
    • LABBE Corentin's avatar
      net: stmmac: add set_mac to the stmmac_ops · 270c7759
      LABBE Corentin authored
      
      
      Two different set_mac functions exists but stmmac_dwmac4_set_mac() is
      only used for enabling and never for disabling.
      So on dwmac4, the MAC RX/TX is never disabled.
      
      This patch add a generic function pointer set_mac() to stmmac_ops and
      replace all call to stmmac_set_mac/stmmac_dwmac4_set_mac by a call to
      this pointer.
      
      Since dwmac4_ops is const, set_mac cannot be modified after, and so dwmac4_ops
      is duplioacted like dwmac4_dma_ops.
      
      Signed-off-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      270c7759
  12. 22 Mar, 2017 2 commits
  13. 13 Mar, 2017 8 commits
  14. 24 Feb, 2017 1 commit
  15. 22 Jan, 2017 1 commit
  16. 09 Jan, 2017 1 commit
  17. 29 Dec, 2016 2 commits
  18. 03 Dec, 2016 1 commit
  19. 19 Sep, 2016 1 commit
  20. 28 Jun, 2016 3 commits
  21. 10 Jun, 2016 1 commit
    • Ben Dooks's avatar
      stmmac: fix parameter to dwmac4_set_umac_addr() · ca8bdaf1
      Ben Dooks authored
      
      
      The dwmac4_set_umac_addr() takes a struct mac_device_info as
      the first parameter, but is being passed a ioaddr instead from
      dwmac4_set_filter(). Fix the warning/bug by changing the first
      parameter.
      
      drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:159:46: warning: incorrect type in argument 1 (different address spaces)
      drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:159:46:    expected struct mac_device_info *hw
      drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c:159:46:    got void [noderef] <asn:2>*ioaddr
      
      Note, only compile tested this as do not have any
      hardware with it in.
      
      Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Acked-by: default avatarGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ca8bdaf1
  22. 03 Apr, 2016 1 commit