]> git.ipfire.org Git - thirdparty/u-boot.git/commit
board: ti: j721e,j7200: fix do_main_cpsw0_qsgmii_phyinit
authorSiddharth Vadapalli <s-vadapalli@ti.com>
Mon, 2 Feb 2026 14:10:56 +0000 (19:40 +0530)
committerTom Rini <trini@konsulko.com>
Mon, 16 Feb 2026 17:52:02 +0000 (11:52 -0600)
commite7ef80f670760b88f99847db9c98ac473edcba8b
tree80208d7b915a3a67dff4cdc9a0b710f9855c40f6
parentc3538f788dbac291df24171ae1eeb1563ab8af53
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 <s-vadapalli@ti.com>
Reviewed-by: Anshul Dalal <anshuld@ti.com>
board/ti/j7200/j7200.env
board/ti/j721e/evm.c
board/ti/j721e/j721e.env
include/env/ti/ti_common.env