[PATCH] board/include: ti/env: j721e.env/ti_common: Fix cpsw0_qsgmii_phyinit

Siddharth Vadapalli s-vadapalli at ti.com
Thu Jun 27 11:49:52 CEST 2024


The command "main_cpsw0_qsgmii_phyinit" has to be run depending on
whether or not the "do_main_cpsw0_qsgmii_phyinit" variable is set.
However, there is no support for the cases where the environment variable
"do_main_cpsw0_qsgmii_phyinit" is updated at runtime. On J721E, the value
of "do_main_cpsw0_qsgmii_phyinit" is updated at runtime.

Fix the existing implementation in order to handle the case where the
value of "do_main_cpsw0_qsgmii_phyinit" is updated at runtime. Do so by
introducing the environment variable "update_do_main_cpsw0_qsgmii_phyinit"
which defaults to setting "do_main_cpsw0_qsgmii_phyinit" to zero, but at
the same time, it allows the board to update the value at runtime.

Fixes: 0d72b0f2f83b ("include: env: ti: ti_common: Run main_cpsw0_qsgmii_phyinit conditionally")
Signed-off-by: Siddharth Vadapalli <s-vadapalli at ti.com>
---

Hello,

This patch is based on commit
899b088674 Merge patch series "pxe: Add debugging for booting"
of U-Boot's next branch.

Regards,
Siddharth.

 board/ti/j721e/j721e.env     | 9 +++++----
 include/env/ti/ti_common.env | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/board/ti/j721e/j721e.env b/board/ti/j721e/j721e.env
index 38bfd7d496..03d7e81aa8 100644
--- a/board/ti/j721e/j721e.env
+++ b/board/ti/j721e/j721e.env
@@ -29,7 +29,7 @@ bootdir=/boot
 rd_spec=-
 
 #if CONFIG_TARGET_J7200_A72_EVM
-do_main_cpsw0_qsgmii_phyinit=1
+update_do_main_cpsw0_qsgmii_phyinit=setenv do_main_cpsw0_qsgmii_phyinit 1;
 init_main_cpsw0_qsgmii_phy=gpio set gpio at 22_17;
 	gpio clear gpio at 22_16
 main_cpsw0_qsgmii_phyinit=
@@ -39,10 +39,11 @@ main_cpsw0_qsgmii_phyinit=
 #elif CONFIG_TARGET_J721E_A72_EVM
 init_main_cpsw0_qsgmii_phy=gpio set gpio at 22_17;
 	gpio clear gpio at 22_16
-main_cpsw0_qsgmii_phyinit=
+update_do_main_cpsw0_qsgmii_phyinit=
 	if test $board_name = J721EX-PM1-SOM || test $board_name = J721EX-PM2-SOM || test $board_name = j721e; then
-		do_main_cpsw0_qsgmii_phyinit=1; else
-		do_main_cpsw0_qsgmii_phyinit=0; fi;
+		setenv do_main_cpsw0_qsgmii_phyinit 1; else
+		setenv do_main_cpsw0_qsgmii_phyinit 0; fi;
+main_cpsw0_qsgmii_phyinit=
 	if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1 && test ${dorprocboot} -eq 1 && test ${boot} = mmc; then
 		run init_main_cpsw0_qsgmii_phy;			\
 	fi;
diff --git a/include/env/ti/ti_common.env b/include/env/ti/ti_common.env
index c5c3642177..d0b3d698a0 100644
--- a/include/env/ti/ti_common.env
+++ b/include/env/ti/ti_common.env
@@ -23,9 +23,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
+update_do_main_cpsw0_qsgmii_phyinit=setenv do_main_cpsw0_qsgmii_phyinit 0;
 bootcmd_ti_mmc=
 	run findfdt; run init_${boot};
+	run update_do_main_cpsw0_qsgmii_phyinit;
 #if CONFIG_CMD_REMOTEPROC
 	if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1;
 		then run main_cpsw0_qsgmii_phyinit;
-- 
2.40.1



More information about the U-Boot mailing list