Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a95d79c6 authored by Suraj Jaiswal's avatar Suraj Jaiswal Committed by Gerrit - the friendly Code Review server
Browse files

data-kernel: EMAC: Etherent phy detection optimization.



Read phy address from dtis to avoid dynamic phy
detection which will reduce ethernet initialization
time.

Change-Id: I95e4386e98bebf9a71aa186b3ebd20cea758c7db
Signed-off-by: default avatarSunil Paidimarri <hisunil@codeaurora.org>
parent bdc07671
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -1250,6 +1250,21 @@ int DWC_ETH_QOS_mdio_register(struct net_device *dev)

	DBGPR_MDIO("-->DWC_ETH_QOS_mdio_register\n");

	if (pdata->res_data->phy_addr != -1) {
		phy_reg_read_status =
		   DWC_ETH_QOS_mdio_read_direct(pdata, pdata->res_data->phy_addr, MII_BMSR,
										&mii_status);
		if (phy_reg_read_status == 0) {
			if (mii_status != 0x0000 && mii_status != 0xffff) {
				phy_detected = 1;
				phyaddr = pdata->res_data->phy_addr;
				EMACINFO("skip_phy_detection (phyaddr)%d\n", phyaddr);
				goto skip_phy_detection;
			} else
				EMACERR("Invlaid phy address specified in device tree\n");
		}
	}

	/* find the phy ID or phy address which is connected to our MAC */
	for (phyaddr = 0; phyaddr < 32; phyaddr++) {

@@ -1276,6 +1291,8 @@ int DWC_ETH_QOS_mdio_register(struct net_device *dev)
		return -ENOLINK;
	}

	skip_phy_detection:

	pdata->phyaddr = phyaddr;
	pdata->bus_id = 0x1;
	pdata->phy_intr_en = false;
+10 −0
Original line number Diff line number Diff line
@@ -920,6 +920,16 @@ static int DWC_ETH_QOS_get_dts_config(struct platform_device *pdev)
		dwc_eth_qos_res_data.is_pinctrl_names = true;
		EMACDBG("qcom,pinctrl-names present\n");
	}
	dwc_eth_qos_res_data.phy_addr = -1;
	if (of_property_read_bool(pdev->dev.of_node, "emac-phy-addr")) {
		ret = of_property_read_u32(pdev->dev.of_node, "emac-phy-addr",
			&dwc_eth_qos_res_data.phy_addr);
		if (ret) {
			EMACINFO("Pphy_addr not specified, using dynamic phy detection\n");
			dwc_eth_qos_res_data.phy_addr = -1;
		}
		EMACINFO("phy_addr = %d\n", dwc_eth_qos_res_data.phy_addr);
	}

	return ret;

+1 −0
Original line number Diff line number Diff line
@@ -1584,6 +1584,7 @@ struct DWC_ETH_QOS_res_data {
	unsigned int emac_hw_version_type;
	bool early_eth_en;
	bool pps_lpass_conn_en;
	int phy_addr;
};

struct DWC_ETH_QOS_prv_ipa_data {