Skip to contentSkip to conversation

Enable ICSSG Ethernet Driver for AM65x

PATCH In review MD Danish Anwar 3 participants 9 messages Apr 16, 2024 – Apr 29, 2024 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

v4 cover Enable ICSSG Ethernet Driver for AM65x

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.

The ICSSG2 node is added in device tree overlay so that it remains in sync with linux kernel.

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.

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.

This is the v4 of the series [1]. The series doesn't depend on any patch and can be applied cleanly on u-boot/master

Changes from v3 to v4:
*) Separated the device tree and board specific changes into this series
from the main series [1].
*) Added check for TARGET_AM654_A53_EVM config in board file as suggested
by Dan Carpenter <[email protected]>
*) Rebased on latest u-boot/master.

[1] https://lore.kernel.org/all/[email protected]/

MD Danish Anwar (6):
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             |   4 +-
 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              |   9 +-
 configs/am65x_evm_a53_defconfig   |   2 +
 6 files changed, 221 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/dts/k3-am654-icssg2.dtso

base-commit: 6e316e3f397b5e01e98c5dd56cdbaab961daeedf

Signature · 1 line
2.34.1
#1 lore raw

PATCH v4 1/6 arm: dts: k3-am654-base-board: Add ICSSG2 Ethernet support

ICSSG2 provides dual Gigabit Ethernet support.
Add ICSSG2 ethernet node to an overlay k3-am654-icssg2.dtso

---
 arch/arm/dts/Makefile             |   4 +-
 arch/arm/dts/k3-am654-icssg2.dtso | 145 ++++++++++++++++++++++++++++++
 2 files changed, 148 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/k3-am654-icssg2.dtso
arch/arm/dts/Makefile +3 -1
index 08dfbdd557..a58e700bf7 100644
@@ -1326,7 +1326,9 @@ dtb-$(CONFIG_SOC_K3_AM654) += \
 	k3-am6548-iot2050-advanced-pg2.dtb \
 	k3-am6548-iot2050-advanced-m2.dtb \
 	k3-am6548-iot2050-advanced-m2-bkey-usb3-overlay.dtbo \
-	k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay.dtbo
+	k3-am6548-iot2050-advanced-m2-bkey-ekey-pcie-overlay.dtbo \
+	k3-am654-icssg2.dtbo
+
 dtb-$(CONFIG_SOC_K3_J721E) += k3-j721e-common-proc-board.dtb \
 			      k3-j721e-r5-common-proc-board.dtb \
 			      k3-j7200-common-proc-board.dtb \
arch/arm/dts/k3-am654-icssg2.dtso new file +145 -0

145 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

PATCH v4 2/6 arm: dts: k3-am65x-binman: Add ICSSG2 overlay and configuration

In reply to MD Danish Anwar

Add ICSSG2 overlay and configuration to tispl and u-boot images.

---
 arch/arm/dts/k3-am65x-binman.dtsi | 65 +++++++++++++++++++++++++++++--
 1 file changed, 61 insertions(+), 4 deletions(-)
arch/arm/dts/k3-am65x-binman.dtsi +61 -4
index 8cc24da1f3..d0cd4889cd 100644
@@ -98,6 +98,8 @@
 #define SPL_AM654_EVM_DTB "spl/dts/k3-am654-base-board.dtb"
 #define AM654_EVM_DTB "u-boot.dtb"
 
+#define AM654_EVM_ICSSG2_DTBO "arch/arm/dts/k3-am654-icssg2.dtbo"
+
 &binman {
 	ti-spl {
 		insert-template = <&ti_spl_template>;
@@ -124,6 +126,20 @@
 						filename = SPL_AM654_EVM_DTB;
 					};
 				};
