summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2026-03-02 13:44:46 -0600
committerTom Rini <trini@konsulko.com>2026-03-02 13:44:46 -0600
commitc0ca147ac6228949a6d6497531c9f2f4a0dc6c67 (patch)
tree203dffa4165dbe5c98fb0e2a4594185782d53dbb /board
parentf6963fc232603007c661411fb31c57f1a9678a87 (diff)
parent56e5f5290f2daf886bf6306f426cbb1171deac01 (diff)
Merge tag 'u-boot-imx-next-20260228' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into nextnext
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/29404 - Miscelanous improvements for Siemens Capricorn board. - Convert i.MX6 IPUv3 driver to use clock framework. - Skip voltage switching for fixed 1.8V regulator on fsl_esdhc_imx. - Support printing imx8m pinmux. - Enter fastboot on USB boot by default on phycore-imx93. - Use arch override for env_get_location() on imx95.
Diffstat (limited to 'board')
-rw-r--r--board/nxp/imx8mm_evk/spl.c2
-rw-r--r--board/nxp/imx8mp_evk/imx8mp_evk.c7
-rw-r--r--board/nxp/imx8mp_evk/spl.c2
-rw-r--r--board/phytec/phycore_imx93/phycore-imx93.c5
-rw-r--r--board/siemens/capricorn/Kconfig2
-rw-r--r--board/siemens/capricorn/board.c56
-rw-r--r--board/siemens/capricorn/capricorn_default.env100
7 files changed, 131 insertions, 43 deletions
diff --git a/board/nxp/imx8mm_evk/spl.c b/board/nxp/imx8mm_evk/spl.c
index 5c588046ff4..50bae3a2bcc 100644
--- a/board/nxp/imx8mm_evk/spl.c
+++ b/board/nxp/imx8mm_evk/spl.c
@@ -106,8 +106,6 @@ void board_init_f(ulong dummy)
arch_cpu_init();
- init_uart_clk(1);
-
timer_init();
/* Clear the BSS. */
diff --git a/board/nxp/imx8mp_evk/imx8mp_evk.c b/board/nxp/imx8mp_evk/imx8mp_evk.c
index 489e5ad4d43..e17100e51ec 100644
--- a/board/nxp/imx8mp_evk/imx8mp_evk.c
+++ b/board/nxp/imx8mp_evk/imx8mp_evk.c
@@ -28,6 +28,13 @@ struct efi_capsule_update_info update_info = {
};
#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
+int board_mmc_get_env_dev(int devno)
+{
+ return devno;
+}
+#endif
+
int board_late_init(void)
{
#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC)
diff --git a/board/nxp/imx8mp_evk/spl.c b/board/nxp/imx8mp_evk/spl.c
index 5b4aac42830..27cd82e745a 100644
--- a/board/nxp/imx8mp_evk/spl.c
+++ b/board/nxp/imx8mp_evk/spl.c
@@ -102,8 +102,6 @@ void board_init_f(ulong dummy)
arch_cpu_init();
- init_uart_clk(1);
-
ret = spl_early_init();
if (ret) {
debug("spl_init() failed: %d\n", ret);
diff --git a/board/phytec/phycore_imx93/phycore-imx93.c b/board/phytec/phycore_imx93/phycore-imx93.c
index cdaedd52c14..036c9f5de7e 100644
--- a/board/phytec/phycore_imx93/phycore-imx93.c
+++ b/board/phytec/phycore_imx93/phycore-imx93.c
@@ -41,6 +41,11 @@ int board_late_init(void)
case MMC1_BOOT:
env_set_ulong("mmcdev", 0);
break;
+ case USB_BOOT:
+ printf("Detect USB boot. Will enter fastboot mode!\n");
+ if (!strcmp(env_get("bootcmd"), env_get_default("bootcmd")))
+ env_set("bootcmd", "fastboot 0; bootflow scan -lb;");
+ break;
default:
break;
}
diff --git a/board/siemens/capricorn/Kconfig b/board/siemens/capricorn/Kconfig
index fe230971e97..d6d1aad75b2 100644
--- a/board/siemens/capricorn/Kconfig
+++ b/board/siemens/capricorn/Kconfig
@@ -1,5 +1,7 @@
if TARGET_CAPRICORN
+config HUSH_INIT_VAR
+ def_bool y
config SYS_BOARD
default "capricorn"
diff --git a/board/siemens/capricorn/board.c b/board/siemens/capricorn/board.c
index 390a7b0d841..ba6c96a409c 100644
--- a/board/siemens/capricorn/board.c
+++ b/board/siemens/capricorn/board.c
@@ -5,6 +5,7 @@
* Copyright 2019 Siemens AG
*
*/
+#include <cli_hush.h>
#include <command.h>
#include <dm.h>
#include <env.h>
@@ -29,6 +30,7 @@
#include "../common/board.h"
#include "../common/eeprom.h"
#include "../common/factoryset.h"
+#include <firmware/imx/sci/sci.h>
#define GPIO_PAD_CTRL \
((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
@@ -355,16 +357,6 @@ int board_mmc_get_env_dev(int devno)
return devno;
}
-static int check_mmc_autodetect(void)
-{
- char *autodetect_str = env_get("mmcautodetect");
-
- if (autodetect_str && (strcmp(autodetect_str, "yes") == 0))
- return 1;
-
- return 0;
-}
-
/* This should be defined for each board */
__weak int mmc_map_to_kernel_blk(int dev_no)
{
@@ -373,23 +365,45 @@ __weak int mmc_map_to_kernel_blk(int dev_no)
void board_late_mmc_env_init(void)
{
- char cmd[32];
- char mmcblk[32];
u32 dev_no = mmc_get_env_dev();
- if (!check_mmc_autodetect())
- return;
-
env_set_ulong("mmcdev", dev_no);
+}
- /* Set mmcblk env */
- sprintf(mmcblk, "/dev/mmcblk%dp2 rootwait rw",
- mmc_map_to_kernel_blk(dev_no));
- env_set("mmcroot", mmcblk);
+#if defined(CONFIG_HUSH_INIT_VAR)
+int hush_init_var(void)
+{
+ sc_misc_bt_t boot_type;
- sprintf(cmd, "mmc dev %d", dev_no);
- run_command(cmd, 0);
+ if (sc_misc_get_boot_type(-1, &boot_type) != 0) {
+ puts("boottype cannot be retrieved\n");
+ return 0;
+ }
+
+ /*
+ * Set here explicitly a hush shell variable, so if a saveenv
+ * happens, this variable is *not* saved in U-Boot environment.
+ *
+ * This is for devices which are already in the field essential,
+ * as if such a device breaks, the cutsomer gets a new device
+ * with a new U-Boot version (and so a new U-Boot environment).
+ *
+ * But the customer makes a downgrade to an older U-Boot version,
+ * which does not have this code in, and runs now with a new
+ * U-Boot Environment (yes, protected Environment is not enabled
+ * there) and the old U-Boot must still work with the new U-Boot
+ * Environment. So we cannot store this variable in U-Boot
+ * Environment as a stored value will in this case never be over-
+ * written.
+ */
+ if (boot_type == 1) {
+ printf("boot-container fallback ocured\n");
+ set_local_var("fallback=1", 0);
+ }
+
+ return 0;
}
+#endif
#ifndef CONFIG_XPL_BUILD
static int load_parameters_from_factoryset(void)
diff --git a/board/siemens/capricorn/capricorn_default.env b/board/siemens/capricorn/capricorn_default.env
index c8b5b3d7da3..10d612b04fe 100644
--- a/board/siemens/capricorn/capricorn_default.env
+++ b/board/siemens/capricorn/capricorn_default.env
@@ -1,17 +1,23 @@
-altbootcmd=run bootcmd
+terminate_upgrade=bootcount reset; setenv upgrade_available 0
+altbootcmd=run terminate_upgrade; run toggle_partition
baudrate=115200
bootcmd=run flash_self;reset;
bootdelay=3
bootdir=targetdir/rootfs/boot
bootlimit=3
-check_upgrade=if test ${upgrade_available} -eq 1; then echo upgrade_available is set; if test ${bootcount} -gt ${bootlimit}; then setenv upgrade_available 0;echo toggle partition;run toggle_partition;fi;fi;
cntr_addr=0x88000000
cntr_file=os_cntr_signed.bin
console=ttyLP2
dtb_name_default=default
ethprime=eth1
fdt_addr=0x83000000
-flash_self=run mmc_boot
+flash_self=if test -n "$fallback";then
+ echo "fallback: $fallback";
+ run terminate_upgrade;
+ run toggle_partition;
+ else
+ run mmc_boot;
+ fi
flash_self_test=setenv testargs test loglevel=3 systemd.unit=test.target; run mmc_boot
hostname=capricorn
initrd_addr=0x83100000
@@ -19,30 +25,88 @@ initrd_high=0xffffffffffffffff
ip_method=none
kernel_name=Image
loadaddr=0x80400000
-mmc_boot=run set_bootargs;run check_upgrade; run set_partition;run set_bootargs_mmc;run mmc_load_bootfiles
-mmc_boot_fit=ext4load mmc 0:${mmc_part_nr} 0x88000000 boot/fitImage;if test -n ${A};then setenv bootargs ${bootargs} rootfs_sig=${sig_a};fi;if test -n ${B};then setenv bootargs ${bootargs} rootfs_sig=${sig_b};fi;bootm 0x88000000#conf-${dtb_name}.dtb;bootm
-mmc_boot_image=ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name}.dtb;if test $? -eq 1;then ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name_default}.dtb;fi; ext4load mmc 0:${mmc_part_nr} ${loadaddr} boot/${kernel_name}; booti ${loadaddr} - ${fdt_addr}
-mmc_load_bootfiles=echo -n Loading from eMMC ...; if test -e mmc 0:${mmc_part_nr} boot/fitImage; then echo fit; setenv fdt_high; setenv initrd_high; run mmc_boot_fit; else echo image; run mmc_boot_image; fi
-net_nfs=wdt dev scu-wdt; wdt stop; echo Booting from network ...; run set_bootargs_net; tftpboot ${loadaddr} ${bootdir}/${kernel_name}; printenv bootargs; if test ${kernel_name} = fitImage; then setenv fdt_high; setenv initrd_high; bootm ${loadaddr}#conf-${dtb_name}.dtb; else tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name}.dtb; if test $? -eq 1; then echo Loading default.dtb!; tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name_default}.dtb; fi; booti ${loadaddr} - ${fdt_addr}; fi
-net_unfs=setenv nfsopts vers=3,udp,rsize=4096,wsize=4096,nolock,port=3049,mountport=3048 rw; run net_nfs
-netdev=lan0
+mmc_boot=run set_bootargs; run set_partition;run set_bootargs_mmc;run mmc_load_bootfiles
+mmc_boot_fit=ext4load mmc 0:${mmc_part_nr} 0x88000000 boot/fitImage;
+ if test -n ${A};then
+ setenv bootargs ${bootargs} rootfs_sig=${sig_a};
+ fi;
+ if test -n ${B};then
+ setenv bootargs ${bootargs} rootfs_sig=${sig_b};
+ fi;
+ bootm 0x88000000#conf-${dtb_name}.dtb;bootm 0x88000000
+mmc_boot_image=ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name}.dtb;
+ if test $? -eq 1;then
+ ext4load mmc 0:${mmc_part_nr} ${fdt_addr} boot/${dtb_name_default}.dtb;
+ fi;
+ ext4load mmc 0:${mmc_part_nr} ${loadaddr} boot/${kernel_name};
+ booti ${loadaddr} - ${fdt_addr}
+mmc_load_bootfiles=echo -n Loading from eMMC ...;
+ if test -e mmc 0:${mmc_part_nr} boot/fitImage; then
+ echo fit; setenv fdt_high; setenv initrd_high; run mmc_boot_fit;
+ else
+ echo image; run mmc_boot_image;
+ fi
+net_nfs=wdt dev scu-wdt; wdt stop; echo Booting from network ...;
+ run set_bootargs_net; tftpboot ${loadaddr} ${bootdir}/${kernel_name};
+ printenv bootargs;
+ if test ${kernel_name} = fitImage; then
+ setenv fdt_high; setenv initrd_high;
+ bootm ${loadaddr}#conf-${dtb_name}.dtb;
+ else
+ tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name}.dtb;
+ if test $? -eq 1; then
+ echo Loading default.dtb!;
+ tftpboot ${fdt_addr} ${serverip}:${bootdir}/${dtb_name_default}.dtb;
+ fi;
+ booti ${loadaddr} - ${fdt_addr};
+ fi
+net_unfs=setenv nfsopts vers=3,udp,rsize=4096,wsize=4096,nolock,port=3049,mountport=3048 rw;
+ run net_nfs
+netdev=eth0
nfsopts=vers=3,udp,rsize=4096,wsize=4096,nolock rw
partitionset_active=A
rootfs_name=/dev/mmcblk0
rootpath=/home/projects/targetdir/rootfs
script_file=u-boot-commands.img
-set_bootargs_mmc=setenv bootargs ${bootargs} root=${mmc_active_vol} ro rootdelay=1 rootwait rootfstype=ext4 ip=${ip_method}
-set_bootargs_net=run set_bootargs; if test ${kernel_name} = fitImage; then setenv loadaddr 0x88000000; fi; setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
-set_bootargs=setenv bootargs console=${console},${baudrate} target_env=${target_env} ${testargs} ${optargs}
-set_partition=setenv ${partitionset_active} true;if test -n ${A}; then setenv mmc_part_nr 1;fi;if test -n ${B}; then setenv mmc_part_nr 2;fi;setenv mmc_active_vol ${rootfs_name}p${mmc_part_nr}
-tftp_run_script=tftpboot ${kernel_loadaddr} ${serverip}:${script_file};if test $? -eq 0;then source ${kernel_loadaddr};fi
-toggle_partition=setenv ${partitionset_active} true; if test -n ${A}; then setenv partitionset_active B; mmc partconf 0 1 2 0; env delete A; fi; if test -n ${B}; then setenv partitionset_active A; mmc partconf 0 1 1 0; env delete B; fi;saveenv; reset
+set_bootargs_mmc=setenv bootargs ${bootargs} root=${mmc_active_vol} ro rootdelay=1
+ rootwait rootfstype=ext4 ip=${ip_method}
+set_bootargs_net=run set_bootargs;
+ if test ${kernel_name} = fitImage; then
+ setenv loadaddr 0x88000000;
+ fi;
+ setenv bootargs ${bootargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts}
+ ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off
+set_bootargs=setenv bootargs console=${console},${baudrate} target_env=${target_env} ${testargs}
+ ${optargs}
+set_partition=mmc partconf 0 v_mmc_part_nr; setenv mmc_part_nr $v_mmc_part_nr;
+ setenv mmc_active_vol ${rootfs_name}p$v_mmc_part_nr
+tftp_run_script=tftpboot ${kernel_loadaddr} ${serverip}:${script_file};
+ if test $? -eq 0;then
+ source ${kernel_loadaddr};
+ fi
+toggle_partition=mmc partconf 0 v_mmc_part_nr;
+ if test $v_mmc_part_nr -eq 1;then
+ mmc partconf 0 1 2 0; setenv partitionset_active B;
+ elif test $v_mmc_part_nr -eq 2;then
+ mmc partconf 0 1 1 0; setenv partitionset_active A;
+ else
+ echo error mmc_part_nr $v_mmc_part_nr;
+ fi;
+ saveenv;reset
upgrade_available=0
emmc_dev=0
sd_dev=1
mfgtool_args=setenv bootargs console=${console},${baudrate} rdinit=/linuxrc clk_ignore_unused
kboot=booti
-bootcmd_mfg=run mfgtool_args; if iminfo ${initrd_addr}; then if test ${tee} = yes; then bootm ${tee_addr} ${initrd_addr} ${fdt_addr}; else booti ${loadaddr} ${initrd_addr} ${fdt_addr}; fi; else echo "Run fastboot ..."; fastboot usb auto; fi;
+bootcmd_mfg=run mfgtool_args;
+ if iminfo ${initrd_addr}; then
+ if test ${tee} = yes; then
+ bootm ${tee_addr} ${initrd_addr} ${fdt_addr};
+ else
+ booti ${loadaddr} ${initrd_addr} ${fdt_addr};
+ fi;
+ else
+ echo "Run fastboot ..."; fastboot usb auto;
+ fi;
fastboot_bytes=124c00
fastboot_dev=mmc
-mmcautodetect=yes