[U-Boot] [PATCH v1] rockchip: utilize CONFIG_DEFAULT_FDT_FILE

klaus.goger at theobroma-systems.com klaus.goger at theobroma-systems.com
Sun May 27 19:36:51 UTC 2018



> On 27.05.2018, at 21:16, Vagrant Cascadian <vagrant at 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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180527/47a4b3ea/attachment.sig>


More information about the U-Boot mailing list