U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file
@ 2025-12-01 10:56 alice.guo
  2025-12-01 14:41 ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: alice.guo @ 2025-12-01 10:56 UTC (permalink / raw)
  To: u-boot, uboot-imx
  Cc: sbabic, festevam, trini, peng.fan, alice.guo, sjg, davidzangcs

From: Alice Guo <alice.guo@nxp.com>

Add board-specific environment variables to imx8ulp_evk.env for better
maintainability.

Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
 arch/arm/mach-imx/imx8ulp/Kconfig           |  1 +
 board/freescale/imx8ulp_evk/imx8ulp_evk.env | 99 +++++++++++++++++++++
 configs/imx8ulp_evk_defconfig               |  5 +-
 include/configs/imx8ulp_evk.h               | 24 -----
 4 files changed, 102 insertions(+), 27 deletions(-)
 create mode 100644 board/freescale/imx8ulp_evk/imx8ulp_evk.env

diff --git a/arch/arm/mach-imx/imx8ulp/Kconfig b/arch/arm/mach-imx/imx8ulp/Kconfig
index fbca241e106..e96e34651ce 100644
--- a/arch/arm/mach-imx/imx8ulp/Kconfig
+++ b/arch/arm/mach-imx/imx8ulp/Kconfig
@@ -27,6 +27,7 @@ config TARGET_IMX8ULP_EVK
 	select IMX8ULP
 	select SUPPORT_SPL
 	select IMX8ULP_DRAM
+	imply BOOTSTD_FULL
 
 endchoice
 
diff --git a/board/freescale/imx8ulp_evk/imx8ulp_evk.env b/board/freescale/imx8ulp_evk/imx8ulp_evk.env
new file mode 100644
index 00000000000..bfa43eedf84
--- /dev/null
+++ b/board/freescale/imx8ulp_evk/imx8ulp_evk.env
@@ -0,0 +1,99 @@
+#ifdef CONFIG_AHAB_BOOT
+sec_boot=yes
+#else
+sec_boot=no
+#endif
+
+jh_clk=
+jh_mmcboot=setenv jh_clk kvm.enable_virt_at_load=false clk_ignore_unused mem=896MB; run loadimage; run mmcboot
+jh_netboot=setenv jh_clk kvm.enable_virt_at_load=false clk_ignore_unused mem=896MB; run netboot
+
+
+initrd_addr=0x83800000
+initrd_high=0xffffffffffffffff
+scriptaddr=0x83500000
+splashimage=0x90000000
+kernel_addr_r=CONFIG_SYS_LOAD_ADDR
+fdtoverlay_addr_r=0x83040000
+fdt_addr_r=0x83000000
+fdt_addr=0x83000000
+fdt_high=0xffffffffffffffff
+cntr_addr=0x98000000
+emmc_dev=0
+sd_dev=2
+mmcdev=CONFIG_SYS_MMC_ENV_DEV
+mmcpart=1
+image=Image
+cntr_file=os_cntr_signed.bin
+fdtfile=CONFIG_DEFAULT_FDT_FILE
+console=ttyLP1,115200 earlycon
+bootm_size=0x10000000
+boot_fit=no
+mmcroot=/dev/mmcblk0p2 rootwait rw
+mmcautodetect=yes
+mmcargs=setenv bootargs ${jh_clk} console=${console} root=${mmcroot}
+netargs=setenv bootargs ${jh_clk} console=${console}
+        root=/dev/nfs
+        ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
+loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
+loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
+loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
+loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}
+bootscript=echo Running bootscript from mmc ...; source
+auth_os=booti ${cntr_addr}
+boot_os=booti ${loadaddr} - ${fdt_addr_r}
+mmcboot=echo Booting from mmc ...;
+        run mmcargs;
+        if test ${sec_boot} = yes; then
+                run auth_os;
+        else
+            if test ${boot_fit} = yes || test ${boot_fit} = try; then
+                bootm ${loadaddr};
+            else
+                if run loadfdt loadimage; then
+                    run boot_os;
+                else
+                    echo WARN: Cannot load the fdt and image;
+                fi;
+            fi;
+        fi;
+netboot=echo Booting from net ...;
+        run netargs;
+        if test ${ip_dyn} = yes; then
+            setenv get_cmd dhcp;
+        else
+            setenv get_cmd tftp;
+        fi;
+        if test ${sec_boot} = yes; then
+            ${get_cmd} ${cntr_addr} ${cntr_file};
+            run auth_os;
+        else
+            ${get_cmd} ${loadaddr} ${image};
+            if test ${boot_fit} = yes || test ${boot_fit} = try; then
+                bootm ${loadaddr};
+            else
+                if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then
+                    run boot_os;
+                else
+                    echo WARN: Cannot load the DT;
+                fi;
+            fi;
+        fi;
+bsp_bootcmd=echo Running BSP bootcmd ...;
+            mmc dev ${mmcdev}; if mmc rescan; then
+            if run loadbootscript; then
+                run bootscript;
+            else
+                if test ${sec_boot} = yes; then
+                    if run loadcntr; then
+                        run mmcboot;
+                    else run netboot;
+                    fi;
+                else
+                    if run loadimage; then
+                        run mmcboot;
+                    else run netboot;
+                    fi;
+                fi;
+            fi;
+        fi;
diff --git a/configs/imx8ulp_evk_defconfig b/configs/imx8ulp_evk_defconfig
index e750b3d9ae0..f8a87dde5cf 100644
--- a/configs/imx8ulp_evk_defconfig
+++ b/configs/imx8ulp_evk_defconfig
@@ -27,9 +27,8 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_DISTRO_DEFAULTS=y
-CONFIG_BOOTDELAY=0
-CONFIG_BOOTCOMMAND="run distro_bootcmd;run bsp_bootcmd"
-CONFIG_DEFAULT_FDT_FILE="imx8ulp-evk"
+CONFIG_BOOTCOMMAND="bootflow scan -l; run bsp_bootcmd"
+CONFIG_DEFAULT_FDT_FILE="imx8ulp-evk.dtb"
 CONFIG_SYS_CBSIZE=2048
 CONFIG_SYS_PBSIZE=2068
 CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/include/configs/imx8ulp_evk.h b/include/configs/imx8ulp_evk.h
