[PATCH] board/include: ti/env: j721e.env/ti_common: Fix cpsw0_qsgmii_phyinit
Nishanth Menon
nm at ti.com
Thu Jun 27 18:44:50 CEST 2024
On 15:19-20240627, Siddharth Vadapalli wrote:
> 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>
Why cant we do this entirely in board files? we do the board detection
there anyways..
> ---
>
> 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
>
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
More information about the U-Boot
mailing list