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

Commit 242cd893 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: stmmac: Make code changes to support dlkm compilation"

parents c534c6d2 bbaefbdf
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -18,9 +18,8 @@ obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o
obj-$(CONFIG_DWMAC_MEDIATEK)	+= dwmac-mediatek.o
obj-$(CONFIG_DWMAC_MESON)	+= dwmac-meson.o dwmac-meson8b.o
obj-$(CONFIG_DWMAC_OXNAS)	+= dwmac-oxnas.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS)	+= dwmac-qcom-gpio.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS)	+= dwmac-qcom-ethqos.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS)	+= dwmac-qcom-pps.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-eth.o
dwmac-qcom-eth-objs := dwmac-qcom-ethqos.o dwmac-qcom-gpio.o dwmac-qcom-pps.o
obj-$(CONFIG_DWMAC_ROCKCHIP)	+= dwmac-rk.o
obj-$(CONFIG_DWMAC_SOCFPGA)	+= dwmac-altr-socfpga.o
obj-$(CONFIG_DWMAC_STI)		+= dwmac-sti.o
+27 −10
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@
#define AUTONEG_STATE_MASK 0x20
#define MICREL_LINK_UP_INTR_STATUS BIT(0)

bool phy_intr_en;
void *ipc_emac_log_ctxt;

struct emac_emb_smmu_cb_ctx emac_emb_smmu_ctx = {0};
@@ -1011,6 +1010,7 @@ static irqreturn_t ETHQOS_PHY_ISR(int irq, void *dev_data)
static int ethqos_phy_intr_enable(struct qcom_ethqos *ethqos)
{
	int ret = 0;
	struct stmmac_priv *priv = qcom_ethqos_get_priv(ethqos);

	INIT_WORK(&ethqos->emac_phy_work, ethqos_defer_phy_isr_work);
	init_completion(&ethqos->clk_enable_done);
@@ -1022,7 +1022,7 @@ static int ethqos_phy_intr_enable(struct qcom_ethqos *ethqos)
			  ethqos->phy_intr);
		return ret;
	}
	phy_intr_en = true;
	priv->plat->phy_intr_en_extn_stm = true;
	return ret;
}

@@ -1103,7 +1103,7 @@ static void qcom_ethqos_phy_suspend_clks(struct qcom_ethqos *ethqos)

	ETHQOSINFO("Enter\n");

	if (phy_intr_en)
	if (priv->plat->phy_intr_en_extn_stm)
		reinit_completion(&ethqos->clk_enable_done);

	ethqos->clks_suspended = 1;
@@ -1170,17 +1170,26 @@ static void qcom_ethqos_phy_resume_clks(struct qcom_ethqos *ethqos)

	ethqos->clks_suspended = 0;

	if (phy_intr_en)
	if (priv->plat->phy_intr_en_extn_stm)
		complete_all(&ethqos->clk_enable_done);

	ETHQOSINFO("Exit\n");
}

void qcom_ethqos_request_phy_wol(struct plat_stmmacenet_data *plat)
static void qcom_ethqos_request_phy_wol(void *plat_n)
{
	struct qcom_ethqos *ethqos = plat->bsp_priv;
	struct platform_device *pdev = ethqos->pdev;
	struct net_device *ndev = platform_get_drvdata(pdev);
	struct plat_stmmacenet_data *plat = plat_n;
	struct qcom_ethqos *ethqos;
	struct platform_device *pdev;
	struct net_device *ndev;

	if (!plat)
		return;

	ethqos = plat->bsp_priv;

	pdev = ethqos->pdev;
	ndev = platform_get_drvdata(pdev);

	ethqos->phy_wol_supported = 0;
	ethqos->phy_wol_wolopts = 0;
@@ -1629,6 +1638,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
	plat_dat->pmt = 1;
	plat_dat->tso_en = of_property_read_bool(np, "snps,tso");
	plat_dat->early_eth = ethqos->early_eth_enabled;
	plat_dat->handle_prv_ioctl = ethqos_handle_prv_ioctl;
	plat_dat->request_phy_wol = qcom_ethqos_request_phy_wol;
	plat_dat->init_pps = ethqos_init_pps;

	if (of_property_read_bool(pdev->dev.of_node,
				  "emac-core-version")) {
@@ -1661,6 +1673,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
		}
	}

	plat_dat->stmmac_emb_smmu_ctx = emac_emb_smmu_ctx;

	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
	if (ret)
		goto err_clk;
