
On 3/27/24 10:58 AM, MD Danish Anwar wrote:
This is the PRUSS Ethernet driver for TI AM654 Sr2.0 and laterSoCs with
s/Sr2.0/SR2.0 s/laterSoCs/later SoCs
the ICSSG PRU Sub-system running EMAC firmware. ICSSG Subsystem supports two slices per instance. This driver caters to both slices / ports of the icssg subsystem.
Since it is not possible for Ethernet driver to register more than one port for a given instance, this patch introduces top level PRUETH as UCLASS_MISC and binds UCLASS_ETH to individual ports in order to support bringing up more than one Ethernet interface in U-Boot.
Since top level driver is UCLASS_MISC, board files would need to instantiate the driver explicitly.
Signed-off-by: MD Danish Anwar danishanwar@ti.com
arch/arm/mach-k3/common.c | 11 + drivers/net/ti/Kconfig | 13 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg_prueth.c | 685 ++++++++++++++++++++++++++++++++++ drivers/net/ti/icssg_prueth.h | 3 + 5 files changed, 713 insertions(+) create mode 100644 drivers/net/ti/icssg_prueth.c
[...]
@@ -7,3 +7,4 @@ obj-$(CONFIG_DRIVER_TI_EMAC) += davinci_emac.o obj-$(CONFIG_DRIVER_TI_KEYSTONE_NET) += keystone_net.o cpsw_mdio.o obj-$(CONFIG_TI_AM65_CPSW_NUSS) += am65-cpsw-nuss.o obj-$(CONFIG_MDIO_TI_CPSW) += cpsw_mdio.o +obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg_prueth.o icssg_classifier.o icssg_config.o icssg_queues.o diff --git a/drivers/net/ti/icssg_prueth.c b/drivers/net/ti/icssg_prueth.c new file mode 100644 index 0000000000..d22a56c217 --- /dev/null +++ b/drivers/net/ti/icssg_prueth.c @@ -0,0 +1,685 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*
- Texas Instruments K3 AM65 PRU Ethernet Driver
- Copyright (C) 2018-2024, Texas Instruments, Incorporated
URL is missing.
- */
+#include <asm/io.h> +#include <asm/processor.h> +#include <clk.h> +#include <dm/lists.h> +#include <dm/device.h> +#include <dma-uclass.h> +#include <dm/of_access.h> +#include <dm/pinctrl.h> +#include <fs_loader.h> +#include <miiphy.h> +#include <net.h> +#include <phy.h> +#include <power-domain.h> +#include <linux/soc/ti/ti-udma.h> +#include <regmap.h> +#include <remoteproc.h> +#include <syscon.h> +#include <soc.h> +#include <linux/pruss_driver.h> +#include <dm/device_compat.h>
+#include "icssg_prueth.h" +#include "icss_mii_rt.h"
+#define ICSS_SLICE0 0 +#define ICSS_SLICE1 1
+#ifdef PKTSIZE_ALIGN +#define UDMA_RX_BUF_SIZE PKTSIZE_ALIGN +#else +#define UDMA_RX_BUF_SIZE ALIGN(1522, ARCH_DMA_MINALIGN)
PKTSIZE is defined in include/net.h as below #define PKTSIZE 1522 Please use the macro.
+#endif
[...]