• Vladimir Oltean's avatar
    net: dsa: felix: convert to the new .change_tag_protocol DSA API · adb3dccf
    Vladimir Oltean authored
    In expectation of the new tag_ocelot_8021q tagger implementation, we
    need to be able to do runtime switchover between one tagger and another.
    So we must structure the existing code for the current NPI-based tagger
    in a certain way.
    
    We move the felix_npi_port_init function in expectation of the future
    driver configuration necessary for tag_ocelot_8021q: we would like to
    not have the NPI-related bits interspersed with the tag_8021q bits.
    
    The conversion from this:
    
    	ocelot_write_rix(ocelot,
    			 ANA_PGID_PGID_PGID(GENMASK(ocelot->num_phys_ports, 0)),
    			 ANA_PGID_PGID, PGID_UC);
    
    to this:
    
    	cpu_flood = ANA_PGID_PGID_PGID(BIT(ocelot->num_phys_ports));
    	ocelot_rmw_rix(ocelot, cpu_flood, cpu_flood, ANA_PGID_PGID, PGID_UC);
    
    is perhaps non-trivial, but is nonetheless non-functional. The PGID_UC
    (replicator for unknown unicast) is already configured out of hardware
    reset to flood to all ports except ocelot->num_phys_ports (the CPU port
    module). All we change is that we use a read-modify-write to only add
    the CPU port module to the unknown unicast replicator, as opposed to
    doing a full write to the register.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    adb3dccf
felix_vsc9959.c 46.6 KB