@@ -1717,6 +1731,7 @@ static int qcom_ethqos_remove(struct platform_device *pdev)
{
	struct qcom_ethqos *ethqos;
	int ret;
	struct stmmac_priv *priv;

	if (of_device_is_compatible(pdev->dev.of_node, "qcom,emac-smmu-embedded")) {
		of_platform_depopulate(&pdev->dev);
@@ -1727,13 +1742,15 @@ static int qcom_ethqos_remove(struct platform_device *pdev)
	if (!ethqos)
		return -ENODEV;

	priv = qcom_ethqos_get_priv(pethqos);

	ret = stmmac_pltfr_remove(pdev);
	clk_disable_unprepare(ethqos->rgmii_clk);

	if (phy_intr_en)
	if (priv->plat->phy_intr_en_extn_stm)
		free_irq(ethqos->phy_intr, ethqos);

	if (phy_intr_en)
	if (priv->plat->phy_intr_en_extn_stm)
		cancel_work_sync(&ethqos->emac_phy_work);

	if (ethqos->emac_ver == EMAC_HW_v2_3_2_RG)
+1 −1
Original line number Diff line number Diff line
@@ -310,5 +310,5 @@ struct dwmac_qcom_avb_algorithm {
void dwmac_qcom_program_avb_algorithm(struct stmmac_priv *priv,
				      struct ifr_data_struct *req);
unsigned int dwmac_qcom_get_plat_tx_coal_frames(struct sk_buff *skb);
void qcom_ethqos_request_phy_wol(struct plat_stmmacenet_data *plat);
int ethqos_init_pps(void *priv);
#endif
+7 −1
Original line number Diff line number Diff line
@@ -254,11 +254,17 @@ int ppsout_config(struct stmmac_priv *priv, struct pps_cfg *eth_pps_cfg)
	return 0;
}

int ethqos_init_pps(struct stmmac_priv *priv)
int ethqos_init_pps(void *priv_n)
{
	struct stmmac_priv *priv;
	u32 value;
	struct pps_cfg eth_pps_cfg = {0};

	if (!priv_n)
		return -ENODEV;

	priv = priv_n;

	priv->ptpaddr = priv->ioaddr + PTP_GMAC4_OFFSET;
	value = (PTP_TCR_TSENA | PTP_TCR_TSCFUPDT | PTP_TCR_TSUPDT);
	priv->hw->ptp->config_hw_tstamping(priv->ptpaddr, value);
+2 −21
Original line number Diff line number Diff line
@@ -249,27 +249,8 @@ enum stmmac_state {
	STMMAC_SERVICE_SCHED,
};

struct emac_emb_smmu_cb_ctx {
	bool valid;
	struct platform_device *pdev_master;
	struct platform_device *smmu_pdev;
	struct dma_iommu_mapping *mapping;
	struct iommu_domain *iommu_domain;
	u32 va_start;
	u32 va_size;
	u32 va_end;
	int ret;
};

extern struct emac_emb_smmu_cb_ctx emac_emb_smmu_ctx;

#define GET_MEM_PDEV_DEV (emac_emb_smmu_ctx.valid ? \
			&emac_emb_smmu_ctx.smmu_pdev->dev : priv->device)
int ethqos_handle_prv_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
int ethqos_init_pps(struct stmmac_priv *priv);

extern bool phy_intr_en;
void qcom_ethqos_request_phy_wol(struct plat_stmmacenet_data *plat_dat);
#define GET_MEM_PDEV_DEV (priv->plat->stmmac_emb_smmu_ctx.valid ? \
			&priv->plat->stmmac_emb_smmu_ctx.smmu_pdev->dev : priv->device)

int stmmac_mdio_unregister(struct net_device *ndev);
int stmmac_mdio_register(struct net_device *ndev);
Loading