On 07/01/25 20:03, Roger Quadros wrote:
On 07/01/2025 11:38, Chintan Vankar wrote:
To support Ethernet boot on AM68-SK, probe AM65 CPSW NUSS driver in
board_init_f().
Signed-off-by: Chintan Vankar <c-van...@ti.com>
---
arch/arm/mach-k3/j721s2/j721s2_init.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/mach-k3/j721s2/j721s2_init.c
b/arch/arm/mach-k3/j721s2/j721s2_init.c
index 6ce3eb87efb..7208bee5785 100644
--- a/arch/arm/mach-k3/j721s2/j721s2_init.c
+++ b/arch/arm/mach-k3/j721s2/j721s2_init.c
@@ -329,6 +329,16 @@ void board_init_f(ulong dummy)
setup_qos();
+ if (IS_ENABLED(CONFIG_SPL_ETH) && IS_ENABLED(CONFIG_TI_AM65_CPSW_NUSS) &&
+ spl_boot_device() == BOOT_DEVICE_ETHERNET) {
+ struct udevice *cpswdev;
+
+ ret = uclass_get_device_by_driver(UCLASS_MISC,
DM_DRIVER_GET(am65_cpsw_nuss),
+ &cpswdev);
+ if (ret)
+ printf("Failed to probe am65_cpsw_nuss driver..\n");
+ }
+
This looks like a hack. Please find out why the Ethernet driver is not being
probed when SPL tries to load image over net.
Hello Roger,
The driver is defined as UCLASS_MISC which should be probed explicitly,
I have discussed the same with Nishanth in following thread:
https://lore.kernel.org/all/ee1d16fd-b99b-4b07-97bb-a896e1791...@ti.com/
We have the following defined at the am65-cpsw-nuss driver.
U_BOOT_DRIVER(am65_cpsw_nuss) = {
.name = "am65_cpsw_nuss",
.id = UCLASS_MISC,
.of_match = am65_cpsw_nuss_ids,
.probe = am65_cpsw_probe_nuss,
.priv_auto = sizeof(struct am65_cpsw_common),
};
U_BOOT_DRIVER(am65_cpsw_nuss_port) = {
.name = "am65_cpsw_nuss_port",
.id = UCLASS_ETH,
.probe = am65_cpsw_port_probe,
.ops = &am65_cpsw_ops,
.priv_auto = sizeof(struct am65_cpsw_priv),
.plat_auto = sizeof(struct eth_pdata),
.flags = DM_FLAG_ALLOC_PRIV_DMA | DM_FLAG_OS_PREPARE,
};
It looks like am65_cpsw_probe_nuss() is not being invoked for you.
Can you please check if am65_cpsw_port_probe() was invoked?
If yes but am65_cpsw_probe_nuss() was not then we need to fix the
DM hierarchy for AM65_CPSW?
None of the probe function is getting invoked here, since we need
Ethernet functionality here we need to probe function in board_init_f().
We have discussed the same at here:
https://lore.kernel.org/r/d68c8045-116a-49c0-9e74-d6a366e6f...@kernel.org/#t
if (IS_ENABLED(CONFIG_CPU_V7R) && IS_ENABLED(CONFIG_K3_AVS0)) {
ret = uclass_get_device_by_driver(UCLASS_MISC,
DM_DRIVER_GET(k3_avs),
&dev);