mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
net: ethernet: stmmac: Add STMMAC_MMC config option
Add this config option to reduce memory usage about 4388 bytes, if it was not necessary. Signed-off-by: David Wu <david.wu@rock-chips.com> Change-Id: Ia0cac913d226f97ea75b67d9c071ad1323a54535
This commit is contained in:
@@ -38,6 +38,12 @@ config STMMAC_FULL
|
||||
This selects the full function, default is Y, full-featured version
|
||||
includes 4.10 and other versions, if it is N, only 4.10 core working.
|
||||
|
||||
config STMMAC_MMC
|
||||
bool "Support mmc core for STMMAC"
|
||||
default STMMAC_ETH
|
||||
help
|
||||
This selects the stmmac mmc function, default is Y.
|
||||
|
||||
config STMMAC_PTP
|
||||
bool "PTP feature for STMMAC"
|
||||
default STMMAC_ETH
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
obj-$(CONFIG_STMMAC_ETH) += stmmac.o
|
||||
|
||||
stmmac-objs:= stmmac_main.o stmmac_mdio.o dwmac_lib.o \
|
||||
mmc_core.o dwmac4_descs.o dwmac4_dma.o \
|
||||
dwmac4_descs.o dwmac4_dma.o \
|
||||
dwmac4_lib.o dwmac4_core.o hwif.o \
|
||||
$(stmmac-y)
|
||||
|
||||
@@ -11,6 +11,7 @@ stmmac-$(CONFIG_STMMAC_FULL) += ring_mode.o chain_mode.o dwmac1000_core.o \
|
||||
enh_desc.o norm_desc.o dwmac5.o stmmac_tc.o \
|
||||
dwxgmac2_core.o dwxgmac2_dma.o dwxgmac2_descs.o
|
||||
|
||||
stmmac-$(CONFIG_STMMAC_MMC) +=mmc_core.o
|
||||
stmmac-$(CONFIG_STMMAC_SELFTESTS) += stmmac_selftests.o
|
||||
stmmac-$(CONFIG_STMMAC_ETHTOOL) += stmmac_ethtool.o
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
const void *mode;
|
||||
const void *tc;
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
const void *mmc;
|
||||
#endif
|
||||
int (*setup)(struct stmmac_priv *priv);
|
||||
int (*quirks)(struct stmmac_priv *priv);
|
||||
} stmmac_hw[] = {
|
||||
@@ -127,7 +129,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = NULL,
|
||||
.tc = NULL,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac100_setup,
|
||||
.quirks = stmmac_dwmac1_quirks,
|
||||
}, {
|
||||
@@ -147,7 +151,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = NULL,
|
||||
.tc = NULL,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac1000_setup,
|
||||
.quirks = stmmac_dwmac1_quirks,
|
||||
}, {
|
||||
@@ -167,7 +173,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = NULL,
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac4_setup,
|
||||
.quirks = stmmac_dwmac4_quirks,
|
||||
}, {
|
||||
@@ -187,7 +195,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = &dwmac4_ring_mode_ops,
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac4_setup,
|
||||
.quirks = NULL,
|
||||
},
|
||||
@@ -211,7 +221,10 @@ static const struct stmmac_hwif_entry {
|
||||
#ifdef CONFIG_STMMAC_FULL
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac4_setup,
|
||||
.quirks = NULL,
|
||||
},
|
||||
@@ -233,7 +246,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = &dwmac4_ring_mode_ops,
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwmac4_setup,
|
||||
.quirks = NULL,
|
||||
}, {
|
||||
@@ -254,7 +269,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = NULL,
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwxgmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwxgmac2_setup,
|
||||
.quirks = NULL,
|
||||
}, {
|
||||
@@ -275,7 +292,9 @@ static const struct stmmac_hwif_entry {
|
||||
#endif
|
||||
.mode = NULL,
|
||||
.tc = &dwmac510_tc_ops,
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
.mmc = &dwxgmac_mmc_ops,
|
||||
#endif
|
||||
.setup = dwxlgmac2_setup,
|
||||
.quirks = stmmac_dwxlgmac_quirks,
|
||||
},
|
||||
@@ -348,7 +367,9 @@ int stmmac_hwif_init(struct stmmac_priv *priv)
|
||||
#endif
|
||||
mac->mode = mac->mode ? : entry->mode;
|
||||
mac->tc = mac->tc ? : entry->tc;
|
||||
#ifdef CONFIG_STMMAC_MMC
|
||||
mac->mmc = mac->mmc ? : entry->mmc;
|
||||
#endif
|
||||
|
||||
priv->hw = mac;
|
||||
priv->ptpaddr = priv->ioaddr + entry->regs.ptp_off;
|
||||
|
||||
Reference in New Issue
Block a user