[PATCH v3] board: phytec: phycore-imx93: Add phyBOARD-Segin-i.MX93 support

Primoz Fiser primoz.fiser at norik.com
Tue Jan 30 13:25:15 CET 2024


Hi Mathieu,

On 30. 01. 24 10:43, Mathieu Othacehe wrote:
> 
> Hello,
> 
>> Please remove findfdt script.
>>
>> Not needed when you set fdt_file to CONFIG_DEFAULT_FDT_FILE above.
> 
> The reason I used findfdt is that CONFIG_DEFAULT_FDT_FILE is a string
> so, we end up with:
> 
> --8<---------------cut here---------------start------------->8---
> fdt_file="oftree"
> --8<---------------cut here---------------end--------------->8---
> 
> which gives:
> 
> --8<---------------cut here---------------start------------->8---
> u-boot=> run loadfdt
> Failed to load '"oftree"'
> --8<---------------cut here---------------end--------------->8---
> 
> whereas, if I set:
> 
> --8<---------------cut here---------------start------------->8---
> u-boot=> setenv fdt_file oftree
> u-boot=> run loadfdt           
> 24579 bytes read in 5 ms (4.7 MiB/s)
> --8<---------------cut here---------------end--------------->8---
> 
> I then see three options: introduce an unstrigify macro, hardcode
> fdt_file=oftree in the env file, or use the findfdt hack.

On my side there is no problem, see my output here:

U-Boot 2024.04-rc1-00004-g686cb1ca1391-dirty (Jan 30 2024 - 10:58:24 +0100)

CPU:   i.MX93 rev1.1
Model: PHYTEC phyBOARD-Segin-i.MX93
DRAM:  1 GiB
Core:  184 devices, 22 uclasses, devicetree: separate
WDT:   Started wdog at 42490000 with servicing every 1000ms (40s timeout)
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
In:    serial at 44380000
Out:   serial at 44380000
Err:   serial at 44380000
Net:   eth0: ethernet at 42890000
Hit any key to stop autoboot:  0
u-boot=>
u-boot=> env default -a
## Resetting to default environment
u-boot=> saveenv; saveenv
Saving Environment to MMC... Writing to redundant MMC(1)... OK
Saving Environment to MMC... Writing to MMC(1)... OK
u-boot=> printenv fdt_file
fdt_file="oftree"
u-boot=> run loadfdt
48532 bytes read in 5 ms (9.3 MiB/s)
u-boot=> boot
switch to partitions #0, OK
mmc1 is current device
32688640 bytes read in 411 ms (75.8 MiB/s)
Booting from mmc ...
83 bytes read in 1 ms (81.1 KiB/s)
48532 bytes read in 4 ms (11.6 MiB/s)
Working FDT set to 83000000
3615 bytes read in 3 ms (1.1 MiB/s)
1209 bytes read in 2 ms (589.8 KiB/s)
## Flattened Device Tree blob at 83000000
   Booting using the fdt blob at 0x83000000
Working FDT set to 83000000
   Loading Device Tree to 00000000bcf0a000, end 00000000bcf19fff ... OK
Working FDT set to bcf0a000

Starting kernel ...



Here is my diff compared to your v3:

--- a/board/phytec/phycore_imx93/phycore_imx93.env
+++ b/board/phytec/phycore_imx93/phycore_imx93.env
@@ -5,7 +5,7 @@ console=ttyLP0
 fdt_addr=0x83000000
 fdto_addr=0x830c0000
 bootenv_addr=0x83500000
-fdt_file=undefined
+fdt_file=CONFIG_DEFAULT_FDT_FILE
 ipaddr=192.168.3.11
 serverip=192.168.3.10
 netmask=255.255.255.0
@@ -22,11 +22,7 @@ mmcautodetect=yes
 mmcargs=setenv bootargs ${mcore_clk} console=${console},${baudrate}
earlycon
        root=/dev/mmcblk${mmcdev}p${mmcroot} ${raucargs} rootwait rw
 loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
-findfdt=if test $fdt_file = undefined; then
-            setenv fdt_file CONFIG_DEFAULT_FDT_FILE ;
-        fi;
-        echo fdt_file=${fdt_file};
-loadfdt=run findfdt;fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr}
${fdt_file}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
 mmc_load_overlay=fatload mmc ${mmcdev}:${mmcpart} ${fdto_addr} ${overlay}
 mmc_apply_overlays=



So this should work. We have the same in the downstream u-boot-imx.

Also, in-tree, phycore_am62x.env has the same:

fdtfile=CONFIG_DEFAULT_FDT_FILE
loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdtaddr} ${fdtfile}

Can you re-check, please?

Maybe check your include/generated/environment.h?

> 
> I'm not sure which one is the better?
> 
> I will fix all the other remarks in the v4.

OK, thanks.

I spotted additional remark that was not fixed in v3:

In file doc/board/phytec/imx93-phyboard-segin.rst, can you please change
title from:

phyCORE-i.MX 93 on a phyBOARD-Segin
===================================

to:

phyBOARD-Segin-i.MX93
=====================

and this text from:

U-Boot for the phyCORE-i.MX 93 on a phyBOARD-Segin.

to:

U-Boot for the phyBOARD-Segin-i.MX93.


Last but not least, please remove:

#define EEPROM_ADDR            0x50

from board/phytec/phycore_imx93/spl.c

As support for PHYTEC_EEPROM will come later and that define will be
part of that series.

Thanks and best regards,
Primoz

> 
> Thanks,
> 
> Mathieu





More information about the U-Boot mailing list