[PATCH v2 0/4] Fix fdtfile for j722s and am62p

fdtfile wasn't being populated in these boards, add the code in evm.c for the same.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- Changes in v2: - Replace findfdt with fdtfile as that is what the series fixes. (Nishanth) - Drop findfdt as well for K3 platforms legacy support - Link to v1: https://lore.kernel.org/r/20240628-b4-upstream-streamline-platform-v1-0-1765...
--- Dhruva Gole (1): include: env: ti_common: Remove findfdt
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for fdtfile configs: am62p|j722s_a53: Add CONFIG_BOARD_LATE_INIT
board/ti/am62px/evm.c | 9 +++++++++ board/ti/j722s/evm.c | 9 +++++++++ configs/am62px_evm_a53_defconfig | 1 + configs/j722s_evm_a53_defconfig | 1 + include/env/ti/mmc.env | 2 +- include/env/ti/ti_common.env | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-) --- base-commit: 899b088674b6905710ce546f0a8848662904852a change-id: 20240628-b4-upstream-streamline-platform-f0d7453637b2
Best regards,

name_fdt is kept for backward compatibility but it depends on EEPROM detection logic and some of the platforms like J7AHP/AM69 don't have that anymore which causes boot failure.
Replacing name_fdt usage to fdtfile as fdtfile is populated based on CONFIG_DEFAULT_DEVICE_TREE.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- include/env/ti/mmc.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/env/ti/mmc.env b/include/env/ti/mmc.env index 0256a2d2aaca..037a09010ce4 100644 --- a/include/env/ti/mmc.env +++ b/include/env/ti/mmc.env @@ -16,7 +16,7 @@ importbootenv=echo Importing environment from mmc${mmcdev} ...; loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile} loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile} loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile} -get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt} +get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile} envboot=if mmc dev ${mmcdev}; then if mmc rescan; then echo SD/MMC found on device ${mmcdev};

