diff mbox series

[U-Boot,v1] rockchip: utilize CONFIG_DEFAULT_FDT_FILE

Message ID 20180525214505.37779-1-klaus.goger@theobroma-systems.com
State Accepted
Delegated to: Philipp Tomsich
Headers show
Series [U-Boot,v1] rockchip: utilize CONFIG_DEFAULT_FDT_FILE | expand

Commit Message

Klaus Goger May 25, 2018, 9:45 p.m. UTC
Currently the fdtfile environment variable is set to
CONFIG_DEFAULT_DEVICE_TREE which is іnternally used as U-Boot devicetree
source. The OS can use a different filename and Kconfig gives us the
ability to select a default devicetree via CONFIG_DEFAULT_FDT_FILE.
This also gives user configuring U-Boot via menuconfig the behaviour
someone would expect.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>

---

 configs/chromebit_mickey_defconfig  | 1 +
 configs/chromebook_jerry_defconfig  | 1 +
 configs/chromebook_minnie_defconfig | 1 +
 configs/evb-px5_defconfig           | 1 +
 configs/evb-rk3036_defconfig        | 1 +
 configs/evb-rk3128_defconfig        | 1 +
 configs/evb-rk3229_defconfig        | 1 +
 configs/evb-rk3288_defconfig        | 1 +
 configs/evb-rk3328_defconfig        | 1 +
 configs/evb-rk3399_defconfig        | 1 +
 configs/evb-rv1108_defconfig        | 1 +
 configs/fennec-rk3288_defconfig     | 1 +
 configs/firefly-rk3288_defconfig    | 1 +
 configs/firefly-rk3399_defconfig    | 1 +
 configs/geekbox_defconfig           | 1 +
 configs/kylin-rk3036_defconfig      | 1 +
 configs/lion-rk3368_defconfig       | 1 +
 configs/miqi-rk3288_defconfig       | 1 +
 configs/phycore-rk3288_defconfig    | 1 +
 configs/popmetal-rk3288_defconfig   | 1 +
 configs/puma-rk3399_defconfig       | 1 +
 configs/rock2_defconfig             | 1 +
 configs/rock_defconfig              | 1 +
 configs/sheep-rk3368_defconfig      | 1 +
 configs/tinker-rk3288_defconfig     | 1 +
 configs/vyasa-rk3288_defconfig      | 1 +
 include/configs/rk3036_common.h     | 1 +
 include/configs/rk3128_common.h     | 1 +
 include/configs/rk3188_common.h     | 1 +
 include/configs/rk322x_common.h     | 1 +
 include/configs/rk3288_common.h     | 2 +-
 include/configs/rk3328_common.h     | 1 +
 include/configs/rk3368_common.h     | 1 +
 include/configs/rk3399_common.h     | 2 +-
 34 files changed, 34 insertions(+), 2 deletions(-)

Comments

Vagrant Cascadian May 27, 2018, 7:16 p.m. UTC | #1
On 2018-05-25, Klaus Goger wrote:
> Currently the fdtfile environment variable is set to
> CONFIG_DEFAULT_DEVICE_TREE which is іnternally used as U-Boot devicetree
> source. The OS can use a different filename and Kconfig gives us the
> ability to select a default devicetree via CONFIG_DEFAULT_FDT_FILE.
> This also gives user configuring U-Boot via menuconfig the behaviour
> someone would expect.

I did wonder, given that many of these boards the value for
CONFIG_DEFAULT_DEVICE_TREE and CONFIG_DEFAULT_FDT_FILE is *nearly*
identical, if it wouldn't make sense to derive CONFIG_DEFAULT_FDT_FILE
From the value of CONFIG_DEFAULT_DEVICE_TREE by default, only overriding
it in the unusual cases.

Though there is a lot to be said about being explicit and not mixing the
two similar but not identical values.

Tested on puma-rk3399.

Tested-By: Vagrant Cascadian <vagrant@debian.org>

