Hi Andrew, > We should read the switch registers. I think you can set the defaults > using strapping pins. And in general, the driver always reads state > from the hardware rather than caching it.
hmm. The cmode is cached for each port, though. For example mv88e6390x_port_set_cmode compares the new requested value with the cached one and doesn't do anything if they are equal. If mv88e6xxx_port_setup_mac can be called once per second by phylink as you say, do we really want to read the value via MDIO every time? We already have cmode cached (read from registers at mv88e6xxx_setup, and then changed when cmode change is requested). From cmode we can already differentiate mode in the terms of phy_interface_t, unless it is RGMII, in which case we would have to read RX/TX timing. Marek