stdboot and legacy boot now depend on fdtfile and fdtfile is populated based on evm code now. Populate fdtfile by calling ti_set_fdt_env in board files.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- board/ti/am62px/evm.c | 9 +++++++++ board/ti/j722s/evm.c | 9 +++++++++ 2 files changed, 18 insertions(+)
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c index 1a2c46c462b4..7362fa4520a3 100644 --- a/board/ti/am62px/evm.c +++ b/board/ti/am62px/evm.c @@ -13,6 +13,7 @@ #include <env.h> #include <fdt_support.h> #include <spl.h> +#include "../common/fdt_ops.h"
struct efi_fw_image fw_images[] = { { @@ -61,3 +62,11 @@ int dram_init_banksize(void) { return fdtdec_setup_memory_banksize(); } + +#if IS_ENABLED(CONFIG_BOARD_LATE_INIT) +int board_late_init(void) +{ + ti_set_fdt_env(NULL, NULL); + return 0; +} +#endif diff --git a/board/ti/j722s/evm.c b/board/ti/j722s/evm.c index 515aaa818783..29e06a5442fe 100644 --- a/board/ti/j722s/evm.c +++ b/board/ti/j722s/evm.c @@ -12,6 +12,7 @@ #include <env.h> #include <fdt_support.h> #include <spl.h> +#include "../common/fdt_ops.h"
int board_init(void) { @@ -27,3 +28,11 @@ int dram_init_banksize(void) { return fdtdec_setup_memory_banksize(); } + +#if IS_ENABLED(CONFIG_BOARD_LATE_INIT) +int board_late_init(void) +{ + ti_set_fdt_env(NULL, NULL); + return 0; +} +#endif

This is called to set fdtfile after the board is initialized.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- configs/am62px_evm_a53_defconfig | 1 + configs/j722s_evm_a53_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig index e1c9c8535e43..87005d03dee3 100644 --- a/configs/am62px_evm_a53_defconfig +++ b/configs/am62px_evm_a53_defconfig @@ -33,6 +33,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_BOOTSTD_FULL=y CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb" +CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x58000 CONFIG_SPL_PAD_TO=0x0 CONFIG_SPL_SYS_MALLOC_SIMPLE=y diff --git a/configs/j722s_evm_a53_defconfig b/configs/j722s_evm_a53_defconfig index da0e9f4d524d..1675cedb25ef 100644 --- a/configs/j722s_evm_a53_defconfig +++ b/configs/j722s_evm_a53_defconfig @@ -33,6 +33,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_BOOTSTD_FULL=y CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb" +CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x58000 CONFIG_SPL_PAD_TO=0x0 CONFIG_SPL_SYS_MALLOC_SIMPLE=y

From: Dhruva Gole d-gole@ti.com
findfdt is the legacy approach to find fdt and platforms have moved away from this and don't define this anymore. This causes an error that may seem alarming but is harmless. Remove it from the bootcmd_ti_mmc to avoid any panic and confusion.
Signed-off-by: Dhruva Gole d-gole@ti.com Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com --- include/env/ti/ti_common.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/env/ti/ti_common.env b/include/env/ti/ti_common.env index c5c36421770c..7029d12bf203 100644 --- a/include/env/ti/ti_common.env +++ b/include/env/ti/ti_common.env @@ -25,7 +25,7 @@ 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 findfdt; run init_${boot}; + run init_${boot}; #if CONFIG_CMD_REMOTEPROC if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit;

On 10:48-20240701, Manorit Chawdhry wrote:
fdtfile wasn't being populated in these boards, add the code in evm.c for the same.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com
Changes in v2:
- Replace findfdt with fdtfile as that is what the series fixes. (Nishanth)
- Drop findfdt as well for K3 platforms legacy support
- Link to v1: https://lore.kernel.org/r/20240628-b4-upstream-streamline-platform-v1-0-1765...
Please explain in your patches the impact the changes have on all platforms - not just TI K3 platforms. that was already asked on previous reviews, please provide the explanations in commit message to prevent folks from having to guess.
Dhruva Gole (1): include: env: ti_common: Remove findfdt
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for fdtfile configs: am62p|j722s_a53: Add CONFIG_BOARD_LATE_INIT
board/ti/am62px/evm.c | 9 +++++++++ board/ti/j722s/evm.c | 9 +++++++++ configs/am62px_evm_a53_defconfig | 1 + configs/j722s_evm_a53_defconfig | 1 + include/env/ti/mmc.env | 2 +- include/env/ti/ti_common.env | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-)
base-commit: 899b088674b6905710ce546f0a8848662904852a change-id: 20240628-b4-upstream-streamline-platform-f0d7453637b2
Best regards,
Manorit Chawdhry m-chawdhry@ti.com

Hi Nishanth,
On 10:28-20240701, Nishanth Menon wrote:
On 10:48-20240701, Manorit Chawdhry wrote:
fdtfile wasn't being populated in these boards, add the code in evm.c for the same.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com
Changes in v2:
- Replace findfdt with fdtfile as that is what the series fixes. (Nishanth)
- Drop findfdt as well for K3 platforms legacy support
- Link to v1: https://lore.kernel.org/r/20240628-b4-upstream-streamline-platform-v1-0-1765...
Please explain in your patches the impact the changes have on all platforms - not just TI K3 platforms. that was already asked on previous reviews, please provide the explanations in commit message to prevent folks from having to guess.
From my understanding, there should be no impact to any platform with
these changes, let me know if you notice any platform that is being impacted by the following change?
The way I see it is - 1. It's adding support for populating fdtfile with ti_set_fdt_env for j722s, am62p 2. It's moving name_fdt change to fdtfile ( as name_fdt is not defined anymore - and we need to move away from name_fdt as well due to deprecation warning ) in ti/mmc.env. 3. ti/mmc.env even though used in k2g devices along with K3, still have their own override of the variable that am changing in the common ti/mmc.env so should be no-impact. 3. Since fdtfile is being set by ti_set_fdt_env for all K3 platforms ( which are the only users of bootcmd_ti_mmc iiuc ) so we can remove findfdt from bootcmd_ti_mmc ( which is still legacy support and not used in the default BOOTCOMMAND ).
Let me know if am understanding something incorrectly.
Regards, Manorit
Dhruva Gole (1): include: env: ti_common: Remove findfdt
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for fdtfile configs: am62p|j722s_a53: Add CONFIG_BOARD_LATE_INIT
board/ti/am62px/evm.c | 9 +++++++++ board/ti/j722s/evm.c | 9 +++++++++ configs/am62px_evm_a53_defconfig | 1 + configs/j722s_evm_a53_defconfig | 1 + include/env/ti/mmc.env | 2 +- include/env/ti/ti_common.env | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-)
base-commit: 899b088674b6905710ce546f0a8848662904852a change-id: 20240628-b4-upstream-streamline-platform-f0d7453637b2
Best regards,
Manorit Chawdhry m-chawdhry@ti.com
-- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

Hi Nishanth,
On 10:23-20240702, Manorit Chawdhry wrote:
Hi Nishanth,
On 10:28-20240701, Nishanth Menon wrote:
On 10:48-20240701, Manorit Chawdhry wrote:
fdtfile wasn't being populated in these boards, add the code in evm.c for the same.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com
Changes in v2:
- Replace findfdt with fdtfile as that is what the series fixes. (Nishanth)
- Drop findfdt as well for K3 platforms legacy support
- Link to v1: https://lore.kernel.org/r/20240628-b4-upstream-streamline-platform-v1-0-1765...
Please explain in your patches the impact the changes have on all platforms - not just TI K3 platforms. that was already asked on previous reviews, please provide the explanations in commit message to prevent folks from having to guess.
From my understanding, there should be no impact to any platform with these changes, let me know if you notice any platform that is being impacted by the following change?
The way I see it is -
- It's adding support for populating fdtfile with ti_set_fdt_env for j722s, am62p
- It's moving name_fdt change to fdtfile ( as name_fdt is not defined anymore - and we need to move away from name_fdt as well due to deprecation warning ) in ti/mmc.env.
- ti/mmc.env even though used in k2g devices along with K3, still have their own override of the variable that am changing in the common ti/mmc.env so should be no-impact.
- Since fdtfile is being set by ti_set_fdt_env for all K3 platforms ( which are the only users of bootcmd_ti_mmc iiuc ) so we can remove findfdt from bootcmd_ti_mmc ( which is still legacy support and not used in the default BOOTCOMMAND ).
Let me know if am understanding something incorrectly.
With my current understanding, I have rolled a v3 with updated commit messages, let me know there if you feel am missing something.
Regards, Manorit
Regards, Manorit
Dhruva Gole (1): include: env: ti_common: Remove findfdt
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for fdtfile configs: am62p|j722s_a53: Add CONFIG_BOARD_LATE_INIT
board/ti/am62px/evm.c | 9 +++++++++ board/ti/j722s/evm.c | 9 +++++++++ configs/am62px_evm_a53_defconfig | 1 + configs/j722s_evm_a53_defconfig | 1 + include/env/ti/mmc.env | 2 +- include/env/ti/ti_common.env | 2 +- 6 files changed, 22 insertions(+), 2 deletions(-)
base-commit: 899b088674b6905710ce546f0a8848662904852a change-id: 20240628-b4-upstream-streamline-platform-f0d7453637b2
Best regards,
Manorit Chawdhry m-chawdhry@ti.com
-- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
participants (2)
-
Manorit Chawdhry
-
Nishanth Menon