for the stmmac device driver. This driver is used for
          arria5 and cyclone5 FPGA SoCs.
 
+config DWMAC_STI
+       tristate "STi GMAC support"
+       default ARCH_STI
+       depends on OF
+       select MFD_SYSCON
+       ---help---
+         Support for ethernet controller on STi SOCs.
+
+         This selects STi SoC glue layer support for the stmmac
+         device driver. This driver is used on for the STi series
+         SOCs GMAC ethernet controller.
+
 endif
 
 config STMMAC_PCI
 
 obj-$(CONFIG_DWMAC_MESON)      += dwmac-meson.o
 obj-$(CONFIG_DWMAC_ROCKCHIP)   += dwmac-rk.o
 obj-$(CONFIG_DWMAC_SOCFPGA)    += dwmac-socfpga.o
+obj-$(CONFIG_DWMAC_STI)                += dwmac-sti.o
 obj-$(CONFIG_DWMAC_GENERIC)    += dwmac-generic.o
 stmmac-platform-objs:= stmmac_platform.o dwmac-sunxi.o \
-                      dwmac-sti.o
 
 obj-$(CONFIG_STMMAC_PCI) += stmmac-pci.o
 stmmac-pci-objs:= stmmac_pci.o
 
 #include <linux/stmmac.h>
 #include <linux/phy.h>
 #include <linux/mfd/syscon.h>
+#include <linux/module.h>
 #include <linux/regmap.h>
 #include <linux/clk.h>
 #include <linux/of.h>
        return dwmac;
 }
 
-const struct stmmac_of_data stih4xx_dwmac_data = {
+static const struct stmmac_of_data stih4xx_dwmac_data = {
        .fix_mac_speed = stih4xx_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stix4xx_init,
        .exit = sti_dwmac_exit,
 };
 
-const struct stmmac_of_data stid127_dwmac_data = {
+static const struct stmmac_of_data stid127_dwmac_data = {
        .fix_mac_speed = stid127_fix_retime_src,
        .setup = sti_dwmac_setup,
        .init = stid127_init,
        .exit = sti_dwmac_exit,
 };
+
+static const struct of_device_id sti_dwmac_match[] = {
+       { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
+       { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
+       { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
+       { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
+       { }
+};
+MODULE_DEVICE_TABLE(of, sti_dwmac_match);
+
+static struct platform_driver sti_dwmac_driver = {
+       .probe  = stmmac_pltfr_probe,
+       .remove = stmmac_pltfr_remove,
+       .driver = {
+               .name           = "sti-dwmac",
+               .pm             = &stmmac_pltfr_pm_ops,
+               .of_match_table = sti_dwmac_match,
+       },
+};
+module_platform_driver(sti_dwmac_driver);
+
+MODULE_AUTHOR("Srinivas Kandagatla <srinivas.kandagatla@st.com>");
+MODULE_DESCRIPTION("STMicroelectronics DWMAC Specific Glue layer");
+MODULE_LICENSE("GPL");
 
 static const struct of_device_id stmmac_dt_ids[] = {
        /* SoC specific glue layers should come before generic bindings */
        { .compatible = "allwinner,sun7i-a20-gmac", .data = &sun7i_gmac_data},
-       { .compatible = "st,stih415-dwmac", .data = &stih4xx_dwmac_data},
-       { .compatible = "st,stih416-dwmac", .data = &stih4xx_dwmac_data},
-       { .compatible = "st,stid127-dwmac", .data = &stid127_dwmac_data},
-       { .compatible = "st,stih407-dwmac", .data = &stih4xx_dwmac_data},
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(of, stmmac_dt_ids);