diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 89ca65c38a5e..9feee63cf616 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -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 diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index 0244b5985309..83f69ae77bec 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -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 diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.c b/drivers/net/ethernet/stmicro/stmmac/hwif.c index 704b60ec57f9..da9772facf4e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.c +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.c @@ -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;