index 9308f5234f4..edfd6f70815 100644
--- a/include/configs/imx8ulp_evk.h
+++ b/include/configs/imx8ulp_evk.h
@@ -21,30 +21,6 @@
 #define CFG_FEC_MXC_PHYADDR		1
 #endif
 
-#ifdef CONFIG_DISTRO_DEFAULTS
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 0)
-
-#include <config_distro_bootcmd.h>
-#else
-#define BOOTENV
-#endif
-
-/* Initial environment variables */
-#define CFG_EXTRA_ENV_SETTINGS		\
-	BOOTENV \
-	"scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-	"image=Image\0" \
-	"console=ttyLP1,115200 earlycon\0" \
-	"fdt_addr_r=0x83000000\0"			\
-	"boot_fit=no\0" \
-	"fdtfile=imx8ulp-evk.dtb\0" \
-	"initrd_addr=0x83800000\0"		\
-	"bootm_size=0x10000000\0" \
-	"mmcpart=1\0" \
-	"mmcroot=/dev/mmcblk2p2 rootwait rw\0" \
-
 /* Link Definitions */
 
 #define CFG_SYS_INIT_RAM_ADDR	0x80000000
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file
  2025-12-01 10:56 [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file alice.guo
@ 2025-12-01 14:41 ` Tom Rini
  2025-12-02  1:49   ` Peng Fan
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2025-12-01 14:41 UTC (permalink / raw)
  To: alice.guo
  Cc: u-boot, uboot-imx, sbabic, festevam, peng.fan, alice.guo, sjg,
	davidzangcs

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Mon, Dec 01, 2025 at 06:56:56PM +0800, alice.guo@oss.nxp.com wrote:

> From: Alice Guo <alice.guo@nxp.com>
> 
> Add board-specific environment variables to imx8ulp_evk.env for better
> maintainability.
> 
> Signed-off-by: Alice Guo <alice.guo@nxp.com>
[snip]
> +fdt_high=0xffffffffffffffff

NAK. I just the other week sent out 40+ patches removing that setting
from other platforms and you weren't even setting it before.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file
  2025-12-01 14:41 ` Tom Rini
@ 2025-12-02  1:49   ` Peng Fan
  2025-12-02  2:16     ` Tom Rini
  0 siblings, 1 reply; 4+ messages in thread
From: Peng Fan @ 2025-12-02  1:49 UTC (permalink / raw)
  To: Tom Rini, Alice Guo (OSS)
  Cc: u-boot@lists.denx.de, dl-uboot-imx, sbabic@nabladev.com,
	festevam@gmail.com, Alice Guo, sjg@chromium.org,
	davidzangcs@gmail.com

> Subject: Re: [PATCH v1 1/2] imx8ulp_evk: Move environment variables
> to .env file
> 
> On Mon, Dec 01, 2025 at 06:56:56PM +0800, alice.guo@oss.nxp.com
> wrote:
> 
> > From: Alice Guo <alice.guo@nxp.com>
> >
> > Add board-specific environment variables to imx8ulp_evk.env for
> better
> > maintainability.
> >
> > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> [snip]
> > +fdt_high=0xffffffffffffffff
> 
> NAK. I just the other week sent out 40+ patches removing that setting
> from other platforms and you weren't even setting it before.

How about add a check in checkpatch.pl to give a warning on this?

Thanks,
Peng.

> 
> --
> Tom

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file
  2025-12-02  1:49   ` Peng Fan
@ 2025-12-02  2:16     ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2025-12-02  2:16 UTC (permalink / raw)
  To: Peng Fan
  Cc: Alice Guo (OSS), u-boot@lists.denx.de, dl-uboot-imx,
	sbabic@nabladev.com, festevam@gmail.com, Alice Guo,
	sjg@chromium.org, davidzangcs@gmail.com

[-- Attachment #1: Type: text/plain, Size: 960 bytes --]

On Tue, Dec 02, 2025 at 01:49:24AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH v1 1/2] imx8ulp_evk: Move environment variables
> > to .env file
> > 
> > On Mon, Dec 01, 2025 at 06:56:56PM +0800, alice.guo@oss.nxp.com
> > wrote:
> > 
> > > From: Alice Guo <alice.guo@nxp.com>
> > >
> > > Add board-specific environment variables to imx8ulp_evk.env for
> > better
> > > maintainability.
> > >
> > > Signed-off-by: Alice Guo <alice.guo@nxp.com>
> > [snip]
> > > +fdt_high=0xffffffffffffffff
> > 
> > NAK. I just the other week sent out 40+ patches removing that setting
> > from other platforms and you weren't even setting it before.
> 
> How about add a check in checkpatch.pl to give a warning on this?

There's already one which this triggered and is an ERROR level as well.
It also tells you not to disable initrd relocation, which is just a bad
idea in many cases, rather than often fatal to the OS like fdt_high is.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-02  2:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 10:56 [PATCH v1 1/2] imx8ulp_evk: Move environment variables to .env file alice.guo
2025-12-01 14:41 ` Tom Rini
2025-12-02  1:49   ` Peng Fan
2025-12-02  2:16     ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox