diff -Naur u-boot-2024.10.org/arch/arm/Kconfig u-boot-2024.10/arch/arm/Kconfig
--- u-boot-2024.10.org/arch/arm/Kconfig	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/arch/arm/Kconfig	2025-01-02 21:34:06.410041224 +0000
@@ -2035,7 +2035,7 @@
 	imply ADC
 	imply CMD_DM
 	imply DEBUG_UART_BOARD_INIT
-	imply BOOTSTD_DEFAULTS
+	imply BOOTSTD_DEFAULTS if !DISTRO_DEFAULTS
 	imply FAT_WRITE
 	imply SARADC_ROCKCHIP
 	imply SPL_SYSRESET
diff -Naur u-boot-2024.10.org/include/configs/px30_common.h u-boot-2024.10/include/configs/px30_common.h
--- u-boot-2024.10.org/include/configs/px30_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/px30_common.h	2025-01-02 21:05:11.028374025 +0000
@@ -25,11 +25,12 @@
 	"kernel_comp_addr_r=0x03e80000\0" \
 	"kernel_comp_size=0x2000000\0"
 
+#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
 	ROCKCHIP_DEVICE_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3036_common.h u-boot-2024.10/include/configs/rk3036_common.h
--- u-boot-2024.10.org/include/configs/rk3036_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3036_common.h	2025-01-02 21:05:11.029374011 +0000
@@ -20,6 +20,8 @@
 	"kernel_addr_r=0x62000000\0" \
 	"ramdisk_addr_r=0x64000000\0"
 
+#include <config_distro_bootcmd.h>
+
 /* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board,
  * so limit the fdt reallocation to that */
 #define CFG_EXTRA_ENV_SETTINGS \
@@ -27,6 +29,6 @@
 	"fdt_high=0x7fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3066_common.h u-boot-2024.10/include/configs/rk3066_common.h
--- u-boot-2024.10.org/include/configs/rk3066_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3066_common.h	2025-01-02 21:05:11.030373996 +0000
@@ -21,12 +21,14 @@
 	"kernel_addr_r=0x62000000\0" \
 	"ramdisk_addr_r=0x64000000\0"
 
+#include <config_distro_bootcmd.h>
+
 #define CFG_EXTRA_ENV_SETTINGS \
 	"fdt_high=0x6fffffff\0" \
 	"initrd_high=0x6fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
 	ROCKCHIP_DEVICE_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3128_common.h u-boot-2024.10/include/configs/rk3128_common.h
--- u-boot-2024.10.org/include/configs/rk3128_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3128_common.h	2025-01-02 21:05:11.031373981 +0000
@@ -22,10 +22,11 @@
 	"kernel_addr_r=0x62000000\0" \
 	"ramdisk_addr_r=0x64000000\0"
 
+#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
 	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3188_common.h u-boot-2024.10/include/configs/rk3188_common.h
--- u-boot-2024.10.org/include/configs/rk3188_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3188_common.h	2025-01-02 21:05:11.034373936 +0000
@@ -20,6 +20,8 @@
 	"kernel_addr_r=0x62000000\0" \
 	"ramdisk_addr_r=0x64000000\0"
 
+#include <config_distro_bootcmd.h>
+
 /* Linux fails to load the fdt if it's loaded above 256M on a Rock board,
  * so limit the fdt reallocation to that */
 #define CFG_EXTRA_ENV_SETTINGS \
@@ -29,6 +31,6 @@
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
 	ROCKCHIP_DEVICE_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk322x_common.h u-boot-2024.10/include/configs/rk322x_common.h
--- u-boot-2024.10.org/include/configs/rk322x_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk322x_common.h	2025-01-02 21:05:11.035373921 +0000
@@ -21,6 +21,8 @@
 	"kernel_addr_r=0x62000000\0" \
 	"ramdisk_addr_r=0x64000000\0"
 
+#include <config_distro_bootcmd.h>
+
 /* Linux fails to load the fdt if it's loaded above 512M on a evb-rk3036 board,
  * so limit the fdt reallocation to that */
 #define CFG_EXTRA_ENV_SETTINGS \
@@ -28,6 +30,6 @@
 	"fdt_high=0x7fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3288_common.h u-boot-2024.10/include/configs/rk3288_common.h
--- u-boot-2024.10.org/include/configs/rk3288_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3288_common.h	2025-01-02 21:05:11.036373906 +0000
@@ -22,6 +22,8 @@
 	"kernel_addr_r=0x02000000\0" \
 	"ramdisk_addr_r=0x04000000\0"
 
