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: 105216 Bytes
after  size: 94474  Bytes
save   size: 10742  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
committed by Tao Huang
parent c66b7345f6
commit aab3af8ad0
3 changed files with 24 additions and 2 deletions

View File

@@ -108,6 +108,16 @@ config DWMAC_ROCKCHIP
This selects the Rockchip RK3288 SoC glue layer support for
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
tristate "SOCFPGA dwmac support"
default (ARCH_SOCFPGA || ARCH_STRATIX10)

View File

@@ -16,7 +16,8 @@ obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o
obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o
obj-$(CONFIG_DWMAC_OXNAS) += dwmac-oxnas.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_STI) += dwmac-sti.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);
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_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
int dwmac_rk_get_rgmii_delayline_from_vendor(struct stmmac_priv *priv);
@@ -22,4 +34,3 @@ int dwmac_rk_search_rgmii_delayline(struct stmmac_priv *priv);
#endif
#endif /* __DWMAC_RK_TOOL_H__ */