• Vladimir Oltean's avatar
    net: dsa: sja1105: skip CGU configuration if it's unnecessary · c5037678
    Vladimir Oltean authored
    There are two distinct code paths which enter sja1105_clocking.c, one
    through sja1105_clocking_setup() and the other through
    sja1105_clocking_setup_port():
    
    sja1105_static_config_reload      sja1105_setup
                  |                         |
                  |      +------------------+
                  |      |
                  v      v
       sja1105_clocking_setup               sja1105_adjust_port_config
                     |                                   |
                     v                                   |
          sja1105_clocking_setup_port <------------------+
    
    As opposed to SJA1105, the SJA1110 does not need any configuration of
    the Clock Generation Unit in order for xMII ports to work. Just RGMII
    internal delays need to be configured, and that is done inside
    sja1105_clocking_setup_port for the RGMII ports.
    
    So this patch introduces the concept of a "reserved address", which the
    CGU configuration functions from sja1105_clocking.c must check before
    proceeding to do anything. The SJA1110 will have reserved addresses for
    the CGU PLLs for MII/RMII/RGMII.
    
    Additionally, make sja1105_clocking_setup() a function pointer so it can
    be overridden by the SJA1110. Even though nothing port-related needs to
    be done in the CGU, there are some operations such as disabling the
    watchdog clock which are unique to the SJA1110.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    c5037678
sja1105.h 10 KB