Was hoping to also test on firefly-rk3399, but having difficulty getting
u-boot installed unreleated to this patch. Also having troubles with
firefly-rk3288 due to mmc hanging the board: https://bugs.debian.org/898520.


live well,
  vagrant

>  configs/puma-rk3399_defconfig       | 1 +
>  include/configs/rk3399_common.h     | 2 +-

> diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
> index e6539a7da8..e5753b4f20 100644
> --- a/configs/puma-rk3399_defconfig
> +++ b/configs/puma-rk3399_defconfig
> @@ -16,6 +16,7 @@ CONFIG_DEBUG_UART=y
>  CONFIG_FIT=y
>  CONFIG_SPL_LOAD_FIT=y
>  CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/puma_rk3399/fit_spl_atf.its"
> +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
>  # CONFIG_DISPLAY_CPUINFO is not set
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_SPL_BOARD_INIT=y

> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
> index a61e74bc03..ee38107ea5 100644
> --- a/include/configs/rk3399_common.h
> +++ b/include/configs/rk3399_common.h
> @@ -55,7 +55,7 @@
>  #include <config_distro_bootcmd.h>
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	ENV_MEM_LAYOUT_SETTINGS \
> -	"fdtfile=rockchip/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
> +	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
>  	"partitions=" PARTS_DEFAULT \
>  	BOOTENV
>  
> -- 
> 2.11.0
Klaus Goger May 27, 2018, 7:36 p.m. UTC | #2
> On 27.05.2018, at 21:16, Vagrant Cascadian <vagrant@debian.org> wrote:
> 
> On 2018-05-25, Klaus Goger wrote:
>> Currently the fdtfile environment variable is set to
>> CONFIG_DEFAULT_DEVICE_TREE which is іnternally used as U-Boot devicetree
>> source. The OS can use a different filename and Kconfig gives us the
>> ability to select a default devicetree via CONFIG_DEFAULT_FDT_FILE.
>> This also gives user configuring U-Boot via menuconfig the behaviour
>> someone would expect.
> 
> I did wonder, given that many of these boards the value for
> CONFIG_DEFAULT_DEVICE_TREE and CONFIG_DEFAULT_FDT_FILE is *nearly*
> identical, if it wouldn't make sense to derive CONFIG_DEFAULT_FDT_FILE
> From the value of CONFIG_DEFAULT_DEVICE_TREE by default, only overriding
> it in the unusual cases.
> 
> Though there is a lot to be said about being explicit and not mixing the
> two similar but not identical values.

Would love to to that, but couldn’t find a proper way to do it.
CONFIG_DEFAULT_FDT_FILE is a Kconfig string and therefore always present in the .config.
If not set by the user or a defconfig it’s just a empty string (“”). So we can’t do a #ifdef and we can’t
do string compares with C macros. An option would be to have DEFAULT_FDT_FILE be hidden
behind a Kconfig bool (i.e CONFIG_DEFAULT_FDT_FILE depends on CONFIG_FDT_FILE)
But that change looked a bit to invasive for me.