+
+				fdt-1 {
+					description = "k3-am654-icssg2 overlay";
+					type = "flat_dt";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&spl_am65x_evm_icssg2_dtb>;
+						keyfile = "custMpk.pem";
+					};
+					spl_am65x_evm_icssg2_dtb: blob-ext {
+						filename = AM654_EVM_ICSSG2_DTBO;
+					};
+				};
 			};
 
 			configurations {
@@ -133,7 +149,7 @@
 					description = "k3-am654-base-board";
 					firmware = "atf";
 					loadables = "tee", "dm", "spl";
-					fdt = "fdt-0";
+					fdt = "fdt-0", "fdt-1";
 				};
 			};
 		};
@@ -168,6 +184,24 @@
 					};
 				};
 
+				fdt-1 {
+					description = "k3-am654-icssg2 overlay";
+					type = "flat_dt";
+					arch = "arm";
+					compression = "none";
+					ti-secure {
+						content = <&am65x_evm_icssg2_dtb>;
+						keyfile = "custMpk.pem";
+
+					};
+					am65x_evm_icssg2_dtb: blob-ext {
+						filename = AM654_EVM_ICSSG2_DTBO;
+					};
+					hash {
+						algo = "crc32";
+					};
+				};
+
 			};
 
 			configurations {
@@ -177,7 +211,7 @@
 					description = "k3-am654-base-board";
 					firmware = "uboot";
 					loadables = "uboot";
-					fdt = "fdt-0";
+					fdt = "fdt-0", "fdt-1";
 				};
 			};
 		};
@@ -205,6 +239,16 @@
 						filename = SPL_AM654_EVM_DTB;
 					};
 				};
+
+				fdt-1 {
+					description = "k3-am654-icssg2 overlay";
+					type = "flat_dt";
+					arch = "arm";
+					compression = "none";
+					blob {
+						filename = AM654_EVM_ICSSG2_DTBO;
+					};
+				};
 			};
 
 			configurations {
@@ -214,7 +258,7 @@
 					description = "k3-am654-base-board";
 					firmware = "atf";
 					loadables = "tee", "dm", "spl";
-					fdt = "fdt-0";
+					fdt = "fdt-0", "fdt-1";
 				};
 			};
 		};
@@ -243,6 +287,19 @@
 						algo = "crc32";
 					};
 				};
+
+				fdt-1 {
+					description = "k3-am654-icssg2";
+					type = "flat_dt";
+					arch = "arm";
+					compression = "none";
+					blob {
+						filename = AM654_EVM_ICSSG2_DTBO;
+					};
+					hash {
+						algo = "crc32";
+					};
+				};
 			};
 
 			configurations {
@@ -252,7 +309,7 @@
 					description = "k3-am654-base-board";
 					firmware = "uboot";
 					loadables = "uboot";
-					fdt = "fdt-0";
+					fdt = "fdt-0", "fdt-1";
 				};
 			};
 		};
Signature · 1 line
2.34.1
#3 lore raw

PATCH v4 3/6 configs: am65x_evm_a53: Enable ICSSG Driver

In reply to MD Danish Anwar

Enable ICSSG driver in am65x_evm_a53_defconfig

---
 configs/am65x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/am65x_evm_a53_defconfig +1 -0
index 3afa80f45a..f06186ed8d 100644
@@ -129,6 +129,7 @@ CONFIG_PHY_FIXED=y
 CONFIG_E1000=y
 CONFIG_CMD_E1000=y
 CONFIG_TI_AM65_CPSW_NUSS=y
+CONFIG_TI_ICSSG_PRUETH=y
 CONFIG_PCI_KEYSTONE=y
 CONFIG_PHY=y
 CONFIG_SPL_PHY=y
Signature · 1 line
2.34.1
#4 lore raw

PATCH v4 4/6 configs: am65x_evm_a53: add SPL_LOAD_FIT_APPLY_OVERLAY

In reply to MD Danish Anwar

We want SPL to apply DTB overlays (e.g. ICSSG2 overlay) so enable SPL_LOAD_FIT_APPLY_OVERLAY.

---
 configs/am65x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/am65x_evm_a53_defconfig +1 -0
