summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-08-11 13:43:03 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-08-11 13:43:03 +0200
commita64395f8d9771cd24149fc8699809a8b3775b34a (patch)
tree6c3bb423c9cfe8dea3f311d36417b20bbaa5216f /drivers
parentad4fa274907bbc78ebabb015b4351d5f9226f081 (diff)
parent444db2c93d7c6755de42a3a220feac6614a4a203 (diff)
downloadbarebox-a64395f8d9771cd24149fc8699809a8b3775b34a.tar.gz
barebox-a64395f8d9771cd24149fc8699809a8b3775b34a.tar.xz
Merge branch 'for-next/net-designware'
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/Kconfig64
-rw-r--r--drivers/net/designware_eqos.c11
-rw-r--r--drivers/net/designware_eqos.h2
-rw-r--r--drivers/net/designware_stm32.c9
-rw-r--r--drivers/net/designware_tegra186.c2
5 files changed, 36 insertions, 52 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 803444cc44..341d02a1da 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -55,71 +55,75 @@ config DRIVER_NET_DAVINCI_EMAC
select PHYLIB
config DRIVER_NET_DESIGNWARE
- bool "Designware Universal MAC1000 ethernet platform support"
+ bool "Designware DWMAC1000 Ethernet driver support" if COMPILE_TEST
depends on HAS_DMA
select PHYLIB
help
- This option enables support for the Synopsys
- Designware Core Univesal MAC 10M/100M/1G ethernet IP.
-
-if DRIVER_NET_DESIGNWARE
+ This option is selected by platform glue drivers that contain
+ a DWMAC1000-compatible Ethernet IP.
config DRIVER_NET_DESIGNWARE_GENERIC
- bool "Designware Universal MAC ethernet generic driver"
+ bool "Generic Synopsis Designware Ethernet driver"
+ select DRIVER_NET_DESIGNWARE
+ depends on HAS_DMA
help
- This option enables support for the Synopsys
- Designware Core Univesal MAC 10M/100M/1G ethernet IP on SoCFPGA.
+ This option enables support for the generic Synopsys
+ Designware Core Universal MAC 10M/100M/1G binding. Supported
+ are 3.70a and 3.72. Most integrations additionally require
+ access to platform-specific registers, e.g. for clocking.
+ If you are on such a platform, use the platform specific
+ driver instead.
config DRIVER_NET_DESIGNWARE_SOCFPGA
- bool "Designware Universal MAC ethernet driver for SoCFPGA platforms"
- depends on ARCH_SOCFPGA || COMPILE_TEST
+ bool "SOCFPGA Designware Ethernet driver"
+ depends on HAS_DMA && (ARCH_SOCFPGA || COMPILE_TEST)
+ select DRIVER_NET_DESIGNWARE
select MFD_SYSCON
select RESET_CONTROLLER
help
This option enables support for the Synopsys
- Designware Core Univesal MAC 10M/100M/1G ethernet IP on SoCFPGA.
+ Designware Core Universal MAC 10M/100M/1G Ethernet IP on SoCFPGA.
config DRIVER_NET_DESIGNWARE_STARFIVE
- bool "Designware Universal MAC ethernet driver for StarFive platforms"
- depends on SOC_STARFIVE || COMPILE_TEST
+ bool "StarFive Designware Ethernet driver"
+ depends on HAS_DMA && (SOC_STARFIVE || COMPILE_TEST)
+ select DRIVER_NET_DESIGNWARE
select MFD_SYSCON
help
This option enables support for the Synopsys
- Designware Core Univesal MAC 10M/100M/1G ethernet IP on StarFive.
-
-endif
+ Designware Core Universal MAC 10M/100M/1G Ethernet IP on StarFive.
config DRIVER_NET_DESIGNWARE_EQOS
- bool "Designware Designware Ethernet QoS support"
- depends on HAS_DMA
- depends on COMMON_CLK
- depends on OFTREE
+ bool "Designware EQOS (GMAC4) Ethernet driver support" if COMPILE_TEST
+ depends on HAS_DMA && OFTREE
select PHYLIB
help
This option enables support for the Synopsys
Designware Ethernet Quality-of-Service (GMAC4).
-if DRIVER_NET_DESIGNWARE_EQOS
-
config DRIVER_NET_DESIGNWARE_STM32
- bool "Designware EQOS STM32 driver"
+ bool "STM32 Designware Ethernet driver"
+ depends on HAS_DMA && COMMON_CLK && OFTREE && (ARCH_STM32MP || COMPILE_TEST)
+ select DRIVER_NET_DESIGNWARE_EQOS
select MFD_SYSCON
help
- This option enables support for the ethernet MAC on the STM32MP platforms.
+ This option enables support for the Ethernet MAC on the STM32MP platforms.
config DRIVER_NET_DESIGNWARE_TEGRA186
- bool "Designware Universal MAC ethernet driver for Tegra 186 platforms"
+ bool "Tegra 186/194 Designware Ethernet driver"
+ depends on HAS_DMA && COMMON_CLK && OFTREE && (ARCH_TEGRA || COMPILE_TEST)
+ select DRIVER_NET_DESIGNWARE_EQOS
select RESET_CONTROLLER
help
- This option enables support for the ethernet MAC on the Tegra186 & 194.
+ This option enables support for the Ethernet MAC on the Tegra186 & 194.
config DRIVER_NET_DESIGNWARE_ROCKCHIP
- bool "Designware Universal MAC ethernet driver for Rockchip platforms"
+ bool "Rockchip Designware Ethernet driver"
+ select DRIVER_NET_DESIGNWARE_EQOS
+ depends on HAS_DMA && COMMON_CLK && OFTREE && (ARCH_ROCKCHIP || COMPILE_TEST)
select MFD_SYSCON
help
- This option enables support for the ethernet MAC on different Rockchip SoCs
-
-endif
+ This option enables support for the Ethernet MAC on different Rockchip SoCs
config DRIVER_NET_DM9K
bool "Davicom dm9k[E|A|B] ethernet driver"
diff --git a/drivers/net/designware_eqos.c b/drivers/net/designware_eqos.c
index 6b372e4274..79b9979697 100644
--- a/drivers/net/designware_eqos.c
+++ b/drivers/net/designware_eqos.c
@@ -623,10 +623,6 @@ static int eqos_start(struct eth_device *edev)
last_rx_desc = (ulong)&eqos->rx_descs[(EQOS_DESCRIPTORS_RX - 1)];
writel(last_rx_desc, &eqos->dma_regs->ch0_rxdesc_tail_pointer);
- barrier();
-
- eqos->started = true;
-
return 0;
}
@@ -635,13 +631,6 @@ static void eqos_stop(struct eth_device *edev)
struct eqos *eqos = edev->priv;
int i;
- if (!eqos->started)
- return;
-
- eqos->started = false;
-
- barrier();
-
/* Disable TX DMA */
clrbits_le32(&eqos->dma_regs->ch0_tx_control,
EQOS_DMA_CH0_TX_CONTROL_ST);
diff --git a/drivers/net/designware_eqos.h b/drivers/net/designware_eqos.h
index be7bead09e..1b6b0400e1 100644
--- a/drivers/net/designware_eqos.h
+++ b/drivers/net/designware_eqos.h
@@ -60,13 +60,11 @@ struct eqos {
const struct eqos_ops *ops;
void *priv;
- bool started;
};
struct device_d;
int eqos_probe(struct device_d *dev, const struct eqos_ops *ops, void *priv);
void eqos_remove(struct device_d *dev);
-int eqos_reset(struct eqos *priv);
int eqos_get_ethaddr(struct eth_device *edev, unsigned char *mac);
int eqos_set_ethaddr(struct eth_device *edev, const unsigned char *mac);
diff --git a/drivers/net/designware_stm32.c b/drivers/net/designware_stm32.c
index 0a5ced98f5..43f2d0987c 100644
--- a/drivers/net/designware_stm32.c
+++ b/drivers/net/designware_stm32.c
@@ -163,14 +163,7 @@ static int eqos_init_stm32(struct device_d *dev, struct eqos *eqos)
dev_dbg(dev, "No phy clock provided. Continuing without.\n");
}
- ret = clk_bulk_enable(priv->num_clks, priv->clks);
- if (ret < 0) {
- eqos_err(eqos, "clk_bulk_enable() failed: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
+ return clk_bulk_enable(priv->num_clks, priv->clks);
}
static struct eqos_ops stm32_ops = {
diff --git a/drivers/net/designware_tegra186.c b/drivers/net/designware_tegra186.c
index 0241b9ad16..0cbbdb46a4 100644
--- a/drivers/net/designware_tegra186.c
+++ b/drivers/net/designware_tegra186.c
@@ -195,7 +195,7 @@ static int eqos_set_ethaddr_tegra186(struct eth_device *edev, const unsigned cha
* ported to some system where the expectation above is true.
*/
- if (!eqos->started) {
+ if (!edev->active) {
memcpy(eqos->macaddr, mac, 6);
return 0;
}