17 Jul, 2020

1 commit

  • Having the users of MSCC_OCELOT_SWITCH_LIB depend on REGMAP_MMIO was a
    bad idea, since that symbol is not user-selectable. So we should have
    kept a 'select REGMAP_MMIO'.

    When we do that, we run into 2 more problems:

    - By depending on GENERIC_PHY, we are causing a recursive dependency.
    But it looks like GENERIC_PHY has no other dependencies, and other
    drivers select it, so we can select it too:

    drivers/of/Kconfig:69:error: recursive dependency detected!
    drivers/of/Kconfig:69: symbol OF_IRQ depends on IRQ_DOMAIN
    kernel/irq/Kconfig:68: symbol IRQ_DOMAIN is selected by REGMAP
    drivers/base/regmap/Kconfig:7: symbol REGMAP default is visible depending on REGMAP_MMIO
    drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
    drivers/net/ethernet/mscc/Kconfig:15: symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
    drivers/net/ethernet/mscc/Kconfig:22: symbol MSCC_OCELOT_SWITCH depends on GENERIC_PHY
    drivers/phy/Kconfig:8: symbol GENERIC_PHY is selected by PHY_BCM_NS_USB3
    drivers/phy/broadcom/Kconfig:41: symbol PHY_BCM_NS_USB3 depends on MDIO_BUS
    drivers/net/phy/Kconfig:13: symbol MDIO_BUS depends on MDIO_DEVICE
    drivers/net/phy/Kconfig:6: symbol MDIO_DEVICE is selected by PHYLIB
    drivers/net/phy/Kconfig:254: symbol PHYLIB is selected by ARC_EMAC_CORE
    drivers/net/ethernet/arc/Kconfig:19: symbol ARC_EMAC_CORE is selected by ARC_EMAC
    drivers/net/ethernet/arc/Kconfig:25: symbol ARC_EMAC depends on OF_IRQ

    - By depending on PHYLIB, we are causing a recursive dependency. PHYLIB
    only has a single dependency, "depends on NETDEVICES", which we are
    already depending on, so we can again hack our way into conformance by
    turning the PHYLIB dependency into a select.

    drivers/of/Kconfig:69:error: recursive dependency detected!
    drivers/of/Kconfig:69: symbol OF_IRQ depends on IRQ_DOMAIN
    kernel/irq/Kconfig:68: symbol IRQ_DOMAIN is selected by REGMAP
    drivers/base/regmap/Kconfig:7: symbol REGMAP default is visible depending on REGMAP_MMIO
    drivers/base/regmap/Kconfig:39: symbol REGMAP_MMIO is selected by MSCC_OCELOT_SWITCH_LIB
    drivers/net/ethernet/mscc/Kconfig:15: symbol MSCC_OCELOT_SWITCH_LIB is selected by MSCC_OCELOT_SWITCH
    drivers/net/ethernet/mscc/Kconfig:22: symbol MSCC_OCELOT_SWITCH depends on PHYLIB
    drivers/net/phy/Kconfig:254: symbol PHYLIB is selected by ARC_EMAC_CORE
    drivers/net/ethernet/arc/Kconfig:19: symbol ARC_EMAC_CORE is selected by ARC_EMAC
    drivers/net/ethernet/arc/Kconfig:25: symbol ARC_EMAC depends on OF_IRQ

    Fixes: f4d0323bae4e ("net: mscc: ocelot: convert MSCC_OCELOT_SWITCH into a library")
    Signed-off-by: Vladimir Oltean
    Signed-off-by: Jakub Kicinski

    Vladimir Oltean
     

21 Jun, 2020

2 commits

  • Putting 'ocelot' in the config's name twice just to say that 'it's the
    ocelot driver running on the ocelot SoC' is a bit confusing. Instead,
    it's just the ocelot driver. Now that we've renamed the previous symbol
    that was holding the MSCC_OCELOT_SWITCH_OCELOT into *_LIB (because
    that's what it is), we're free to use this name for the driver.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     
  • Hide the CONFIG_MSCC_OCELOT_SWITCH option from users. It is meant to be
    only a hardware library which is selected by the drivers that use it
    (ocelot, felix).

    Since it is "selected" from Kconfig, all its dependencies are manually
    transferred to the driver that selects it. This is because "select" in
    Kconfig language is a bit of a mess, and doesn't handle dependencies of
    selected options quite right.

    Signed-off-by: Vladimir Oltean
    Signed-off-by: David S. Miller

    Vladimir Oltean
     

06 Oct, 2018

1 commit

  • Previously, the SerDes muxing was hardcoded to a given mode in the MAC
    controller driver. Now, the SerDes muxing is configured within the
    Device Tree and is enforced in the MAC controller driver so we can have
    a lot of different SerDes configurations.

    Make use of the SerDes PHYs in the MAC controller to set up the SerDes
    according to the SerDesswitch port mapping and the communication mode
    with the Ethernet PHY.

    Signed-off-by: Quentin Schulz
    Reviewed-by: Florian Fainelli
    Signed-off-by: David S. Miller

    Quentin Schulz
     

16 May, 2018

1 commit

  • Add a driver for Microsemi Ocelot Ethernet switch support.

    This makes two modules:
    mscc_ocelot_common handles all the common features that doesn't depend on
    how the switch is integrated in the SoC. Currently, it handles offloading
    bridging to the hardware. ocelot_io.c handles register accesses. This is
    unfortunately needed because the register layout is packed and then depends
    on the number of ports available on the switch. The register definition
    files are automatically generated.

    ocelot_board handles the switch integration on the SoC and on the board.

    Frame injection and extraction to/from the CPU port is currently done using
    register accesses which is quite slow. DMA is possible but the port is not
    able to absorb the whole switch bandwidth.

    Signed-off-by: Alexandre Belloni
    Reviewed-by: Andrew Lunn
    Signed-off-by: David S. Miller

    Alexandre Belloni