index f06186ed8d..d2f35dc2fb 100644
@@ -68,6 +68,7 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_PCI=y
 CONFIG_CMD_REMOTEPROC=y
+CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TIME=y
 CONFIG_MTDIDS_DEFAULT="nor0=47040000.spi.0"
Signature · 1 line
2.34.1
#5 lore raw

PATCH v4 5/6 board: ti: am65x: Add check for k3-am654-icssg2 in board_fit_config_match()

In reply to MD Danish Anwar

When CONFIG_TI_ICSSG_PRUETH is enabled, add config name check for the icssg2 overlay in board_fit_config_match() API.

---
 board/ti/am65x/evm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
board/ti/am65x/evm.c +6 -3
index 3109c9a2ac..07073a5940 100644
@@ -91,10 +91,13 @@ int dram_init_banksize(void)
 #ifdef CONFIG_SPL_LOAD_FIT
 int board_fit_config_name_match(const char *name)
 {
-#ifdef CONFIG_TARGET_AM654_A53_EVM
-	if (!strcmp(name, "k3-am654-base-board"))
+	if (IS_ENABLED(CONFIG_TI_ICSSG_PRUETH) &&
+	    strcmp(name, "k3-am654-icssg2") == 0)
+		return 0;
+
+	if (IS_ENABLED(CONFIG_TARGET_AM654_A53_EVM) &&
+	    strcmp(name, "k3-am654-base-board") == 0)
 		return 0;
-#endif
 
 	return -1;
 }
Signature · 1 line
2.34.1
#6 lore raw

PATCH v4 6/6 board: ti: am65x: Set fw_storage_interface and fw_dev_part ENVs

In reply to MD Danish Anwar

When ICSSG driver is enabled (CONFIG_TI_ICSSG_PRUETH=y) set storage_interface and fw_dev_part env variables.

These variables need be set appropriately in order to load differnet ICSSG firmwares needed for ICSSG driver. By default the storage interface is mmc and the partition is 1:2. User can modify this based on their needs.

---
 board/ti/am65x/am65x.env | 4 ++++
 1 file changed, 4 insertions(+)
board/ti/am65x/am65x.env +4 -0
index 814374d68c..631997e4c9 100644
@@ -27,3 +27,7 @@ get_fdt_ubi=ubifsload ${fdtaddr} ${bootdir}/${name_fdt}
 args_ubi=setenv bootargs console=${console} ${optargs}
 rootfstype=ubifs root=ubi0:rootfs rw ubi.mtd=ospi.rootfs
 
+#if CONFIG_TI_ICSSG_PRUETH
+storage_interface=mmc
+fw_dev_part=1:2
+#endif
Signature · 1 line
2.34.1
Acked-by on the v4 series
#7 lore raw
In reply to MD Danish Anwar
Quoted 47 lines · MD Danish Anwar

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.

The ICSSG2 node is added in device tree overlay so that it remains in sync with linux kernel.

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.

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.

This is the v4 of the series [1]. The series doesn't depend on any patch and can be applied cleanly on u-boot/master

Changes from v3 to v4:
*) Separated the device tree and board specific changes into this series
from the main series [1].
*) Added check for TARGET_AM654_A53_EVM config in board file as suggested
by Dan Carpenter <[email protected]>
*) Rebased on latest u-boot/master.

[1] https://lore.kernel.org/all/[email protected]/

MD Danish Anwar (6):
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             |   4 +-
 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              |   9 +-
 configs/am65x_evm_a53_defconfig   |   2 +
 6 files changed, 221 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/dts/k3-am654-icssg2.dtso
Quoted 1 line

base-commit: 6e316e3f397b5e01e98c5dd56cdbaab961daeedf

For the series,

Regards,
Ravi

#8 lore raw
In reply to MD Danish Anwar
Quoted 8 lines · MD Danish Anwar

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.

The ICSSG2 node is added in device tree overlay so that it remains in sync with linux kernel.

[...]

Applied to u-boot/master, thanks!

Signature · 1 line
Tom