net: ethernet: stmmac: dwmac-rk: Add config option for dwmac-rk-tool

Add this config option to reduce memory usage, if it was not necessary.

./ksize.sh drivers/net/ethernet/stmicro/

before size: 131758 Bytes
after  size: 121861 Bytes
save   size: 9897   Bytes

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: I96c88d5eb5109fc956a85b8685e1746d76545a87
This commit is contained in:
David Wu
2021-09-17 15:28:28 +08:00
parent 9285917d7b
commit defb18abcd
3 changed files with 24 additions and 1 deletions

View File

@@ -138,6 +138,16 @@ config DWMAC_ROCKCHIP
This selects the Rockchip RK3288 SoC glue layer support for This selects the Rockchip RK3288 SoC glue layer support for
the stmmac device driver. the stmmac device driver.
config DWMAC_ROCKCHIP_TOOL
bool "Rockchip dwmac tool support"
depends on DWMAC_ROCKCHIP
default DWMAC_ROCKCHIP
help
Support for Ethernet functions on Rockchip SoCs.
This selects the features for Rockchip's Ethernet, include PHY loopback,
MAC loopback, and delayline scanning of RGMII mode.
config DWMAC_SOCFPGA config DWMAC_SOCFPGA
tristate "SOCFPGA dwmac support" tristate "SOCFPGA dwmac support"
default (ARCH_SOCFPGA || ARCH_STRATIX10) default (ARCH_SOCFPGA || ARCH_STRATIX10)

View File

@@ -20,7 +20,8 @@ obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o
obj-$(CONFIG_DWMAC_OXNAS) += dwmac-oxnas.o obj-$(CONFIG_DWMAC_OXNAS) += dwmac-oxnas.o
obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o
obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rockchip.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rockchip.o
dwmac-rockchip-objs := dwmac-rk.o dwmac-rk-tool.o dwmac-rockchip-objs := dwmac-rk.o
dwmac-rockchip-$(CONFIG_DWMAC_ROCKCHIP_TOOL) += dwmac-rk-tool.o
obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o
obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o
obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o

View File

@@ -13,8 +13,20 @@ void dwmac_rk_set_rgmii_delayline(struct stmmac_priv *priv, int tx_delay, int rx
void dwmac_rk_get_rgmii_delayline(struct stmmac_priv *priv, int *tx_delay, int *rx_delay); void dwmac_rk_get_rgmii_delayline(struct stmmac_priv *priv, int *tx_delay, int *rx_delay);
int dwmac_rk_get_phy_interface(struct stmmac_priv *priv); int dwmac_rk_get_phy_interface(struct stmmac_priv *priv);
#ifdef CONFIG_DWMAC_ROCKCHIP_TOOL
int dwmac_rk_create_loopback_sysfs(struct device *dev); int dwmac_rk_create_loopback_sysfs(struct device *dev);
int dwmac_rk_remove_loopback_sysfs(struct device *device); int dwmac_rk_remove_loopback_sysfs(struct device *device);
#else
static inline int dwmac_rk_create_loopback_sysfs(struct device *dev)
{
return 0;
}
static inline int dwmac_rk_remove_loopback_sysfs(struct device *device)
{
return 0;
}
#endif
#ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE #ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
int dwmac_rk_get_rgmii_delayline_from_vendor(struct stmmac_priv *priv); int dwmac_rk_get_rgmii_delayline_from_vendor(struct stmmac_priv *priv);