mac_interface has served little purpose, and has only caused confusion.
Now that we have cleaned up all platform glue drivers which should not
have been using mac_interface, there are no users remaining. Remove
mac_interface.
This results in the special dwmac specific "mac-mode" DT property
becoming redundant, and an in case, no DTS files in the kernel make use
of this property. Add a warning if the property is set, and it is
different from the "phy-mode".
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
Link: https://patch.msgid.link/E1uytpv-00000006H2x-196h@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
/* Set default value for multicast hash bins */
plat->multicast_filter_bins = 256;
- plat->mac_interface = PHY_INTERFACE_MODE_NA;
-
/* Set default value for unicast filter entries */
plat->unicast_filter_entries = 1;
if (IS_ERR(plat_dat))
return PTR_ERR(plat_dat);
- plat_dat->mac_interface = PHY_INTERFACE_MODE_NA;
plat_dat->has_gmac = true;
reg = syscon_regmap_lookup_by_compatible("nxp,lpc1850-creg");
*/
static void stmmac_check_pcs_mode(struct stmmac_priv *priv)
{
- int interface = priv->plat->mac_interface;
-
- if (interface == PHY_INTERFACE_MODE_NA)
- interface = priv->plat->phy_interface;
+ int interface = priv->plat->phy_interface;
if (priv->dma_cap.pcs) {
if ((interface == PHY_INTERFACE_MODE_RGMII) ||
return ERR_PTR(phy_mode);
plat->phy_interface = phy_mode;
+
rc = stmmac_of_get_mac_mode(np);
- plat->mac_interface = rc < 0 ? plat->phy_interface : rc;
+ if (rc >= 0 && rc != phy_mode)
+ dev_warn(&pdev->dev,
+ "\"mac-mode\" property used for %s but differs to \"phy-mode\" of %s, and will be ignored. Please report.\n",
+ phy_modes(rc), phy_modes(phy_mode));
/* Some wrapper drivers still rely on phy_node. Let's save it while
* they are not converted to phylink. */
int bus_id;
int phy_addr;
/* MAC ----- optional PCS ----- SerDes ----- optional PHY ----- Media
- * ^ ^
- * mac_interface phy_interface
+ * ^
+ * phy_interface
*
* The Synopsys dwmac core only covers the MAC and an optional
* integrated PCS. Where the integrated PCS is used with a SerDes,
* is used, this counts as "the rest of the SoC" in the above
* paragraph.
*
- * Thus, mac_interface is of little use inside the stmmac code;
- * please do not use unless there is a definite requirement, and
- * make sure to gain review feedback first.
- */
- phy_interface_t mac_interface;
- /* phy_interface is the PHY-side interface - the interface used by
+ * phy_interface is the PHY-side interface - the interface used by
* an attached PHY or SFP etc. This is equivalent to the interface
* that phylink uses.
*/