1. 05 6月, 2019 2 次提交
    • R
      net: dsa: mv88e6xxx: implement port_link_state for mv88e6250 · ce91c453
      Rasmus Villemoes 提交于
      The mv88e6250 has a rather different way of reporting the link, speed
      and duplex status. A simple difference is that the link bit is bit 12
      rather than bit 11 of the port status register.
      
      It gets more complicated for speed and duplex, which do not have
      separate fields. Instead, there's a four-bit PortMode field, and
      decoding that depends on whether it's a phy or mii port. For the phy
      ports, only four of the 16 values have defined meaning; the rest are
      called "reserved", so returning {SPEED,DUPLEX}_UNKNOWN seems
      reasonable.
      
      For the mii ports, most possible values are documented (0x3 and 0x5
      are reserved), but I'm unable to make sense of them all. Since the
      bits simply reflect the Px_MODE[3:0] configuration pins, just support
      the subset that I'm certain about. Support for other setups can be
      added later.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce91c453
    • R
      net: dsa: mv88e6xxx: implement port_set_speed for mv88e6250 · a528e5be
      Rasmus Villemoes 提交于
      The data sheet also mentions the possibility of selecting 200 Mbps for
      the MII ports (ports 5 and 6) by setting the ForceSpd field to
      0x2 (aka MV88E6065_PORT_MAC_CTL_SPEED_200). However, there's a note
      that "actual speed is determined by bit 8 above", and flipping back a
      page, one finds that bits 13:8 are reserved...
      
      So without further information on what bit 8 means, let's stick to
      supporting just 10 and 100 Mbps on all ports.
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NRasmus Villemoes <rasmus.villemoes@prevas.dk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a528e5be
  2. 28 3月, 2019 1 次提交
    • H
      net: dsa: mv88e6xxx: fix few issues in mv88e6390x_port_set_cmode · 5ceaeb99
      Heiner Kallweit 提交于
      This patches fixes few issues in mv88e6390x_port_set_cmode().
      
      1. When entering the function the old cmode may be 0, in this case
         mv88e6390x_serdes_get_lane() returns -ENODEV. As result we bail
         out and have no chance to set a new mode. Therefore deal properly
         with -ENODEV.
      
      2. Once we have disabled power and irq, let's set the cached cmode to 0.
         This reflects the actual status and is cleaner if we bail out with an
         error in the following function calls.
      
      3. The cached cmode is used by mv88e6390x_serdes_get_lane(),
         mv88e6390_serdes_power_lane() and mv88e6390_serdes_irq_enable().
         Currently we set the cached mode to the new one at the very end of
         the function only, means until then we use the old one what may be
         wrong.
      
      4. When calling mv88e6390_serdes_irq_enable() we use the lane value
         belonging to the old cmode. Get the lane belonging to the new cmode
         before calling this function.
      
      It's hard to provide a good "Fixes" tag because quite a few smaller
      changes have been done to the code in question recently.
      
      Fixes: d235c48b ("net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X")
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5ceaeb99
  3. 09 3月, 2019 1 次提交
  4. 04 3月, 2019 1 次提交
  5. 02 3月, 2019 1 次提交
    • H
      net: dsa: mv88e6xxx: prevent interrupt storm caused by mv88e6390x_port_set_cmode · ed8fe202
      Heiner Kallweit 提交于
      When debugging another issue I faced an interrupt storm in this
      driver (88E6390, port 9 in SGMII mode), consisting of alternating
      link-up / link-down interrupts. Analysis showed that the driver
      wanted to set a cmode that was set already. But so far
      mv88e6390x_port_set_cmode() doesn't check this and powers down
      SERDES, what causes the link to break, and eventually results in
      the described interrupt storm.
      
      Fix this by checking whether the cmode actually changes. We want
      that the very first call to mv88e6390x_port_set_cmode() always
      configures the registers, therefore initialize port.cmode with
      a value that is different from any supported cmode value.
      We have to take care that we only init the ports cmode once
      chip->info->num_ports is set.
      
      v2:
      - add small helper and init the number of actual ports only
      
      Fixes: 364e9d77 ("net: dsa: mv88e6xxx: Power on/off SERDES on cmode change")
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed8fe202
  6. 01 3月, 2019 1 次提交
    • M
      net: dsa: mv88e6xxx: power serdes on/off for 10G interfaces on 6390X · d235c48b
      Maxime Chevallier 提交于
      Upon setting the cmode on 6390 and 6390X, the associated serdes
      interfaces must be powered off/on.
      
      Both 6390X and 6390 share code to do so, but it currently uses the 6390
      specific helper mv88e6390_serdes_power() to disable and enable the
      serdes interface.
      
      This call will fail silently on 6390X when trying so set a 10G interface
      such as XAUI or RXAUI, since mv88e6390_serdes_power() internally grabs
      the lane number based on modes supported by the 6390, and returns 0 when
      getting -ENODEV as a lane number.
      
      Using mv88e6390x_serdes_power() should be safe here, since we explicitly
      rule-out all ports but the 9 and 10, and because modes supported by 6390
      ports 9 and 10 are a subset of those supported on 6390X.
      
      This was tested on 6390X using RXAUI mode.
      
      Fixes: 364e9d77 ("net: dsa: mv88e6xxx: Power on/off SERDES on cmode change")
      Signed-off-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d235c48b
  7. 26 2月, 2019 1 次提交
  8. 12 11月, 2018 2 次提交
    • A
      net: dsa: mv88e6xxx: Default ports 9/10 6390X CMODE to 1000BaseX · 787799a9
      Andrew Lunn 提交于
      The 6390X family has 8 SERDES interfaces. This allows ports 9 and 10
      to support up to 10Gbps using 4 SERDES interfaces. However, when lower
      speeds are used, which need fewer SERDES interfaces, the unused SERDES
      interfaces can be used by ports 2-8.
      
      The hardware defaults to ports 9 and 10 having all 4 SERDES interfaces
      assigned to them. This only gets changed when the interface is
      configured after what the SFP supports has been determined, or the 10G
      PHY completes auto-neg.
      
      For hardware designs which limit ports 9 and 10 to one or two SERDES
      interfaces, and place SFPs on the lower interfaces, this is too
      late. Those ports with SFP should not wait until ports 9/10 are up in
      order to get access to the SERDES interface. So change the default
      configuration when the driver is initialised. Configure ports 9 and 10
      to 1000BaseX, so they use a single SERDES interface, freeing up the
      others. They can steal them back if they need them.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      787799a9
    • A
      net: dsa: mv88e6xxx: Differentiate between 6390 and 6390X cmodes · fdc71eea
      Andrew Lunn 提交于
      The X family variants support additional ports modes, for 10G
      operation, which the non-X variants don't have. Add a port_set_cmode()
      for non-X variants to enforce this.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fdc71eea
  9. 18 10月, 2018 1 次提交
  10. 10 8月, 2018 5 次提交
  11. 12 5月, 2018 1 次提交
  12. 14 12月, 2017 1 次提交
  13. 02 8月, 2017 1 次提交
  14. 19 7月, 2017 1 次提交
  15. 21 6月, 2017 1 次提交
  16. 13 6月, 2017 11 次提交
  17. 10 6月, 2017 5 次提交
  18. 07 6月, 2017 1 次提交
  19. 05 6月, 2017 1 次提交
  20. 29 3月, 2017 1 次提交