[PATCH 0/3] Fix findfdt for j722s and am62p

findfdt 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 --- Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for findfdt 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 +- 5 files changed, 21 insertions(+), 1 deletion(-) --- 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};

On 13:53-20240628, Manorit Chawdhry wrote:
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}
Did you check the other users of mmc.env file? How about legacy boards like k2g?
envboot=if mmc dev ${mmcdev}; then if mmc rescan; then echo SD/MMC found on device ${mmcdev};
-- 2.45.1

Hi Nishanth,
On 08:05-20240628, Nishanth Menon wrote:
On 13:53-20240628, Manorit Chawdhry wrote:
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}
Did you check the other users of mmc.env file? How about legacy boards like k2g?
Am not sure about the status of migration to ti_set_fdt_env for k2g platforms. Though I see k2g redefining get_fdt_mmc with name_fdt itself so hoping that this change wouldn't affect them. If they also migrate to ti_set_fdt_env then I think for them also this change would work and the override can be deleted later.
Regards, Manorit
envboot=if mmc dev ${mmcdev}; then if mmc rescan; then echo SD/MMC found on device ${mmcdev};
-- 2.45.1
-- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D

stdboot and legacy boot now depend on findfdt and findfdt is populated based on evm code now. Populate findfdt 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 findfdt 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

On 13:53-20240628, Manorit Chawdhry wrote:
findfdt wasn't being populated in these boards, add the code in evm.c for the same.
why not just drop findfdt? I am ok with #2,3 more or less, but keeping findfdt alive is just a bad direction when we are moving to stdboot flow.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for findfdt 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 +- 5 files changed, 21 insertions(+), 1 deletion(-)
base-commit: 899b088674b6905710ce546f0a8848662904852a change-id: 20240628-b4-upstream-streamline-platform-f0d7453637b2
Best regards,
Manorit Chawdhry m-chawdhry@ti.com

Hi Nishanth,
On 08:06-20240628, Nishanth Menon wrote:
On 13:53-20240628, Manorit Chawdhry wrote:
findfdt wasn't being populated in these boards, add the code in evm.c for the same.
why not just drop findfdt? I am ok with #2,3 more or less, but keeping
typo... should've written fdtfile. When all the boards migrate to your series for pulling in fdtfile from ti_set_fdt_env itself, I think findfdt can be dropped for k3 boards at that point. This series moves am62px and j722s to that.
Regards, Manorit
findfdt alive is just a bad direction when we are moving to stdboot flow.
Signed-off-by: Manorit Chawdhry m-chawdhry@ti.com
Manorit Chawdhry (3): include: env: ti: mmc: Change name_fdt usage to fdtfile board: ti: am62p|j722s: Add ti_set_fdt_env for findfdt 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 +- 5 files changed, 21 insertions(+), 1 deletion(-)
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