• Vladimir Oltean's avatar
    net: mscc: ocelot: generalize existing code for VCAP · c1c3993e
    Vladimir Oltean authored
    In the Ocelot switches there are 3 TCAMs: VCAP ES0, IS1 and IS2, which
    have the same configuration interface, but different sets of keys and
    actions. The driver currently only supports VCAP IS2.
    
    In preparation of VCAP IS1 and ES0 support, the existing code must be
    generalized to work with any VCAP.
    
    In that direction, we should move the structures that depend upon VCAP
    instantiation, like vcap_is2_keys and vcap_is2_actions, out of struct
    ocelot and into struct vcap_props .keys and .actions, a structure that
    is replicated 3 times, once per VCAP. We'll pass that structure as an
    argument to each function that does the key and action packing - only
    the control logic needs to distinguish between ocelot->vcap[VCAP_IS2]
    or IS1 or ES0.
    
    Another change is to make use of the newly introduced ocelot_target_read
    and ocelot_target_write API, since the 3 VCAPs have the same registers
    but put at different addresses.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c1c3993e
ocelot.h 21.2 KB