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

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

Merge "defconfig: sa515m: Enable STMMAC IPA Offload"

parents 5ce1fd9c eb85e41f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -222,6 +222,7 @@ CONFIG_RMNET=y
CONFIG_STMMAC_ETH=y
# CONFIG_DWMAC_GENERIC is not set
# CONFIG_DWMAC_IPQ806X is not set
CONFIG_ETHQOS_IPA_OFFLOAD=y
CONFIG_AT803X_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_PPP=y
+1 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ CONFIG_RMNET=y
CONFIG_STMMAC_ETH=y
# CONFIG_DWMAC_GENERIC is not set
# CONFIG_DWMAC_IPQ806X is not set
CONFIG_ETHQOS_IPA_OFFLOAD=y
CONFIG_AT803X_PHY=y
CONFIG_MICREL_PHY=y
CONFIG_PPP=y
+10 −0
Original line number Diff line number Diff line
@@ -107,6 +107,16 @@ config DWMAC_QCOM_ETHQOS
	  This selects the Qualcomm Technologies, Inc. ETHQOS glue layer support for the
	  stmmac device driver.

config ETHQOS_IPA_OFFLOAD
	bool "IPA ETHQOS offload support"
	depends on DWMAC_QCOM_ETHQOS && IPA3
	default n
	help
	  Support for the Qualcomm Technologies, Inc. ETH IPA offload support.
	  This enables ethernet ipa offload for IP traffic to reduce
	  the cpu load during E2E IP traffic. This is done by using HW accelaration
	  path.

config DWMAC_ROCKCHIP
	tristate "Rockchip dwmac support"
	default ARCH_ROCKCHIP
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ 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_ETHQOS_IPA_OFFLOAD)	+= dwmac-qcom-ipa.o
obj-$(CONFIG_DWMAC_ROCKCHIP)	+= dwmac-rk.o
obj-$(CONFIG_DWMAC_SOCFPGA)	+= dwmac-altr-socfpga.o
obj-$(CONFIG_DWMAC_STI)		+= dwmac-sti.o
@@ -28,6 +29,7 @@ stmmac-platform-objs:= stmmac_platform.o
dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o

ccflags-$(CONFIG_PTP_1588_CLOCK)+=-DCONFIG_PTPSUPPORT_OBJ
ccflags-$(CONFIG_ETHQOS_IPA_OFFLOAD)+=-DCONFIG_ETH_IPA_OFFLOAD

obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
stmmac-pci-objs:= stmmac_pci.o
+28 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include "stmmac_platform.h"
#include "dwmac-qcom-ethqos.h"
#include "stmmac_ptp.h"
#include "dwmac-qcom-ipa-offload.h"

static unsigned long tlmm_central_base_addr;
bool phy_intr_en;
@@ -838,6 +839,21 @@ static int ethqos_create_debugfs(struct qcom_ethqos *ethqos)
	return -ENOMEM;
}

static void ethqos_emac_mem_base(struct qcom_ethqos *ethqos)
{
	struct resource *resource = NULL;
	int ret = 0;

	resource = platform_get_resource(ethqos->pdev, IORESOURCE_MEM, 0);
	if (!resource) {
		ETHQOSERR("get emac-base resource failed\n");
		ret = -ENODEV;
		return;
	}
	ethqos->emac_mem_base = resource->start;
	ethqos->emac_mem_size = resource_size(resource);
}

static void emac_emb_smmu_exit(void)
{
	if (emac_emb_smmu_ctx.valid) {
@@ -1147,6 +1163,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
	struct stmmac_resources stmmac_res;
	struct qcom_ethqos *ethqos;
	struct resource *res;
	struct net_device *ndev;
	struct stmmac_priv *priv;
	int ret;

	ipc_emac_log_ctxt = ipc_log_context_create(IPCLOG_STATE_PAGES,
@@ -1228,7 +1246,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)

	ethqos->emac_ver = rgmii_readl(ethqos,
				       EMAC_I0_EMAC_CORE_HW_VERSION_RGOFFADDR);

	ethqos->ioaddr = (&stmmac_res)->addr;
	ethqos_update_rgmii_tx_drv_strength(ethqos);

	ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res);
@@ -1259,8 +1277,17 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
			  qcom_ethqos_qmp_mailbox_work);
		queue_work(system_wq, &ethqos->qmp_mailbox_work);
	}
	ethqos_emac_mem_base(ethqos);
	pethqos = ethqos;
	ethqos_create_debugfs(ethqos);

	ndev = dev_get_drvdata(&ethqos->pdev->dev);
	priv = netdev_priv(ndev);
#ifdef CONFIG_ETH_IPA_OFFLOAD
	ethqos->ipa_enabled = true;
	priv->rx_queue[IPA_DMA_RX_CH].skip_sw = true;
	priv->tx_queue[IPA_DMA_TX_CH].skip_sw = true;
#endif
	return ret;

err_clk:
Loading