• Vladimir Oltean's avatar
    net: dsa: ocelot: add driver for Felix switch family · 56051948
    Vladimir Oltean authored
    This supports an Ethernet switching core from Vitesse / Microsemi /
    Microchip (VSC9959) which is part of the Ocelot family (a brand name),
    and whose code name is Felix. The switch can be (and is) integrated on
    different SoCs as a PCIe endpoint device.
    
    The functionality is provided by the core of the Ocelot switch driver
    (drivers/net/ethernet/mscc). In this regard, the current driver is an
    instance of Microsemi's Ocelot core driver, with a DSA front-end. It
    inherits its name from VSC9959's code name, to distinguish itself from
    the switchdev ocelot driver.
    
    The patch adds the logic for probing a PCI device and defines the
    register map for the VSC9959 switch core, since it has some differences
    in register addresses and bitfield mappings compared to the other Ocelot
    switches (VSC7511, VSC7512, VSC7513, VSC7514).
    
    The Felix driver declares the register map as part of the "instance
    table". Currently the VSC9959 inside NXP LS1028A is the only instance,
    but presumably it can support other switches in the Ocelot family, when
    used in DSA mode (Linux running on the external CPU, and not on the
    embedded MIPS).
    
    In a few cases, some h/w operations have to be done differently on
    VSC9959 due to missing bitfields.  This is the case for the switch core
    reset and init.  Because for this operation Ocelot uses some bits that
    are not present on Felix, the latter has to use a register from the
    global registers block (GCB) instead.
    
    Although it is a PCI driver, it relies on DT bindings for compatibility
    with DSA (CPU port link, PHY library). It does not have any custom
    device tree bindings, since we would like to minimize its dependency on
    device tree though.
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    56051948
felix.c 10.2 KB