> Tested on puma-rk3399.
> 
> Tested-By: Vagrant Cascadian <vagrant@debian.org>
> 
> Was hoping to also test on firefly-rk3399, but having difficulty getting
> u-boot installed unreleated to this patch. Also having troubles with
> firefly-rk3288 due to mmc hanging the board: https://bugs.debian.org/898520.
> 
> 
> live well,
>  vagrant
> 
>> configs/puma-rk3399_defconfig       | 1 +
>> include/configs/rk3399_common.h     | 2 +-
> 
>> diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
>> index e6539a7da8..e5753b4f20 100644
>> --- a/configs/puma-rk3399_defconfig
>> +++ b/configs/puma-rk3399_defconfig
>> @@ -16,6 +16,7 @@ CONFIG_DEBUG_UART=y
>> CONFIG_FIT=y
>> CONFIG_SPL_LOAD_FIT=y
>> CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/puma_rk3399/fit_spl_atf.its"
>> +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
>> # CONFIG_DISPLAY_CPUINFO is not set
>> CONFIG_DISPLAY_BOARDINFO_LATE=y
>> CONFIG_SPL_BOARD_INIT=y
> 
>> diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
>> index a61e74bc03..ee38107ea5 100644
>> --- a/include/configs/rk3399_common.h
>> +++ b/include/configs/rk3399_common.h
>> @@ -55,7 +55,7 @@
>> #include <config_distro_bootcmd.h>
>> #define CONFIG_EXTRA_ENV_SETTINGS \
>> 	ENV_MEM_LAYOUT_SETTINGS \
>> -	"fdtfile=rockchip/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
>> +	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
>> 	"partitions=" PARTS_DEFAULT \
>> 	BOOTENV
>> 
>> --
>> 2.11.0
Vagrant Cascadian June 22, 2018, 2:23 p.m. UTC | #3
On 2018-05-27, Vagrant Cascadian wrote:
> On 2018-05-25, Klaus Goger wrote:
>> Currently the fdtfile environment variable is set to
>> CONFIG_DEFAULT_DEVICE_TREE which is іnternally used as U-Boot devicetree
>> source. The OS can use a different filename and Kconfig gives us the
>> ability to select a default devicetree via CONFIG_DEFAULT_FDT_FILE.
>> This also gives user configuring U-Boot via menuconfig the behaviour
>> someone would expect.
...
> Tested on puma-rk3399.
>
> Tested-By: Vagrant Cascadian <vagrant@debian.org>
>
> Was hoping to also test on firefly-rk3399, but having difficulty getting
> u-boot installed unreleated to this patch.

Finally was able to test on Firefly-RK3399 applied against u-boot
2018.07-rc2, and it also works correctly.

Are there any outstanding concerns with this patch?


live well,
  vagrant
Klaus Goger June 22, 2018, 2:32 p.m. UTC | #4
> On 22.06.2018, at 16:23, Vagrant Cascadian <vagrant@debian.org> wrote:
> 
> On 2018-05-27, Vagrant Cascadian wrote:
>> On 2018-05-25, Klaus Goger wrote:
>>> Currently the fdtfile environment variable is set to
>>> CONFIG_DEFAULT_DEVICE_TREE which is іnternally used as U-Boot devicetree
>>> source. The OS can use a different filename and Kconfig gives us the
>>> ability to select a default devicetree via CONFIG_DEFAULT_FDT_FILE.
>>> This also gives user configuring U-Boot via menuconfig the behaviour
>>> someone would expect.
> ...
>> Tested on puma-rk3399.
>> 
>> Tested-By: Vagrant Cascadian <vagrant@debian.org>
>> 
>> Was hoping to also test on firefly-rk3399, but having difficulty getting
>> u-boot installed unreleated to this patch.
> 
> Finally was able to test on Firefly-RK3399 applied against u-boot
> 2018.07-rc2, and it also works correctly.
> 
> Are there any outstanding concerns with this patch?

There was a similar patch for sunxi[1] and there it was decided to introduce
the Kconfig option we talked about. That would make this patch obsolete.

@Jagan, I think Martin is still waiting for an answer from you.

[1] https://patchwork.ozlabs.org/patch/923692/
diff mbox series

Patch

diff --git a/configs/chromebit_mickey_defconfig b/configs/chromebit_mickey_defconfig
index d1728ef639..27b0dcaac4 100644
--- a/configs/chromebit_mickey_defconfig
+++ b/configs/chromebit_mickey_defconfig
@@ -11,6 +11,7 @@  CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-mickey"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-mickey.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/chromebook_jerry_defconfig b/configs/chromebook_jerry_defconfig
index 43d93f4637..95fe4bcb26 100644
--- a/configs/chromebook_jerry_defconfig
+++ b/configs/chromebook_jerry_defconfig
@@ -12,6 +12,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-jerry"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-jerry.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_BOARD_EARLY_INIT_F=y
diff --git a/configs/chromebook_minnie_defconfig b/configs/chromebook_minnie_defconfig
index 706809ca53..bc3bb292c8 100644
--- a/configs/chromebook_minnie_defconfig
+++ b/configs/chromebook_minnie_defconfig
@@ -12,6 +12,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-veyron-minnie"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-minnie.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/evb-px5_defconfig b/configs/evb-px5_defconfig
index c03682c927..a75c3e047f 100644
--- a/configs/evb-px5_defconfig
+++ b/configs/evb-px5_defconfig
@@ -7,6 +7,7 @@  CONFIG_TARGET_EVB_PX5=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3368-px5-evb"
 CONFIG_DEBUG_UART=y
 CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-px5-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_ARCH_EARLY_INIT_R=y
