net: ti: icssg: Add prueth support
Subsystems (5)
v2 cover net: ti: icssg: Add prueth support
The series adds support for icssg_prueth functionality on u-boot. This series is based on top of master branch. rproc init needs to be done from uboot command prompt. The pru/rtu firmware loading is done by prueth driver soon after config paramters are setup.
Currently only slice0/1 of icssg2 instance on am6-evm is supported. i.e Both slices of icssg2 instance are supported.
Prebuilt firmware can be obtained from AM65 procSDK [1] rootfs at /lib/firmware/ti-pruss/am65x*.elf
[1] http://software-dl.ti.com/processor-sdk-linux/esd/AM65X/latest/index_FDS.html
This tests tftp on prueth.
Note: Uboot ethernet driver architecture supports once instance per probe. So only one of the ports are supported per instance. So DT of prueth node should have either ethernet-mii0 or ethernet-mii1.
Changes in v2:
It has been a while since v1 was posted. Here are the changes:
* Removed the usage of misc_init_by_ofnode instead used uclass_get_device_by_ofnode.
* Introduced started variable to keep track of the status of the prueth device.
* Build Tested on Travis: https://travis-ci.org/Keerthyj/u-boot/builds/651449684
Keerthy (10):
net: eth-uclass: eth_get_dev based on SEQ_ALIAS instead of probe order
soc: ti: pruss: add a misc driver for PRUSS in TI SoCs
remoteproc: pruss: add PRU remoteproc driver
net: ti: icssg-prueth: Add ICSSG ethernet driver
arm: dts: k3-am65-main: Add msmc_ram node
arm: dts: k3-am654-base-board-u-boot: Add icssg specific msmc_ram
carveout nodes
arm: dts: k3-am65-main: Add scm_conf node
arm: dts: k3-am65-main: Add pruss nodes for ICSSG2
arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support
configs: am65x_evm_a53_defconfig: Enable CONFIG_TI_AM64_ICSSG_PRUETH
arch/arm/dts/k3-am65-main.dtsi | 191 ++++++ arch/arm/dts/k3-am65.dtsi | 4 +- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 129 ++++ configs/am65x_evm_a53_defconfig | 3 + drivers/net/ti/Kconfig | 8 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg-prueth.c | 652 +++++++++++++++++++ drivers/net/ti/icssg.h | 36 + drivers/net/ti/icssg_classifier.c | 396 +++++++++++ drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/pru_rproc.c | 405 ++++++++++++ drivers/soc/ti/Kconfig | 12 + drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 152 +++++ include/ti-pruss.h | 17 + net/eth-uclass.c | 12 +- 17 files changed, 2027 insertions(+), 4 deletions(-) create mode 100644 drivers/net/ti/icssg-prueth.c create mode 100644 drivers/net/ti/icssg.h create mode 100644 drivers/net/ti/icssg_classifier.c create mode 100644 drivers/remoteproc/pru_rproc.c create mode 100644 drivers/soc/ti/pruss.c create mode 100644 include/ti-pruss.h
Signature · 1 line
2.17.1
PATCH v2 1/10 net: eth-uclass: eth_get_dev based on SEQ_ALIAS instead of probe order
In case of multiple eth interfaces currently eth_get_dev fetches the device based on the probe order which can be random hence try with the alias.
---
Changes in v2:
* Fixed comments from Tom & Lokesh as per:
https://patchwork.ozlabs.org/patch/1142697/
net/eth-uclass.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
net/eth-uclass.c +9 -3
@@ -68,9 +68,15 @@ struct udevice *eth_get_dev(void)struct eth_uclass_priv *uc_priv; uc_priv =eth_get_uclass_priv (); -if (!uc_priv->current) - eth_errno =uclass_first_device (UCLASS_ETH , - &uc_priv->current); + +if (!uc_priv->current) { + eth_errno =uclass_get_device_by_seq (UCLASS_ETH ,0 , + &uc_priv->current); +if (eth_errno || !uc_priv->current) + eth_errno =uclass_first_device (UCLASS_ETH , + &uc_priv->current); + } +return uc_priv->current; }
Signature · 1 line
2.17.1
PATCH v2 1/10 net: eth-uclass: eth_get_dev based on SEQ_ALIAS instead of probe order
Hi Keerthy,
Quoted 8 lines · Keerthy
In case of multiple eth interfaces currently
eth_get_devfetches the device based on the probe order which can be random hence try with the alias.Signed-off-by Keerthy <[email protected]>---
Quoted 7 lines
Changes in v2:
* Fixed comments from Tom & Lokesh as per:
https://patchwork.ozlabs.org/patch/1142697/net/eth-uclass.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
This one is for Joe to review.
But please do add/update the network tests to cover this behaviour.
Regards,
Simon
PATCH v2 2/10 soc: ti: pruss: add a misc driver for PRUSS in TI SoCs
In reply to KeerthyThe Programmable Real-Time Unit - Industrial Communication Subsystem (PRU-ICSS) is present of various TI SoCs such as AM335x or AM437x or the AM654x family. Each SoC can have one or more PRUSS instances that may or may not be identical.
The PRUSS consists of dual 32-bit RISC cores called the Programmable Real-Time Units (PRUs), some shared, data and instruction memories, some internal peripheral modules, and an interrupt controller. The programmable nature of the PRUs provide flexibility to implement custom peripheral interfaces, fast real-time responses, or specialized data handling.
Add support for pruss driver. Currently am654x family is supported.
---
Changes in v2:
* Fixed multiple comments from Andreas w.r.t header file define guards and Kconfig help typos.
drivers/soc/ti/Kconfig | 12 ++++ drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 152 ++++++++++++++++++++++++++++++++++++++++ include/ti-pruss.h | 17 +++++ 4 files changed, 182 insertions(+) create mode 100644 drivers/soc/ti/pruss.c create mode 100644 include/ti-pruss.h
drivers/soc/ti/Kconfig +12 -0
@@ -23,4 +23,16 @@ config TI_KEYSTONE_SERDES SerDes driver for Keystone SoC used for ethernet support on TI K2 platforms. +config TI_PRUSS + bool "Support for TI's K3 based Pruss driver" + depends on DM + depends on ARCH_K3 + depends on OF_CONTROL + depends on SYSCON + help + Support for TI PRU-ICSSG subsystem. + + Currently supported on AM65xx SoCs. Say Y here to support the + Programmable Realtime Unit (PRU). + endif # SOC_TI
drivers/soc/ti/Makefile +1 -0
@@ -2,3 +2,4 @@ obj-$(CONFIG_TI_K3_NAVSS_RINGACC) += k3-navss-ringacc.o obj-$(CONFIG_TI_KEYSTONE_SERDES) += keystone_serdes.o +obj-$(CONFIG_TI_PRUSS) += pruss.o
drivers/soc/ti/pruss.c new file +152 -0
152 lines not on this page · raw message
include/ti-pruss.h new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0 + +#ifndef __TI_PRUSS_H_ +#define __TI_PRUSS_H_ + +struct pruss { +phys_addr_t pruss_dram0; +phys_addr_t pruss_dram1; +phys_addr_t pruss_shrdram2; +phys_size_t pruss_dram0sz; +phys_size_t pruss_dram1sz; +phys_size_t pruss_shrdram2sz; +}; + +int pruss_request_shrmem_region (struct udevice *dev,phys_addr_t *loc); +int pruss_request_tm_region (struct udevice *dev,phys_addr_t *loc); +#endif /* __TI_PRUSS_H_ */
Signature · 1 line
2.17.1
PATCH v2 3/10 remoteproc: pruss: add PRU remoteproc driver
In reply to KeerthyThe Programmable Real-Time Unit Subsystem (PRUSS) consists of dual 32-bit RISC cores (Programmable Real-Time Units, or PRUs) for program execution. This patch adds a remoteproc platform driver for managing the individual PRU RISC cores life cycle.
The driver currently supports the AM65xx SoC
--- drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/pru_rproc.c | 405 +++++++++++++++++++++++++++++++++ 3 files changed, 417 insertions(+) create mode 100644 drivers/remoteproc/pru_rproc.c
drivers/remoteproc/Kconfig +11 -0
@@ -81,4 +81,15 @@ config REMOTEPROC_TI_POWER help Say 'y' here to add support for TI power processors such as those found on certain TI keystone and OMAP generation SoCs. + +config REMOTEPROC_TI_PRU + bool "Support for TI's K3 based PRU remoteproc driver" + select REMOTEPROC + depends on DM + depends on TI_PRUSS + depends on ARCH_K3 + depends on OF_CONTROL + help + Say 'y' here to add support for TI' K3 remoteproc driver. + endmenu
drivers/remoteproc/Makefile +1 -0
@@ -14,3 +14,4 @@ obj-$(CONFIG_REMOTEPROC_TI_K3_ARM64) += ti_k3_arm64_rproc.o obj-$(CONFIG_REMOTEPROC_TI_K3_DSP) += ti_k3_dsp_rproc.o obj-$(CONFIG_REMOTEPROC_TI_K3_R5F) += ti_k3_r5f_rproc.o obj-$(CONFIG_REMOTEPROC_TI_POWER) += ti_power_proc.o +obj-$(CONFIG_REMOTEPROC_TI_PRU) += pru_rproc.o
drivers/remoteproc/pru_rproc.c new file +405 -0
405 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 4/10 net: ti: icssg-prueth: Add ICSSG ethernet driver
In reply to KeerthyThis is the Ethernet driver for TI SoCs with the ICSSG PRU Sub-system running EMAC firmware. This driver caters to either of the slices(pru/rtu pair) of the icssg subsystem.
Following are the firmwares needed to run cores:
am65x-pru0-prueth-fw.elf for pru0 of slice0
am65x-rtu0-prueth-fw.elf for rtu0 of slice0
am65x-pru1-prueth-fw.elf for pru1 of slice1
am65x-rtu1-prueth-fw.elf for rtu1 of slice1
One and exactly one of the slices is supported as the u-boot ethernet supports probing one interface at a time.
---
Changes in v2:
* Added guards defines for icssg.h
* returning errors which were missed in v1
* Removed unused prueth_print_buf function.
* Removed usage misc_of_init and used uclass_get_device_by_ofnode in place of that.
* Introduced started variable to keep track of the status of the prueth device.
drivers/net/ti/Kconfig | 8 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg-prueth.c | 652 ++++++++++++++++++++++++++++++ drivers/net/ti/icssg.h | 36 ++ drivers/net/ti/icssg_classifier.c | 396 ++++++++++++++++++ 5 files changed, 1093 insertions(+) create mode 100644 drivers/net/ti/icssg-prueth.c create mode 100644 drivers/net/ti/icssg.h create mode 100644 drivers/net/ti/icssg_classifier.c
drivers/net/ti/Kconfig +8 -0
@@ -26,3 +26,11 @@ config TI_AM65_CPSW_NUSS help This driver supports TI K3 MCU CPSW Nuss Ethernet controller in Texas Instruments K3 AM65x SoCs. + +config TI_AM64_ICSSG_PRUETH + bool "TI Gigabit PRU Ethernet driver" + depends on ARCH_K3 + select PHYLIB + help + Support Gigabit Ethernet ports over the ICSSG PRU Subsystem + This subsystem is available starting with the AM65 platform.
drivers/net/ti/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_DRIVER_TI_CPSW) += cpsw.o cpsw-common.o cpsw_mdio.o 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 cpsw_mdio.o +obj-$(CONFIG_TI_AM64_ICSSG_PRUETH) += icssg-prueth.o cpsw_mdio.o icssg_classifier.o
drivers/net/ti/icssg-prueth.c new file +652 -0
652 lines not on this page · raw message
drivers/net/ti/icssg.h new file +36 -0
@@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Texas Instruments ICSSG PRU Ethernet Switch SubSystem Driver +* +* Copyright (C) 2020, Texas Instruments, Incorporated +* +*/ + +#ifndef _ICSSG_H_ +#define _ICSSG_H_ + +/* Config area lies in shared RAM */ +#define ICSSG_CONFIG_OFFSET_SLICE0 0 +#define ICSSG_CONFIG_OFFSET_SLICE1 0x8000 + +/* Load time Fiwmware Configuration */ +struct icssg_config { +__le32 status;/* Firmware status */ +__le32 addr_lo;/* MSMC Buffer pool base address low. */ +__le32 addr_hi;/* MSMC Buffer pool base address high. Must be 0 */ +__le32 tx_buf_sz[16 ];/* Array of buffer pool sizes */ +__le32 num_tx_threads;/* Number of active egress threads, 1 to 4 */ +__le32 tx_rate_lim_en;/* Bitmask: Egress rate limit enable per thread */ +__le32 rx_flow_id;/* RX flow id for first rx ring */ +__le32 rx_mgr_flow_id;/* RX flow id for the first management ring */ +__le32 flags;/* TBD */ +__le32 n_burst;/* for debug */ +__le32 rtu_status;/* RTU status */ +__le32 info;/* reserved */ +} __packed; + +void icssg_class_set_mac_addr (struct regmap *miig_rt,int slice,u8 *mac); +void icssg_class_disable (struct regmap *miig_rt,int slice); +void icssg_class_default (struct regmap *miig_rt,int slice); +void icssg_class_promiscuous (struct regmap *miig_rt,int slice); +#endif /* _ICSSG_H_ */
drivers/net/ti/icssg_classifier.c new file +396 -0
396 lines not on this page · raw message
Signature · 1 line
2.17.1
PATCH v2 5/10 arm: dts: k3-am65-main: Add msmc_ram node
In reply to KeerthyAdd msmc_ram node needed for prueth
---
Changes in v2:
* Aligned trailing 0s for consistency.
arch/arm/dts/k3-am65-main.dtsi | 21 +++++++++++++++++++++ arch/arm/dts/k3-am65.dtsi | 4 +++- 2 files changed, 24 insertions(+), 1 deletion(-)
arch/arm/dts/k3-am65-main.dtsi +21 -0
@@ -9,6 +9,27 @@ #include <dt-bindings/phy/phy.h> &cbass_main { + msmc_ram: sram at 70000000 { + compatible = "mmio-sram"; + reg = <0x0 0x70000000 0x0 0x200000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x70000000 0x200000>; + u-boot,dm-spl; + + atf-sram at 0 { + reg = <0x0 0x20000>; + }; + + sysfw-sram at f0000 { + reg = <0xf0000 0x10000>; + }; + + l3cache-sram at 100000 { + reg = <0x100000 0x100000>; + }; + }; + gic500: interrupt-controller at 1800000 { compatible = "arm,gic-v3"; #address-cells = <2>;
arch/arm/dts/k3-am65.dtsi +3 -1
@@ -79,7 +79,9 @@ <0x00 0x42040000 0x00 0x42040000 0x00 0x03ac2400>, <0x00 0x45100000 0x00 0x45100000 0x00 0x00c24000>, <0x00 0x46000000 0x00 0x46000000 0x00 0x00200000>, - <0x00 0x47000000 0x00 0x47000000 0x00 0x00068400>; + <0x00 0x47000000 0x00 0x47000000 0x00 0x00068400>, + <0x07 0x00000000 0x07 0x00000000 0x01 0x00000000>, + <0x00 0x70000000 0x00 0x70000000 0x00 0x00200000>; cbass_mcu: interconnect at 28380000 { compatible = "simple-bus";
Signature · 1 line
2.17.1
PATCH v2 6/10 arm: dts: k3-am654-base-board-u-boot: Add icssg specific msmc_ram carveout nodes
In reply to KeerthyAdd icssg specific msmc_ram carveout nodes
--- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/arm/dts/k3-am654-base-board-u-boot.dtsi +12 -0
@@ -365,3 +365,15 @@ &usb1 { dr_mode = "peripheral"; }; + +&msmc_ram { + icssg0_sram: icssg0-sram at 40000 { + reg = <0x40000 0x10000>; + }; + icssg1_sram: icssg1-sram at 50000 { + reg = <0x50000 0x10000>; + }; + icssg2_sram: icssg2-sram at 60000 { + reg = <0x60000 0x10000>; + }; +};
Signature · 1 line
2.17.1
PATCH v2 7/10 arm: dts: k3-am65-main: Add scm_conf node
In reply to KeerthyAdd scm_conf node needed for prueth.
--- arch/arm/dts/k3-am65-main.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/dts/k3-am65-main.dtsi +8 -0
@@ -53,6 +53,14 @@ }; }; + scm_conf: scm_conf at 100000 { + compatible = "syscon", "simple-mfd"; + reg = <0 0x00100000 0 0x1c000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0x0 0x00100000 0x1c000>; + }; + secure_proxy_main: mailbox at 32c00000 { compatible = "ti,am654-secure-proxy"; #mbox-cells = <1>;
Signature · 1 line
2.17.1
PATCH v2 8/10 arm: dts: k3-am65-main: Add pruss nodes for ICSSG2
In reply to KeerthyAdd pruss nodes. This is based 4.19 DT with interrupt properties removed from pur/rtu nodes.
--- arch/arm/dts/k3-am65-main.dtsi | 162 +++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+)
arch/arm/dts/k3-am65-main.dtsi +162 -0
@@ -8,6 +8,8 @@ #include <dt-bindings/phy/phy-am654-serdes.h> #include <dt-bindings/phy/phy.h> +#include <dt-bindings/dma/k3-udma.h> + &cbass_main { msmc_ram: sram at 70000000 { compatible = "mmio-sram";
@@ -358,4 +360,164 @@ #phy-cells = <0>; ti,dis-chg-det-quirk; }; + + icssg2: icssg at b200000 { + compatible = "ti,am654-icssg"; + power-domains = <&k3_pds 64 TI_SCI_PD_EXCLUSIVE>; + reg = <0xb200000 0x80000>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + dma-ranges; + ti,psil-base = <0x4300>; /* ICSSG2 PSIL thread start */ + + ti,psil-config0 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config1 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config2 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config3 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config4 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config5 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config6 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + ti,psil-config7 { + linux,udma-mode = <UDMA_PKT_MODE>; + statictr-type = <PSIL_STATIC_TR_NONE>; + ti,needs-epib; + ti,psd-size = <16>; + }; + + icssg2_mem: memories at b200000 { + reg = <0xb200000 0x2000>, + <0xb202000 0x2000>, + <0xb210000 0x10000>; + reg-names = "dram0", "dram1", + "shrdram2"; + }; + + icssg2_cfg: cfg at b226000 { + compatible = "syscon"; + reg = <0xb226000 0x200>; + }; + + icssg2_iep: iep at b22e000 { + compatible = "syscon"; + reg = <0xb22e000 0x1000>; + }; + + icssg2_mii_rt: mii-rt at b232000 { + compatible = "syscon"; + reg = <0xb232000 0x100>; + }; + + icssg2_mii_g_rt: mii-g-rt at b233000 { + compatible = "syscon"; + reg = <0xb233000 0x1000>; + }; + + icssg2_intc: interrupt-controller at b220000 { + compatible = "ti,am654-icssg-intc"; + reg = <0xb220000 0x2000>; + interrupt-controller; + #interrupt-cells = <1>; + interrupts = <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "host2", "host3", "host4", + "host5", "host6", "host7", + "host8", "host9"; + }; + + pru2_0: pru at b234000 { + compatible = "ti,am654-pru"; + reg = <0xb234000 0x4000>, + <0xb222000 0x100>, + <0xb222400 0x100>; + reg-names = "iram", "control", "debug"; + firmware-name = "am65x-pru2_0-fw"; + }; + + rtu2_0: rtu at b204000 { + compatible = "ti,am654-rtu"; + reg = <0xb204000 0x2000>, + <0xb223000 0x100>, + <0xb223400 0x100>; + reg-names = "iram", "control", "debug"; + firmware-name = "am65x-rtu2_0-fw"; + }; + + pru2_1: pru at b238000 { + compatible = "ti,am654-pru"; + reg = <0xb238000 0x4000>, + <0xb224000 0x100>, + <0xb224400 0x100>; + reg-names = "iram", "control", "debug"; + firmware-name = "am65x-pru2_1-fw"; + }; + + rtu2_1: rtu at b206000 { + compatible = "ti,am654-rtu"; + reg = <0xb206000 0x2000>, + <0xb223800 0x100>, + <0xb223c00 0x100>; + reg-names = "iram", "control", "debug"; + firmware-name = "am65x-rtu2_1-fw"; + }; + + icssg2_mdio: mdio at b232400 { + compatible = "ti,davinci_mdio"; + reg = <0xb232400 0x100>; + clocks = <&k3_clks 64 3>; + clock-names = "fck"; + #address-cells = <1>; + #size-cells = <0>; + bus_freq = <1000000>; + status = "disabled"; + }; + }; };
Signature · 1 line
2.17.1
PATCH v2 9/10 arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support
In reply to KeerthyICSSG2 provide dual Gigabit Ethernet support. Currently mdio clock is part of this node and also the icssg2_rgmii_pins_default pinmux node has the mdio pins as there is no davinci mdio driver.
Currently icssg2 instances are supported. Either mii0 or mii1 can be enabled at a time.
---
Changes in v2:
* Removed a bunch of inconsistent white space in pins definition.
arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 117 +++++++++++++++++++ 1 file changed, 117 insertions(+)
arch/arm/dts/k3-am654-base-board-u-boot.dtsi +117 -0
@@ -16,6 +16,64 @@ serial2 = &main_uart0; ethernet0 = &cpsw_port1; }; + + /* Dual Ethernet application node on PRU-ICSSG2 */ + pruss2_eth: pruss2_eth { + compatible = "ti,am654-icssg-prueth"; + pinctrl-names = "default"; + pinctrl-0 = <&icssg2_rgmii_pins_default>; + sram = <&icssg2_sram>; + clocks = <&k3_clks 64 3>; + clock-names = "mdio_fck"; + u-boot,dm-spl; + + prus = <&pru2_0>, <&rtu2_0>, <&pru2_1>, <&rtu2_1>; + firmware-name = "ti-pruss/am65x-pru0-prueth-fw.elf", + "ti-pruss/am65x-rtu0-prueth-fw.elf", + "ti-pruss/am65x-pru1-prueth-fw.elf", + "ti-pruss/am65x-rtu1-prueth-fw.elf"; + mii-g-rt = <&icssg2_mii_g_rt>; + mii-rt = <&icssg2_mii_rt>; + dma-coherent; + dmas = <&mcu_udmap &icssg2 0 UDMA_DIR_TX>, /* egress slice 0 */ + <&mcu_udmap &icssg2 1 UDMA_DIR_TX>, /* egress slice 0 */ + <&mcu_udmap &icssg2 2 UDMA_DIR_TX>, /* egress slice 0 */ + <&mcu_udmap &icssg2 3 UDMA_DIR_TX>, /* mgmnt cmd slice 0 */ + <&mcu_udmap &icssg2 4 UDMA_DIR_TX>, /* egress slice 1 */ + <&mcu_udmap &icssg2 5 UDMA_DIR_TX>, /* egress slice 1 */ + <&mcu_udmap &icssg2 6 UDMA_DIR_TX>, /* egress slice 1 */ + <&mcu_udmap &icssg2 7 UDMA_DIR_TX>, /* mgmnt cmd slice 1 */ + + <&mcu_udmap &icssg2 0 UDMA_DIR_RX>, /* ingress slice 0 */ + <&mcu_udmap &icssg2 1 UDMA_DIR_RX>, /* ingress slice 1 */ + <&mcu_udmap &icssg2 2 UDMA_DIR_RX>, /* mgmnt rsp slice 0 */ + <&mcu_udmap &icssg2 3 UDMA_DIR_RX>; /* mgmnt rsp slice 1 */ + dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3", + "tx1-0", "tx1-1", "tx1-2", "tx1-3", + "rx0", "rx1", + "rxmgm0", "rxmgm1"; + + pruss2_emac0: ethernet-mii0 { + phy-handle = <&pruss2_eth0_phy>; + phy-mode = "rgmii-rxid"; + syscon-rgmii-delay = <&scm_conf 0x4120>; + /* Filled in by bootloader */ + local-mac-address = [00 00 00 00 00 00]; + }; + +/* + * Commenting out the second mii interface as the framework + * supports one interface in a single probe + * So either mii1 or mii2 can be used. In case mii1 is needed + * uncomment mii1 and comment out mii0 + pruss2_emac1: ethernet-mii1 { + phy-handle = <&pruss2_eth1_phy>; + phy-mode = "rgmii-rxid"; + syscon-rgmii-delay = <&scm_conf 0x4124>; + local-mac-address = [00 00 00 00 00 00]; + }; +*/ + }; }; &cbass_main{
@@ -275,6 +333,47 @@ u-boot,dm-spl; }; + icssg2_rgmii_pins_default: icssg2_rgmii_pins_default { + pinctrl-single,pins = < + AM65X_IOPAD(0x00ac, PIN_INPUT, 2) /* (AH15) PRG2_PRU1_GPO0.PRG2_RGMII2_RD0 */ + AM65X_IOPAD(0x00b0, PIN_INPUT, 2) /* (AC16) PRG2_PRU1_GPO1.PRG2_RGMII2_RD1 */ + AM65X_IOPAD(0x00b4, PIN_INPUT, 2) /* (AD17) PRG2_PRU1_GPO2.PRG2_RGMII2_RD2 */ + AM65X_IOPAD(0x00b8, PIN_INPUT, 2) /* (AH14) PRG2_PRU1_GPO3.PRG2_RGMII2_RD3 */ + AM65X_IOPAD(0x00cc, PIN_OUTPUT, 2) /* (AD15) PRG2_PRU1_GPO8.PRG2_RGMII2_TD0 */ + AM65X_IOPAD(0x00d0, PIN_OUTPUT, 2) /* (AF14) PRG2_PRU1_GPO9.PRG2_RGMII2_TD1 */ + AM65X_IOPAD(0x00d4, PIN_OUTPUT, 2) /* (AC15) PRG2_PRU1_GPO10.PRG2_RGMII2_TD2 */ + AM65X_IOPAD(0x00d8, PIN_OUTPUT, 2) /* (AD14) PRG2_PRU1_GPO11.PRG2_RGMII2_TD3 */ + AM65X_IOPAD(0x00dc, PIN_INPUT, 2) /* (AE14) PRG2_PRU1_GPO16.PRG2_RGMII2_TXC */ + AM65X_IOPAD(0x00c4, PIN_OUTPUT, 2) /* (AC17) PRG2_PRU1_GPO6.PRG2_RGMII2_TX_CTL */ + AM65X_IOPAD(0x00c0, PIN_INPUT, 2) /* (AG15) PRG2_PRU1_GPO5.PRG2_RGMII2_RXC */ + AM65X_IOPAD(0x00bc, PIN_INPUT, 2) /* (AG14) PRG2_PRU1_GPO4.PRG2_RGMII2_RX_CTL */ + + AM65X_IOPAD(0x0078, PIN_INPUT, 2) /* (AF18) PRG2_PRU0_GPO0.PRG2_RGMII1_RD0 */ + AM65X_IOPAD(0x007c, PIN_INPUT, 2) /* (AE18) PRG2_PRU0_GPO1.PRG2_RGMII1_RD1 */ + AM65X_IOPAD(0x0080, PIN_INPUT, 2) /* (AH17) PRG2_PRU0_GPO2.PRG2_RGMII1_RD2 */ + AM65X_IOPAD(0x0084, PIN_INPUT, 2) /* (AG18) PRG2_PRU0_GPO3.PRG2_RGMII1_RD3 */ + AM65X_IOPAD(0x0098, PIN_OUTPUT, 2) /* (AH16) PRG2_PRU0_GPO8.PRG2_RGMII1_TD0 */ + AM65X_IOPAD(0x009c, PIN_OUTPUT, 2) /* (AG16) PRG2_PRU0_GPO9.PRG2_RGMII1_TD1 */ + AM65X_IOPAD(0x00a0, PIN_OUTPUT, 2) /* (AF16) PRG2_PRU0_GPO10.PRG2_RGMII1_TD2 */ + AM65X_IOPAD(0x00a4, PIN_OUTPUT, 2) /* (AE16) PRG2_PRU0_GPO11.PRG2_RGMII1_TD3 */ + AM65X_IOPAD(0x00a8, PIN_INPUT, 2) /* (AD16) PRG2_PRU0_GPO16.PRG2_RGMII1_TXC */ + AM65X_IOPAD(0x0090, PIN_OUTPUT, 2) /* (AE17) PRG2_PRU0_GPO6.PRG2_RGMII1_TX_CTL */ + AM65X_IOPAD(0x008c, PIN_INPUT, 2) /* (AF17) PRG2_PRU0_GPO5.PRG2_RGMII1_RXC */ + AM65X_IOPAD(0x0088, PIN_INPUT, 2) /* (AG17) PRG2_PRU0_GPO4.PRG2_RGMII1_RX_CTL */ + /* HACK to get MDIO Pins in the right state */ + AM65X_IOPAD(0x0094, PIN_INPUT, 2) /* (AC19) PRG2_PRU0_GPO7.PRG2_MDIO0_MDIO */ + AM65X_IOPAD(0x00c8, PIN_OUTPUT, 2) /* (AE15) PRG2_PRU1_GPO7.PRG2_MDIO0_MDC */ + >; + u-boot,dm-spl; + }; + + icssg2_mdio_pins_default: icssg2_mdio_pins_default { + pinctrl-single,pins = < + AM65X_IOPAD(0x0094, PIN_INPUT, 2) /* (AC19) PRG2_PRU0_GPO7.PRG2_MDIO0_MDIO */ + AM65X_IOPAD(0x00c8, PIN_OUTPUT, 2) /* (AE15) PRG2_PRU1_GPO7.PRG2_MDIO0_MDC */ + >; + u-boot,dm-spl; + }; }; &main_pmx1 {
@@ -377,3 +476,21 @@ reg = <0x60000 0x10000>; }; }; + +&icssg2_mdio{ + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&icssg2_mdio_pins_default>; + + pruss2_eth0_phy: ethernet-phy at 0 { + reg = <0>; + ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; + }; + + pruss2_eth1_phy: ethernet-phy at 3 { + reg = <3>; + ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>; + ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>; + }; +};
Signature · 1 line
2.17.1
PATCH v2 10/10 configs: am65x_evm_a53_defconfig: Enable CONFIG_TI_AM64_ICSSG_PRUETH
In reply to KeerthyEnable ICSSG_PRUETH & related configs. This enables ethernet functionality on PRU.
--- configs/am65x_evm_a53_defconfig | 3 +++ 1 file changed, 3 insertions(+)
configs/am65x_evm_a53_defconfig +3 -0
@@ -84,6 +84,7 @@ CONFIG_DM_ETH=y CONFIG_E1000=y CONFIG_CMD_E1000=y CONFIG_TI_AM65_CPSW_NUSS=y +CONFIG_TI_AM64_ICSSG_PRUETH=y CONFIG_PCI=y CONFIG_DM_PCI=y CONFIG_PCI_KEYSTONE=y
@@ -98,10 +99,12 @@ CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y CONFIG_REMOTEPROC_TI_K3_R5F=y +CONFIG_REMOTEPROC_TI_PRU=y CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_DM_SERIAL=y CONFIG_SOC_TI=y +CONFIG_TI_PRUSS=y CONFIG_SYSRESET=y CONFIG_SPL_SYSRESET=y CONFIG_SYSRESET_TI_SCI=y
Signature · 1 line
2.17.1
v2 cover net: ti: icssg: Add prueth support
In reply to KeerthyQuoted 5 lines · Keerthy
The series adds support for
icssg_pruethfunctionality on u-boot. This series is based on top of master branch. rproc init needs to be done from uboot command prompt. The pru/rtu firmware loading is done by prueth driver soon after config paramters are setup.
A quick update on this series. It seems newer version of this hardware needs more modifications to this series. Hence please ignore v2.
Best Regards,
Keerthy
Quoted 63 lines
Currently only slice0/1 of icssg2 instance on am6-evm is supported. i.e Both slices of icssg2 instance are supported.
Prebuilt firmware can be obtained from AM65 procSDK [1] rootfs at
/lib/firmware/ti-pruss/am65x*.elf[1] http://software-dl.ti.com/processor-sdk-linux/esd/AM65X/latest/index_FDS.html
This tests tftp on prueth.
Note: Uboot ethernet driver architecture supports once instance per probe. So only one of the ports are supported per instance. So DT of prueth node should have either ethernet-mii0 or ethernet-mii1.
Changes in v2:
It has been a while since v1 was posted. Here are the changes:
* Removed the usage of
misc_init_by_ofnodeinstead useduclass_get_device_by_ofnode.
* Introduced started variable to keep track of the status of the prueth device.
* Build Tested on Travis: https://travis-ci.org/Keerthyj/u-boot/builds/651449684Keerthy (10):
net: eth-uclass:eth_get_devbased onSEQ_ALIASinstead of probe order
soc: ti: pruss: add a misc driver for PRUSS in TI SoCs
remoteproc: pruss: add PRU remoteproc driver
net: ti: icssg-prueth: Add ICSSG ethernet driver
arm: dts: k3-am65-main: Addmsmc_ramnode
arm: dts: k3-am654-base-board-u-boot: Add icssg specificmsmc_ram
carveout nodes
arm: dts: k3-am65-main: Addscm_confnode
arm: dts: k3-am65-main: Add pruss nodes for ICSSG2
arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support
configs:am65x_evm_a53_defconfig: EnableCONFIG_TI_AM64_ICSSG_PRUETHarch/arm/dts/k3-am65-main.dtsi | 191 ++++++ arch/arm/dts/k3-am65.dtsi | 4 +- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 129 ++++ configs/am65x_evm_a53_defconfig | 3 + drivers/net/ti/Kconfig | 8 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg-prueth.c | 652 +++++++++++++++++++ drivers/net/ti/icssg.h | 36 + drivers/net/ti/icssg_classifier.c | 396 +++++++++++ drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/pru_rproc.c | 405 ++++++++++++ drivers/soc/ti/Kconfig | 12 + drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 152 +++++ include/ti-pruss.h | 17 + net/eth-uclass.c | 12 +- 17 files changed, 2027 insertions(+), 4 deletions(-)create mode 100644
drivers/net/ti/icssg-prueth.ccreate mode 100644drivers/net/ti/icssg.hcreate mode 100644drivers/net/ti/icssg_classifier.ccreate mode 100644drivers/remoteproc/pru_rproc.ccreate mode 100644drivers/soc/ti/pruss.ccreate mode 100644include/ti-pruss.h
v2 cover net: ti: icssg: Add prueth support
Hi all
Is there any update regarding this patch series?
Am Do., 20. Feb. 2020 um 10:19 Uhr schrieb Keerthy <[email protected]>:
Quoted 79 lines · Keerthy
Quoted 5 lines
The series adds support for
icssg_pruethfunctionality on u-boot. This series is based on top of master branch. rproc init needs to be done from uboot command prompt. The pru/rtu firmware loading is done by prueth driver soon after config paramters are setup.A quick update on this series. It seems newer version of this hardware needs more modifications to this series. Hence please ignore v2.
Best Regards,
KeerthyQuoted 63 lines
Currently only slice0/1 of icssg2 instance on am6-evm is supported. i.e Both slices of icssg2 instance are supported.
Prebuilt firmware can be obtained from AM65 procSDK [1] rootfs at
/lib/firmware/ti-pruss/am65x*.elf[1] http://software-dl.ti.com/processor-sdk-linux/esd/AM65X/latest/index_FDS.html
This tests tftp on prueth.
Note: Uboot ethernet driver architecture supports once instance per probe. So only one of the ports are supported per instance. So DT of prueth node should have either ethernet-mii0 or ethernet-mii1.
Changes in v2:
It has been a while since v1 was posted. Here are the changes:
* Removed the usage of
misc_init_by_ofnodeinstead useduclass_get_device_by_ofnode.
* Introduced started variable to keep track of the status of the prueth device.
* Build Tested on Travis: https://travis-ci.org/Keerthyj/u-boot/builds/651449684Keerthy (10):
net: eth-uclass:eth_get_devbased onSEQ_ALIASinstead of probe order
soc: ti: pruss: add a misc driver for PRUSS in TI SoCs
remoteproc: pruss: add PRU remoteproc driver
net: ti: icssg-prueth: Add ICSSG ethernet driver
arm: dts: k3-am65-main: Addmsmc_ramnode
arm: dts: k3-am654-base-board-u-boot: Add icssg specificmsmc_ram
carveout nodes
arm: dts: k3-am65-main: Addscm_confnode
arm: dts: k3-am65-main: Add pruss nodes for ICSSG2
arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support
configs:am65x_evm_a53_defconfig: EnableCONFIG_TI_AM64_ICSSG_PRUETHarch/arm/dts/k3-am65-main.dtsi | 191 ++++++ arch/arm/dts/k3-am65.dtsi | 4 +- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 129 ++++ configs/am65x_evm_a53_defconfig | 3 + drivers/net/ti/Kconfig | 8 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg-prueth.c | 652 +++++++++++++++++++ drivers/net/ti/icssg.h | 36 + drivers/net/ti/icssg_classifier.c | 396 +++++++++++ drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/pru_rproc.c | 405 ++++++++++++ drivers/soc/ti/Kconfig | 12 + drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 152 +++++ include/ti-pruss.h | 17 + net/eth-uclass.c | 12 +- 17 files changed, 2027 insertions(+), 4 deletions(-)create mode 100644
drivers/net/ti/icssg-prueth.ccreate mode 100644drivers/net/ti/icssg.hcreate mode 100644drivers/net/ti/icssg_classifier.ccreate mode 100644drivers/remoteproc/pru_rproc.ccreate mode 100644drivers/soc/ti/pruss.ccreate mode 100644include/ti-pruss.h
Signature · 5 lines
greets -- Christian Gmeiner, MSc https://christian-gmeiner.info/privacypolicy
v2 cover net: ti: icssg: Add prueth support
Hi Christian,
Quoted 3 lines · Christian Gmeiner
Hi all
Is there any update regarding this patch series?
I am working on revising this driver. Once ready I will post the updated version upstream.
cheers,
-roger
Quoted 86 lines
Am Do., 20. Feb. 2020 um 10:19 Uhr schrieb Keerthy <[email protected]>:
Quoted 79 lines · Keerthy
Quoted 5 lines
The series adds support for
icssg_pruethfunctionality on u-boot. This series is based on top of master branch. rproc init needs to be done from uboot command prompt. The pru/rtu firmware loading is done by prueth driver soon after config paramters are setup.A quick update on this series. It seems newer version of this hardware needs more modifications to this series. Hence please ignore v2.
Best Regards,
KeerthyQuoted 63 lines
Currently only slice0/1 of icssg2 instance on am6-evm is supported. i.e Both slices of icssg2 instance are supported.
Prebuilt firmware can be obtained from AM65 procSDK [1] rootfs at
/lib/firmware/ti-pruss/am65x*.elf[1] http://software-dl.ti.com/processor-sdk-linux/esd/AM65X/latest/index_FDS.html
This tests tftp on prueth.
Note: Uboot ethernet driver architecture supports once instance per probe. So only one of the ports are supported per instance. So DT of prueth node should have either ethernet-mii0 or ethernet-mii1.
Changes in v2:
It has been a while since v1 was posted. Here are the changes:
* Removed the usage of
misc_init_by_ofnodeinstead useduclass_get_device_by_ofnode.
* Introduced started variable to keep track of the status of the prueth device.
* Build Tested on Travis: https://travis-ci.org/Keerthyj/u-boot/builds/651449684Keerthy (10):
net: eth-uclass:eth_get_devbased onSEQ_ALIASinstead of probe order
soc: ti: pruss: add a misc driver for PRUSS in TI SoCs
remoteproc: pruss: add PRU remoteproc driver
net: ti: icssg-prueth: Add ICSSG ethernet driver
arm: dts: k3-am65-main: Addmsmc_ramnode
arm: dts: k3-am654-base-board-u-boot: Add icssg specificmsmc_ram
carveout nodes
arm: dts: k3-am65-main: Addscm_confnode
arm: dts: k3-am65-main: Add pruss nodes for ICSSG2
arm64: dts: ti: am654-base-board: add ICSSG2 Ethernet support
configs:am65x_evm_a53_defconfig: EnableCONFIG_TI_AM64_ICSSG_PRUETHarch/arm/dts/k3-am65-main.dtsi | 191 ++++++ arch/arm/dts/k3-am65.dtsi | 4 +- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 129 ++++ configs/am65x_evm_a53_defconfig | 3 + drivers/net/ti/Kconfig | 8 + drivers/net/ti/Makefile | 1 + drivers/net/ti/icssg-prueth.c | 652 +++++++++++++++++++ drivers/net/ti/icssg.h | 36 + drivers/net/ti/icssg_classifier.c | 396 +++++++++++ drivers/remoteproc/Kconfig | 11 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/pru_rproc.c | 405 ++++++++++++ drivers/soc/ti/Kconfig | 12 + drivers/soc/ti/Makefile | 1 + drivers/soc/ti/pruss.c | 152 +++++ include/ti-pruss.h | 17 + net/eth-uclass.c | 12 +- 17 files changed, 2027 insertions(+), 4 deletions(-)create mode 100644
drivers/net/ti/icssg-prueth.ccreate mode 100644drivers/net/ti/icssg.hcreate mode 100644drivers/net/ti/icssg_classifier.ccreate mode 100644drivers/remoteproc/pru_rproc.ccreate mode 100644drivers/soc/ti/pruss.ccreate mode 100644include/ti-pruss.h
Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki