@@ -442,6 +442,7 @@ static void common_default_data(struct plat_stmmacenet_data *plat)
static int intel_mgbe_common_data(struct pci_dev *pdev,
struct plat_stmmacenet_data *plat)
{
+ struct fwnode_handle *fwnode;
char clk_name[20];
int ret;
int i;
@@ -560,6 +561,20 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
/* Use the last Rx queue */
plat->vlan_fail_q = plat->rx_queues_to_use - 1;
+ /* For fixed-link setup, we allow phy-mode setting */
+ fwnode = dev_fwnode(&pdev->dev);
+ if (fwnode) {
+ const char *phy_mode;
+
+ if (!fwnode_property_read_string(fwnode, "phy-mode",
+ &phy_mode)) {
+ if (!strcmp(phy_mode, "sgmii"))
+ plat->phy_interface = PHY_INTERFACE_MODE_SGMII;
+ if (!strcmp(phy_mode, "1000base-x"))
+ plat->phy_interface = PHY_INTERFACE_MODE_1000BASEX;
+ }
+ }
+
/* Intel mgbe SGMII interface uses pcs-xcps */
if (plat->phy_interface == PHY_INTERFACE_MODE_SGMII ||
plat->phy_interface == PHY_INTERFACE_MODE_1000BASEX) {