diff --git a/configs/evb-rk3036_defconfig b/configs/evb-rk3036_defconfig
index 33775e8cdd..840c731032 100644
--- a/configs/evb-rk3036_defconfig
+++ b/configs/evb-rk3036_defconfig
@@ -11,6 +11,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk"
 CONFIG_DEBUG_UART=y
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 # CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_DEFAULT_FDT_FILE="rk3036-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_FRAMEWORK is not set
diff --git a/configs/evb-rk3128_defconfig b/configs/evb-rk3128_defconfig
index 796d0ec92e..f4b132faf7 100644
--- a/configs/evb-rk3128_defconfig
+++ b/configs/evb-rk3128_defconfig
@@ -5,6 +5,7 @@  CONFIG_ROCKCHIP_RK3128=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3128-evb"
 CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
+CONFIG_DEFAULT_FDT_FILE="rk3128-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_FASTBOOT_BUF_ADDR=0x60800800
diff --git a/configs/evb-rk3229_defconfig b/configs/evb-rk3229_defconfig
index 710b0b4e1a..f6cb5fd897 100644
--- a/configs/evb-rk3229_defconfig
+++ b/configs/evb-rk3229_defconfig
@@ -10,6 +10,7 @@  CONFIG_TARGET_EVB_RK3229=y
 CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3229-evb"
 CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rk3229-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/evb-rk3288_defconfig b/configs/evb-rk3288_defconfig
index 7695277daf..3d8789cf36 100644
--- a/configs/evb-rk3288_defconfig
+++ b/configs/evb-rk3288_defconfig
@@ -10,6 +10,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-evb"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-evb-rk808.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/evb-rk3328_defconfig b/configs/evb-rk3328_defconfig
index 78ae24b56b..715ac827e2 100644
--- a/configs/evb-rk3328_defconfig
+++ b/configs/evb-rk3328_defconfig
@@ -6,6 +6,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3328-evb"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_FIT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_FASTBOOT_BUF_ADDR=0x800800
diff --git a/configs/evb-rk3399_defconfig b/configs/evb-rk3399_defconfig
index 05ad0da336..032aef0cac 100644
--- a/configs/evb-rk3399_defconfig
+++ b/configs/evb-rk3399_defconfig
@@ -12,6 +12,7 @@  CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/evb-rv1108_defconfig b/configs/evb-rv1108_defconfig
index d72f0d42e8..03ad19e425 100644
--- a/configs/evb-rv1108_defconfig
+++ b/configs/evb-rv1108_defconfig
@@ -6,6 +6,7 @@  CONFIG_TARGET_EVB_RV1108=y
 CONFIG_DEFAULT_DEVICE_TREE="rv1108-evb"
 CONFIG_DEBUG_UART=y
 # CONFIG_USE_BOOTCOMMAND is not set
