Commit 65e0ace2 authored by Jie Deng's avatar Jie Deng Committed by David S. Miller

net: dwc-xlgmac: Initial driver for DesignWare Enterprise Ethernet

Synopsys provides a new DesignWare Core Enterprise Ethernet MAC
IP (DWC-XLGMAC) for Ethernet designs. It is compliant with the
IEEE 802.3-2012 specifications, including IEEE 802.3ba and
consortium specifications.

This patch provides the initial 25G/40G/50G/100G Ethernet driver
for Synopsys XLGMAC IP Prototyping Kit.
Signed-off-by: default avatarJie Deng <jiedeng@synopsys.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 24d79ce0
...@@ -11068,6 +11068,12 @@ F: include/linux/dma/dw.h ...@@ -11068,6 +11068,12 @@ F: include/linux/dma/dw.h
F: include/linux/platform_data/dma-dw.h F: include/linux/platform_data/dma-dw.h
F: drivers/dma/dw/ F: drivers/dma/dw/
SYNOPSYS DESIGNWARE ENTERPRISE ETHERNET DRIVER
M: Jie Deng <jiedeng@synopsys.com>
L: netdev@vger.kernel.org
S: Supported
F: drivers/net/ethernet/synopsys/
SYNOPSYS DESIGNWARE I2C DRIVER SYNOPSYS DESIGNWARE I2C DRIVER
M: Jarkko Nikula <jarkko.nikula@linux.intel.com> M: Jarkko Nikula <jarkko.nikula@linux.intel.com>
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
......
...@@ -180,5 +180,6 @@ source "drivers/net/ethernet/via/Kconfig" ...@@ -180,5 +180,6 @@ source "drivers/net/ethernet/via/Kconfig"
source "drivers/net/ethernet/wiznet/Kconfig" source "drivers/net/ethernet/wiznet/Kconfig"
source "drivers/net/ethernet/xilinx/Kconfig" source "drivers/net/ethernet/xilinx/Kconfig"
source "drivers/net/ethernet/xircom/Kconfig" source "drivers/net/ethernet/xircom/Kconfig"
source "drivers/net/ethernet/synopsys/Kconfig"
endif # ETHERNET endif # ETHERNET
...@@ -91,3 +91,4 @@ obj-$(CONFIG_NET_VENDOR_VIA) += via/ ...@@ -91,3 +91,4 @@ obj-$(CONFIG_NET_VENDOR_VIA) += via/
obj-$(CONFIG_NET_VENDOR_WIZNET) += wiznet/ obj-$(CONFIG_NET_VENDOR_WIZNET) += wiznet/
obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/ obj-$(CONFIG_NET_VENDOR_XILINX) += xilinx/
obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/ obj-$(CONFIG_NET_VENDOR_XIRCOM) += xircom/
obj-$(CONFIG_NET_VENDOR_SYNOPSYS) += synopsys/
#
# Synopsys network device configuration
#
config NET_VENDOR_SYNOPSYS
bool "Synopsys devices"
default y
---help---
If you have a network (Ethernet) device belonging to this class, say Y.
Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about Synopsys devices. If you say Y, you will be asked
for your specific device in the following questions.
if NET_VENDOR_SYNOPSYS
config DWC_XLGMAC
tristate "Synopsys DWC Enterprise Ethernet (XLGMAC) driver support"
depends on HAS_IOMEM && HAS_DMA
select BITREVERSE
select CRC32
---help---
This driver supports the Synopsys DesignWare Cores Enterprise
Ethernet (dwc-xlgmac).
if DWC_XLGMAC
config DWC_XLGMAC_PCI
tristate "XLGMAC PCI bus support"
depends on DWC_XLGMAC && PCI
---help---
This selects the pci bus support for the dwc-xlgmac driver.
This driver was tested on Synopsys XLGMAC IP Prototyping Kit.
If you have a controller with this interface, say Y or M here.
If unsure, say N.
endif # DWC_XLGMAC
endif # NET_VENDOR_SYNOPSYS
#
# Makefile for the Synopsys network device drivers.
#
obj-$(CONFIG_DWC_XLGMAC) += dwc-xlgmac.o
dwc-xlgmac-objs := dwc-xlgmac-net.o dwc-xlgmac-desc.o \
dwc-xlgmac-hw.o dwc-xlgmac-common.o
dwc-xlgmac-$(CONFIG_DWC_XLGMAC_PCI) += dwc-xlgmac-pci.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Synopsys DesignWare Core Enterprise Ethernet (XLGMAC) Driver
*
* Copyright (c) 2017 Synopsys, Inc. (www.synopsys.com)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This Synopsys DWC XLGMAC software driver and associated documentation
* (hereinafter the "Software") is an unsupported proprietary work of
* Synopsys, Inc. unless otherwise expressly agreed to in writing between
* Synopsys and you. The Software IS NOT an item of Licensed Software or a
* Licensed Product under any End User Software License Agreement or
* Agreement for Licensed Products with Synopsys or any supplement thereto.
* Synopsys is a registered trademark of Synopsys, Inc. Other names included
* in the SOFTWARE may be the trademarks of their respective owners.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include "dwc-xlgmac.h"
#include "dwc-xlgmac-reg.h"
static int xlgmac_probe(struct pci_dev *pcidev, const struct pci_device_id *id)
{
struct device *dev = &pcidev->dev;
struct xlgmac_resources res;
int i, ret;
ret = pcim_enable_device(pcidev);
if (ret) {
dev_err(dev, "ERROR: failed to enable device\n");
return ret;
}
for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
if (pci_resource_len(pcidev, i) == 0)
continue;
ret = pcim_iomap_regions(pcidev, BIT(i), XLGMAC_DRV_NAME);
if (ret)
return ret;
break;
}
pci_set_master(pcidev);
memset(&res, 0, sizeof(res));
res.irq = pcidev->irq;
res.addr = pcim_iomap_table(pcidev)[i];
return xlgmac_drv_probe(&pcidev->dev, &res);
}
static void xlgmac_remove(struct pci_dev *pcidev)
{
xlgmac_drv_remove(&pcidev->dev);
}
static const struct pci_device_id xlgmac_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYNOPSYS, 0x7302) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, xlgmac_pci_tbl);
static struct pci_driver xlgmac_pci_driver = {
.name = XLGMAC_DRV_NAME,
.id_table = xlgmac_pci_tbl,
.probe = xlgmac_probe,
.remove = xlgmac_remove,
};
module_pci_driver(xlgmac_pci_driver);
MODULE_DESCRIPTION(XLGMAC_DRV_DESC);
MODULE_VERSION(XLGMAC_DRV_VERSION);
MODULE_AUTHOR("Jie Deng <jiedeng@synopsys.com>");
MODULE_LICENSE("Dual BSD/GPL");
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment