Introduce ICSSG PRUETH support in uboot. The ICSSG driver is used in TI AM654 SR2.0.
The ICSSG PRU Sub-system runs on EMAC firmware. This series Introduces support for ICSSG driver in uboot. This series also adds the driver's dependencies. The ICSSG2 node is added in device tree overlay so that it remains in sync with linux kernel. The series introduces device tree and config changes and AM65x to enable ICSSG driver. The series also enables SPL_LOAD_FIT_APPLY_OVERLAY for AM65x in order to load overlay over spl. This series has been tested on AM65x SR2.0, and the ICSSG interface is able to ping / dhcp and boot kernel using tftp in uboot. To use ICSSG2 ethernet, the ICSSG firmware needs to be loaded to PRU RPROC cores and RPROC cores need to be booted with the firmware. This step is done inside driver similar to kernel. The remoteproc driver uses request_fw_into_buf() API from fs-loader driver to load and start rproc with the required firmwares. The users need to set env variables fw_storage_interface, fw_dev_part, fw_ubi_mtdpart, fw_ubi_volume to indicate which storage medium and partition they want to use to load firmware files from. By default the env fw_storage_interface=mmc and fw_dev_part=1:2 but users can modify these envs as per their requirements. Log while running dhcp at u-boot: k3-navss-ringacc ringacc@3c000000: Ring Accelerator probed rings:818, gp-rings[304,100] sci-dev-id:187 k3-navss-ringacc ringacc@3c000000: dma-ring-reset-quirk: disabled prueth icssg2-eth: K3 ICSSG: rflow_id_base: 8, chn_name = rx0 link up on port 0, speed 1000, full duplex BOOTP broadcast 1 BOOTP broadcast 2 BOOTP broadcast 3 DHCP client bound to address 192.168.4.97 (1037 ms) This is v3 of the series [1]. Changes from v2 [2] to v3: *) No functional changes. *) Rebased the series on latest u-boot/next. *) Dropped the RFC tag. Changes from v1 to v2: *) Modified the driver to load the firmware inside the driver only instead of loading the firmware using commands at u-boot prompt. Added patch 3/16 for this. *) Rebased the series on the latest u-boot/next. *) Modified conf-0 configuration in k3-am65x-binman.dtsi as suggested by Roger. *) Dropped patch [3] as the patch is no longer needed. *) Added patch 2/15 to modify fs-loader driver to use fw_storage_interface env instead of storage_interface and keep the env storage_interface as fallback as suggested by Roger. *) Added patch 15/15 to set default values to env fw_storage_interface and fw_dev_part. [1] https://lore.kernel.org/all/20231219103418.3445886-1-danishan...@ti.com/ [2] https://lore.kernel.org/all/20240111070611.342701-1-danishan...@ti.com/ [3] https://lore.kernel.org/all/20231219103418.3445886-16-danishan...@ti.com/ NOTE: All the device tree changes introduced in this patch are already part of upstream linux kernel. Thanks and Regards, MD Danish Anwar MD Danish Anwar (15): dma: ti: k3-udma: Use ring_idx to pair k3 nav rings misc: fs-loader: Use fw_storage_interface instead of storage_interface remoteproc: uclass: Add methods to load firmware to rproc and boot rproc net: ti: icssg: Add Firmware Interface for ICSSG Ethernet driver. net: ti: icssg: Add Firmware config and classification APIs. net: ti: icssg: Add icssg queues APIs and macros net: ti: icssg: Add ICSSG ethernet driver net: ti: icssg: Add support sending FDB command to update rx_flow_id net: ti: icssg: Enforce pinctrl state on the MDIO child node arm: dts: k3-am654-base-board: Add ICSSG2 Ethernet support arm: dts: k3-am65x-binman: Add ICSSG2 overlay and configuration configs: am65x_evm_a53: Enable ICSSG Driver configs: am65x_evm_a53: add SPL_LOAD_FIT_APPLY_OVERLAY board: ti: am65x: Add check for k3-am654-icssg2 in board_fit_config_match() board: ti: am65x: Set fw_storage_interface and fw_dev_part ENVs arch/arm/dts/Makefile | 3 +- arch/arm/dts/k3-am654-icssg2.dtso | 145 ++++ arch/arm/dts/k3-am65x-binman.dtsi | 65 +- board/ti/am65x/am65x.env | 4 + board/ti/am65x/evm.c | 11 +- configs/am65x_evm_a53_defconfig | 2 + .../driver-model/fs_firmware_loader.rst | 5 +- drivers/dma/ti/k3-udma.c | 11 +- drivers/misc/fs_loader.c | 5 +- drivers/net/ti/Kconfig | 9 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icss_mii_rt.h | 192 +++++ drivers/net/ti/icssg_classifier.c | 376 +++++++++ drivers/net/ti/icssg_config.c | 463 +++++++++++ drivers/net/ti/icssg_config.h | 195 +++++ drivers/net/ti/icssg_prueth.c | 762 ++++++++++++++++++ drivers/net/ti/icssg_prueth.h | 92 +++ drivers/net/ti/icssg_queues.c | 51 ++ drivers/net/ti/icssg_switch_map.h | 209 +++++ drivers/remoteproc/Kconfig | 1 + drivers/remoteproc/rproc-uclass.c | 85 ++ include/remoteproc.h | 35 + 22 files changed, 2709 insertions(+), 13 deletions(-) create mode 100644 arch/arm/dts/k3-am654-icssg2.dtso create mode 100644 drivers/net/ti/icss_mii_rt.h create mode 100644 drivers/net/ti/icssg_classifier.c create mode 100644 drivers/net/ti/icssg_config.c create mode 100644 drivers/net/ti/icssg_config.h create mode 100644 drivers/net/ti/icssg_prueth.c create mode 100644 drivers/net/ti/icssg_prueth.h create mode 100644 drivers/net/ti/icssg_queues.c create mode 100644 drivers/net/ti/icssg_switch_map.h base-commit: f28a77589e7505535a4eebdc7269df98f67dbe68 -- 2.34.1