+CONFIG_DEFAULT_FDT_FILE="rv1108-evb.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_FASTBOOT_BUF_ADDR=0x62000000
diff --git a/configs/fennec-rk3288_defconfig b/configs/fennec-rk3288_defconfig
index efdd583cf6..bad5c49dd7 100644
--- a/configs/fennec-rk3288_defconfig
+++ b/configs/fennec-rk3288_defconfig
@@ -11,6 +11,7 @@  CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-fennec.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/firefly-rk3288_defconfig b/configs/firefly-rk3288_defconfig
index b252d27464..1c83513647 100644
--- a/configs/firefly-rk3288_defconfig
+++ b/configs/firefly-rk3288_defconfig
@@ -10,6 +10,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-firefly"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-firefly.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/firefly-rk3399_defconfig b/configs/firefly-rk3399_defconfig
index 19c0b11040..661d6e96eb 100644
--- a/configs/firefly-rk3399_defconfig
+++ b/configs/firefly-rk3399_defconfig
@@ -12,6 +12,7 @@  CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-rockchip/make_fit_atf.py"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-firefly.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/geekbox_defconfig b/configs/geekbox_defconfig
index 4644e8dca5..6c2153a6f2 100644
--- a/configs/geekbox_defconfig
+++ b/configs/geekbox_defconfig
@@ -6,6 +6,7 @@  CONFIG_ROCKCHIP_RK3368=y
 CONFIG_TARGET_GEEKBOX=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3368-geekbox"
 CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-geekbox.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_REGMAP=y
diff --git a/configs/kylin-rk3036_defconfig b/configs/kylin-rk3036_defconfig
index ca53005ecb..59c699c3bc 100644
--- a/configs/kylin-rk3036_defconfig
+++ b/configs/kylin-rk3036_defconfig
@@ -10,6 +10,7 @@  CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3036-sdk"
 CONFIG_SPL_SYS_MALLOC_F_LEN=0x0
 # CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_DEFAULT_FDT_FILE="rk3036-kylin.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_FRAMEWORK is not set
diff --git a/configs/lion-rk3368_defconfig b/configs/lion-rk3368_defconfig
index 0a5e5b3df3..2ba29cbbcb 100644
--- a/configs/lion-rk3368_defconfig
+++ b/configs/lion-rk3368_defconfig
@@ -25,6 +25,7 @@  CONFIG_BOOTSTAGE=y
 CONFIG_SPL_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-lion-haikou.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_ARCH_EARLY_INIT_R=y
diff --git a/configs/miqi-rk3288_defconfig b/configs/miqi-rk3288_defconfig
index f44537c88f..bbd7c28d9f 100644
--- a/configs/miqi-rk3288_defconfig
+++ b/configs/miqi-rk3288_defconfig
@@ -10,6 +10,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-miqi"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-miqi.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/phycore-rk3288_defconfig b/configs/phycore-rk3288_defconfig
index d78b6d57b6..663c70f82c 100644
--- a/configs/phycore-rk3288_defconfig
+++ b/configs/phycore-rk3288_defconfig
@@ -11,6 +11,7 @@  CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-phycore-rdk.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/popmetal-rk3288_defconfig b/configs/popmetal-rk3288_defconfig
index 2670b4b75a..495bcbb983 100644
--- a/configs/popmetal-rk3288_defconfig
+++ b/configs/popmetal-rk3288_defconfig
@@ -11,6 +11,7 @@  CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-popmetal.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
index e6539a7da8..e5753b4f20 100644
--- a/configs/puma-rk3399_defconfig
+++ b/configs/puma-rk3399_defconfig
@@ -16,6 +16,7 @@  CONFIG_DEBUG_UART=y
 CONFIG_FIT=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_FIT_SOURCE="board/theobroma-systems/puma_rk3399/fit_spl_atf.its"
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-puma-haikou.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_BOARD_INIT=y
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index cd9a821974..41934ddfeb 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -10,6 +10,7 @@  CONFIG_DEFAULT_DEVICE_TREE="rk3288-rock2-square"
 CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-rock2-square.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/rock_defconfig b/configs/rock_defconfig
index 00ce9c465a..06287eee97 100644
--- a/configs/rock_defconfig
+++ b/configs/rock_defconfig
@@ -10,6 +10,7 @@  CONFIG_TARGET_ROCK=y
 CONFIG_SPL_STACK_R_ADDR=0x60080000
 CONFIG_DEFAULT_DEVICE_TREE="rk3188-radxarock"
 CONFIG_DEBUG_UART=y
