forked from Openwrt-EcoNet/openwrt
Add the second part of the PPE driver. This includes the EDMA and network device support. This part does not appear to have been officially submitted for upstream review. The series is taken from target/linux/qualcommbe/patches-6.6, and had to be heavily modified in order to compile of v6.12. Changes to patches are noted in the respective patch body. Also add the PPE and EDMA nodes in this series. Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Link: https://github.com/openwrt/openwrt/pull/18796 Signed-off-by: Robert Marko <robimarko@gmail.com>
49 lines
1.5 KiB
Diff
49 lines
1.5 KiB
Diff
From a809433c9b6a418dd886f12a5dcb3376f73bf2a7 Mon Sep 17 00:00:00 2001
|
|
From: Christian Marangi <ansuelsmth@gmail.com>
|
|
Date: Wed, 4 Dec 2024 01:37:05 +0100
|
|
Subject: [PATCH] net: ethernet: qualcomm: Add support for label property for
|
|
EDMA port
|
|
|
|
Add support for label property for EDMA port. This is useful to define
|
|
custom name in DTS for specific ethernet port instead of assigning a
|
|
dynamic name at runtime.
|
|
|
|
This also improve the log output by using modern APIs.
|
|
|
|
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
|
---
|
|
drivers/net/ethernet/qualcomm/ppe/edma_port.c | 18 +++++++++++++++---
|
|
1 file changed, 15 insertions(+), 3 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/qualcomm/ppe/edma_port.c
|
|
+++ b/drivers/net/ethernet/qualcomm/ppe/edma_port.c
|
|
@@ -355,13 +355,25 @@ int edma_port_setup(struct ppe_port *por
|
|
int port_id = port->port_id;
|
|
struct net_device *netdev;
|
|
u8 mac_addr[ETH_ALEN];
|
|
+ const char *name;
|
|
+ int assign_type;
|
|
int ret = 0;
|
|
u8 *maddr;
|
|
|
|
- netdev = alloc_etherdev_mqs(sizeof(struct edma_port_priv),
|
|
- EDMA_NETDEV_QUEUE_NUM, EDMA_NETDEV_QUEUE_NUM);
|
|
+ name = of_get_property(np, "label", NULL);
|
|
+ if (name) {
|
|
+ assign_type = NET_NAME_PREDICTABLE;
|
|
+ } else {
|
|
+ name = "eth%d";
|
|
+ assign_type = NET_NAME_ENUM;
|
|
+ }
|
|
+
|
|
+ netdev = alloc_netdev_mqs(sizeof(struct edma_port_priv),
|
|
+ name, assign_type,
|
|
+ ether_setup,
|
|
+ EDMA_NETDEV_QUEUE_NUM, EDMA_NETDEV_QUEUE_NUM);
|
|
if (!netdev) {
|
|
- pr_err("alloc_etherdev() failed\n");
|
|
+ dev_err(ppe_dev->dev, "alloc_netdev_mqs() failed\n");
|
|
return -ENOMEM;
|
|
}
|
|
|