From e7ef80f670760b88f99847db9c98ac473edcba8b Mon Sep 17 00:00:00 2001 From: Siddharth Vadapalli Date: Mon, 2 Feb 2026 19:40:56 +0530 Subject: board: ti: j721e,j7200: fix do_main_cpsw0_qsgmii_phyinit Since commit 27cc5951c862 ("include: env: ti: add default for do_main_cpsw0_qsgmii_phyinit"), the value of the environment variable do_main_cpsw0_qsgmii_phyinit happened to remain '0' and couldn't be changed without user intervention. This behavior is due to the following cyclic dependency: A) ti_common.env sets do_main_cpsw0_qsgmii_phyinit to '0' and its value can only be updated automatically by main_cpsw0_qsgmii_phyinit. B) main_cpsw0_qsgmii_phyinit is defined in j721e.env and it can run only if 'do_main_cpsw0_qsgmii_phyinit' is already '1' which isn't possible unless the user manually assigns the value. Fix the aforementioned cyclic dependency by using board_late_init() to detect the QSGMII Daughtercard and set do_main_cpsw0_qsgmii_phyinit. Additionally, to address the issue of do_main_cpsw0_qsgmii_phyinit being 'undefined' for other platforms, replace: if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; with: if env exists do_main_cpsw0_qsgmii_phyinit; in ti_common.env. Fixes: 27cc5951c862 ("include: env: ti: add default for do_main_cpsw0_qsgmii_phyinit") Signed-off-by: Siddharth Vadapalli Reviewed-by: Anshul Dalal --- include/env/ti/ti_common.env | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/env/ti/ti_common.env b/include/env/ti/ti_common.env index 03e3267ef8a..a0ed83f52ac 100644 --- a/include/env/ti/ti_common.env +++ b/include/env/ti/ti_common.env @@ -22,11 +22,10 @@ get_fit_overlaystring= done; get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile} run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring} -do_main_cpsw0_qsgmii_phyinit=0 bootcmd_ti_mmc= run init_${boot}; #if CONFIG_CMD_REMOTEPROC - if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; + if env exists do_main_cpsw0_qsgmii_phyinit; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; -- cgit v1.2.3