+CONFIG_DEFAULT_FDT_FILE="rk3188-radxarock.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/sheep-rk3368_defconfig b/configs/sheep-rk3368_defconfig
index 8ada6823d0..6a2aff38a0 100644
--- a/configs/sheep-rk3368_defconfig
+++ b/configs/sheep-rk3368_defconfig
@@ -7,6 +7,7 @@  CONFIG_TARGET_SHEEP=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3368-sheep"
 CONFIG_DEBUG_UART=y
 CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3368-sheep.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_CMD_MMC=y
diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
index fb6bfa57ad..43b53cbe1b 100644
--- a/configs/tinker-rk3288_defconfig
+++ b/configs/tinker-rk3288_defconfig
@@ -11,6 +11,7 @@  CONFIG_DEBUG_UART=y
 # CONFIG_ANDROID_BOOT_IMAGE is not set
 CONFIG_SILENT_CONSOLE=y
 CONFIG_CONSOLE_MUX=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-tinker.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/configs/vyasa-rk3288_defconfig b/configs/vyasa-rk3288_defconfig
index 9e4e96a4f2..6d7b127bcf 100644
--- a/configs/vyasa-rk3288_defconfig
+++ b/configs/vyasa-rk3288_defconfig
@@ -10,6 +10,7 @@  CONFIG_SPL_STACK_R_ADDR=0x80000
 CONFIG_DEFAULT_DEVICE_TREE="rk3288-vyasa"
 CONFIG_DEBUG_UART=y
 CONFIG_SILENT_CONSOLE=y
+CONFIG_DEFAULT_FDT_FILE="rk3288-vyasa.dtb"
 # CONFIG_DISPLAY_CPUINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 CONFIG_SPL_STACK_R=y
diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h
index 2009c2dd29..07c54b596b 100644
--- a/include/configs/rk3036_common.h
+++ b/include/configs/rk3036_common.h
@@ -56,6 +56,7 @@ 
 /* 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 CONFIG_EXTRA_ENV_SETTINGS \
+	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"fdt_high=0x7fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h
index cb07466088..94b0ae0d79 100644
--- a/include/configs/rk3128_common.h
+++ b/include/configs/rk3128_common.h
@@ -53,6 +53,7 @@ 
 #include <config_distro_bootcmd.h>
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
+	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
 	BOOTENV
 
diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h
index d4ffa041f8..1a0f28d2a7 100644
--- a/include/configs/rk3188_common.h
+++ b/include/configs/rk3188_common.h
@@ -61,6 +61,7 @@ 
 /* Linux fails to load the fdt if it's loaded above 256M on a Rock board,
  * so limit the fdt reallocation to that */
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"fdt_high=0x6fffffff\0" \
 	"initrd_high=0x6fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h
index 1bfcda6701..5b9c4082da 100644
--- a/include/configs/rk322x_common.h
+++ b/include/configs/rk322x_common.h
@@ -52,6 +52,7 @@ 
 /* 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 CONFIG_EXTRA_ENV_SETTINGS \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"fdt_high=0x7fffffff\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index f8c793f154..71ae3c2316 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -69,7 +69,7 @@ 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"fdt_high=0x0fffffff\0" \
 	"initrd_high=0x0fffffff\0" \
-	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
 	ENV_MEM_LAYOUT_SETTINGS \
 	ROCKCHIP_DEVICE_SETTINGS \
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index 3bca0f8388..481044dc24 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -46,6 +46,7 @@ 
 #include <config_distro_bootcmd.h>
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
 	BOOTENV
 
diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h
index 0b07f8dc7a..0e77866b40 100644
--- a/include/configs/rk3368_common.h
+++ b/include/configs/rk3368_common.h
@@ -46,6 +46,7 @@ 
 #include <config_distro_bootcmd.h>
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
+	"fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	ENV_MEM_LAYOUT_SETTINGS	\
 	BOOTENV
 
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index a61e74bc03..ee38107ea5 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -55,7 +55,7 @@ 
 #include <config_distro_bootcmd.h>
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	ENV_MEM_LAYOUT_SETTINGS \
-	"fdtfile=rockchip/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
 	"partitions=" PARTS_DEFAULT \
 	BOOTENV