+#include <config_distro_bootcmd.h>
+
 /* Linux fails to load the fdt if it's loaded above 256M on a Rock 2 board, so
  * limit the fdt reallocation to that */
 #define CFG_EXTRA_ENV_SETTINGS \
@@ -31,6 +33,6 @@
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
 	ROCKCHIP_DEVICE_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3308_common.h u-boot-2024.10/include/configs/rk3308_common.h
--- u-boot-2024.10.org/include/configs/rk3308_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3308_common.h	2025-01-02 21:05:11.037373891 +0000
@@ -25,11 +25,13 @@
 	"kernel_comp_addr_r=0x08000000\0"	\
 	"kernel_comp_size=0x2000000\0"
 
++#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS		\
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"	\
 	"partitions=" PARTS_DEFAULT	\
 	ENV_MEM_LAYOUT_SETTINGS		\
 	ROCKCHIP_DEVICE_SETTINGS	\
 	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif /* __CONFIG_RK3308_COMMON_H */
diff -Naur u-boot-2024.10.org/include/configs/rk3328_common.h u-boot-2024.10/include/configs/rk3328_common.h
--- u-boot-2024.10.org/include/configs/rk3328_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3328_common.h	2025-01-02 21:05:11.041373832 +0000
@@ -25,11 +25,12 @@
 	"kernel_comp_addr_r=0x08000000\0"	\
 	"kernel_comp_size=0x2000000\0"
 
+#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS		\
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"	\
 	"partitions=" PARTS_DEFAULT	\
 	ENV_MEM_LAYOUT_SETTINGS		\
 	ROCKCHIP_DEVICE_SETTINGS	\
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif /* __CONFIG_RK3328_COMMON_H */
diff -Naur u-boot-2024.10.org/include/configs/rk3368_common.h u-boot-2024.10/include/configs/rk3368_common.h
--- u-boot-2024.10.org/include/configs/rk3368_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3368_common.h	2025-01-02 21:05:11.042373817 +0000
@@ -22,9 +22,11 @@
 	"kernel_addr_r=0x280000\0" \
 	"ramdisk_addr_r=0x5bf0000\0"
 
+#include <config_distro_bootcmd.h>
+
 #define CFG_EXTRA_ENV_SETTINGS \
 	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
-	ENV_MEM_LAYOUT_SETTINGS \
-	"boot_targets=" BOOT_TARGETS "\0"
+	ENV_MEM_LAYOUT_SETTINGS	\
+	BOOTENV
 
 #endif
diff -Naur u-boot-2024.10.org/include/configs/rk3399_common.h u-boot-2024.10/include/configs/rk3399_common.h
--- u-boot-2024.10.org/include/configs/rk3399_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3399_common.h	2025-01-02 23:03:05.501053098 +0000
@@ -31,12 +31,16 @@
 	"kernel_comp_addr_r=0x08000000\0"	\
 	"kernel_comp_size=0x2000000\0"
 
+#include <config_distro_bootcmd.h>
+#include <env/distro/sf.h>
+
 #define CFG_EXTRA_ENV_SETTINGS		\
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"	\
 	"partitions=" PARTS_DEFAULT	\
 	ENV_MEM_LAYOUT_SETTINGS		\
 	ROCKCHIP_DEVICE_SETTINGS	\
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV \
+	BOOTENV_SF
 
 #endif /* CONFIG_SPL_BUILD */
 
diff -Naur u-boot-2024.10.org/include/configs/rk3568_common.h u-boot-2024.10/include/configs/rk3568_common.h
--- u-boot-2024.10.org/include/configs/rk3568_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3568_common.h	2025-01-02 21:05:11.042373817 +0000
@@ -27,11 +27,14 @@
 	"ramdisk_addr_r=0x12180000\0"	\
 	"kernel_comp_size=0x8000000\0"
 
+#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS		\
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"	\
 	"partitions=" PARTS_DEFAULT	\
 	ENV_MEM_LAYOUT_SETTINGS		\
 	ROCKCHIP_DEVICE_SETTINGS	\
+	BOOTENV
+
 	"boot_targets=" BOOT_TARGETS "\0"
 
 #endif /* __CONFIG_RK3568_COMMON_H */
diff -Naur u-boot-2024.10.org/include/configs/rk3588_common.h u-boot-2024.10/include/configs/rk3588_common.h
--- u-boot-2024.10.org/include/configs/rk3588_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rk3588_common.h	2025-01-02 21:05:11.043373802 +0000
@@ -26,11 +26,12 @@
 	"ramdisk_addr_r=0x12180000\0"	\
 	"kernel_comp_size=0x8000000\0"
 
+#include <config_distro_bootcmd.h>
 #define CFG_EXTRA_ENV_SETTINGS		\
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0"	\
 	"partitions=" PARTS_DEFAULT	\
 	ENV_MEM_LAYOUT_SETTINGS		\
 	ROCKCHIP_DEVICE_SETTINGS	\
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif /* __CONFIG_RK3588_COMMON_H */
diff -Naur u-boot-2024.10.org/include/configs/rockchip-common.h u-boot-2024.10/include/configs/rockchip-common.h
--- u-boot-2024.10.org/include/configs/rockchip-common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rockchip-common.h	2025-01-02 21:05:11.044373787 +0000
@@ -13,7 +13,69 @@
 
 #ifndef CONFIG_SPL_BUILD
 
+/* First try to boot from SD (index 1), then eMMC (index 0) */
+#if IS_ENABLED(CONFIG_CMD_MMC)
+	#define BOOT_TARGET_MMC(func) \
+		func(MMC, mmc, 1) \
+		func(MMC, mmc, 0)
+#else
+	#define BOOT_TARGET_MMC(func)
+#endif
+
+#if IS_ENABLED(CONFIG_CMD_NVME)
+	#define BOOT_TARGET_NVME(func) func(NVME, nvme, 0)
+#else
+	#define BOOT_TARGET_NVME(func)
+#endif
+
+#if IS_ENABLED(CONFIG_CMD_SCSI)
+	#define BOOT_TARGET_SCSI(func) func(SCSI, scsi, 0)
+#else
+	#define BOOT_TARGET_SCSI(func)
+#endif
+
+#if IS_ENABLED(CONFIG_CMD_USB)
+	#define BOOT_TARGET_USB(func) func(USB, usb, 0)
+#else
+	#define BOOT_TARGET_USB(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_PXE)
+	#define BOOT_TARGET_PXE(func) func(PXE, pxe, na)
+#else
+	#define BOOT_TARGET_PXE(func)
+#endif
+
+#if CONFIG_IS_ENABLED(CMD_DHCP)
+	#define BOOT_TARGET_DHCP(func) func(DHCP, dhcp, na)
+#else
+	#define BOOT_TARGET_DHCP(func)
+#endif
+
+#if IS_ENABLED(CONFIG_CMD_SF)
+	#define BOOT_TARGET_SF(func)	func(SF, sf, 0)
+#else
+	#define BOOT_TARGET_SF(func)
+#endif
+
+#ifdef CONFIG_ROCKCHIP_RK3399
+#define BOOT_TARGET_DEVICES(func) \
+	BOOT_TARGET_MMC(func) \
+	BOOT_TARGET_NVME(func) \
+	BOOT_TARGET_SCSI(func) \
+	BOOT_TARGET_USB(func) \
+	BOOT_TARGET_PXE(func) \
+	BOOT_TARGET_DHCP(func) \
+	BOOT_TARGET_SF(func)
 #define BOOT_TARGETS	"mmc1 mmc0 nvme scsi usb pxe dhcp spi"
+#else
+#define BOOT_TARGET_DEVICES(func) \
+	BOOT_TARGET_MMC(func) \
+	BOOT_TARGET_USB(func) \
+	BOOT_TARGET_PXE(func) \
+	BOOT_TARGET_DHCP(func)
+#define BOOT_TARGETS	"mmc1 mmc0 usb pxe dhcp"
+#endif
 
 #ifdef CONFIG_ARM64
 #define ROOT_UUID "B921B045-1DF0-41C3-AF44-4C6F280D3FAE;\0"
diff -Naur u-boot-2024.10.org/include/configs/rv1108_common.h u-boot-2024.10/include/configs/rv1108_common.h
--- u-boot-2024.10.org/include/configs/rv1108_common.h	2024-10-07 14:54:35.000000000 +0000
+++ u-boot-2024.10/include/configs/rv1108_common.h	2025-01-02 21:05:11.048373728 +0000
@@ -27,6 +27,6 @@
 	ENV_MEM_LAYOUT_SETTINGS \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
-	"boot_targets=" BOOT_TARGETS "\0"
+	BOOTENV
 
 #endif
