sunxi: allow CONFIG_DEFAULT_FDT_FILE override
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Currently, sunxi-common.h ignores CONFIG_DEFAULT_FDT_FILE and assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.
Add logic in sunxi-common.h to respect CONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.
--- include/configs/sunxi-common.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/configs/sunxi-common.h +6 -0
@@ -501,12 +501,18 @@ extern int soft_i2c_gpio_scl;CONSOLE_STDIN_SETTINGS \ CONSOLE_STDOUT_SETTINGS +#ifdef CONFIG_DEFAULT_FDT_FILE +#define FDTFILE CONFIG_DEFAULT_FDT_FILE ".dtb" +#else /* ifndef CONFIG_DEFAULT_FDT_FILE */ +#ifdef CONFIG_ARM64 #define FDTFILE "allwinner/" CONFIG_DEFAULT_DEVICE_TREE ".dtb"#else #define FDTFILE CONFIG_DEFAULT_DEVICE_TREE ".dtb"#endif +#endif /* ifdef CONFIG_DEFAULT_FDT_FILE */ +#define CONFIG_EXTRA_ENV_SETTINGS \ CONSOLE_ENV_SETTINGS \ MEM_LAYOUT_ENV_SETTINGS \
Signature · 1 line
2.11.0
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 10 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180517/de892107/attachment.sig>
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 7 lines · Maxime Ripard
Quoted 6 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.
Quoted 9 lines
Quoted 4 lines
Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Maxime
(ping)
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 11 lines · Martin Kelly
Quoted 10 lines · Maxime Ripard
Quoted 9 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Maxime
(ping)
(ping again)
Can we get this patch merged?
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Hi Martin,
Quoted 18 lines · Martin Kelly
Quoted 15 lines · Martin Kelly
Quoted 14 lines · Maxime Ripard
Quoted 10 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Maxime
(ping)
(ping again)
Can we get this patch merged?
The else branch will never be selected. CONFIG_DEFAULT_FDT_FILE will be set to “” if not set by your defconfig.
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 22 lines · klaus.goger at theobroma-systems.com
Hi Martin,
Quoted 20 lines · Martin Kelly
Quoted 17 lines · Martin Kelly
Quoted 16 lines · Maxime Ripard
Quoted 10 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Maxime
Quoted 9 lines
Quoted 5 lines
Quoted 1 line
(ping)
(ping again)
Can we get this patch merged?
The else branch will never be selected.
CONFIG_DEFAULT_FDT_FILEwill be set to “” if not set by your defconfig.
Thanks for noticing this; unfortunately you are right. I thought I tested this, but it was in the context of a larger build and I missed it.
It looks like we have two options:
(a) Test for empty string in preprocessor language. This is quite ugly and has some gotchas but should be doable (e.g.
https://stackoverflow.com/questions/3781520/how-to-test-if-preprocessor-symbol-is-defined-but-has-no-value).
(b) Always use the value of CONFIG_DEFAULT_FDT_FILE and stop using CONFIG_DEFAULT_DEVICE_TREE as a default. In each board file, explicitly set CONFIG_DEFAULT_FDT_FILE to its current default. This is what other boards are doing.
I favor (b). If others are in favor, I'll submit a patch for it.
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 36 lines · Martin Kelly
Quoted 21 lines · klaus.goger at theobroma-systems.com
Hi Martin,
Quoted 20 lines · Martin Kelly
Quoted 17 lines · Martin Kelly
Quoted 16 lines · Maxime Ripard
Quoted 10 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Maxime
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
(ping)
(ping again)
Can we get this patch merged?
The else branch will never be selected.
CONFIG_DEFAULT_FDT_FILEwill be set to “” if not set by your defconfig.Thanks for noticing this; unfortunately you are right. I thought I tested this, but it was in the context of a larger build and I missed it.
Quoted 7 lines
It looks like we have two options:
(a) Test for empty string in preprocessor language. This is quite ugly and has some gotchas but should be doable (e.g. https://stackoverflow.com/questions/3781520/how-to-test-if-preprocessor-symbol-is-defined-but-has-no-value).
(b) Always use the value of
CONFIG_DEFAULT_FDT_FILEand stop usingCONFIG_DEFAULT_DEVICE_TREEas a default. In each board file, explicitly setCONFIG_DEFAULT_FDT_FILEto its current default. This is what other boards are doing.I favor (b). If others are in favor, I'll submit a patch for it.
I run into the same issue for the rockchip architecture[1]. After giving up on finding a rock-solid solution for detecting the emtpy string I decided to go with your option (b). Another solution would be to hide CONFIG_DEFAULT_DEVICE_TREE behind a Kconfig bool so it would not be defined until something like CONFIG_FDT_FILE is selected. But in favour of having U-Boot devicetree decoupled from any OS fdt I still prefer option (b).
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 44 lines · klaus.goger at theobroma-systems.com
Quoted 36 lines · Martin Kelly
Quoted 21 lines · klaus.goger at theobroma-systems.com
Hi Martin,
Quoted 20 lines · Martin Kelly
Quoted 17 lines · Martin Kelly
Quoted 16 lines · Maxime Ripard
Quoted 10 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Maxime
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
(ping)
(ping again)
Can we get this patch merged?
The else branch will never be selected.
CONFIG_DEFAULT_FDT_FILEwill be set to “” if not set by your defconfig.Thanks for noticing this; unfortunately you are right. I thought I tested this, but it was in the context of a larger build and I missed it.
Quoted 7 lines
It looks like we have two options:
(a) Test for empty string in preprocessor language. This is quite ugly and has some gotchas but should be doable (e.g. https://stackoverflow.com/questions/3781520/how-to-test-if-preprocessor-symbol-is-defined-but-has-no-value).
(b) Always use the value of
CONFIG_DEFAULT_FDT_FILEand stop usingCONFIG_DEFAULT_DEVICE_TREEas a default. In each board file, explicitly setCONFIG_DEFAULT_FDT_FILEto its current default. This is what other boards are doing.I favor (b). If others are in favor, I'll submit a patch for it.
Quoted 10 lines
I run into the same issue for the rockchip architecture[1]. After giving up on finding a rock-solid solution for detecting the emtpy string I decided to go with your option (b). Another solution would be to hide
CONFIG_DEFAULT_DEVICE_TREEbehind aKconfigbool so it would not be defined until something likeCONFIG_FDT_FILEis selected. But in favour of having U-Boot devicetree decoupled from any OS fdt I still prefer option (b).
Thanks, I'll go ahead with that solution and issue a follow-up patch.
Jagan, should I make the patch against this one, or against master?
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 2 lines · Martin Kelly
Quoted 1 line · klaus.goger at theobroma-systems.com
[snip]
Quoted 13 lines
Quoted 13 lines
I run into the same issue for the rockchip architecture[1]. After giving up on finding a
rock-solid solution for detecting the emtpy string I decided to go with your option (b).
Another solution would be to hideCONFIG_DEFAULT_DEVICE_TREEbehind aKconfigbool so it would not be defined until something likeCONFIG_FDT_FILEis
selected. But in favour of having U-Boot devicetree decoupled from any OS fdt I
still prefer option (b).
Quoted 7 lines
Quoted 3 lines
Thanks, I'll go ahead with that solution and issue a follow-up patch.
Jagan, should I make the patch against this one, or against master?
on master
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
In reply to Maxime RipardQuoted 7 lines · Maxime Ripard
Quoted 6 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.
Quoted 6 lines
Quoted 4 lines
Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>
Applied to u-boot-sunxi/master
PATCH 1/1 sunxi: allow CONFIG_DEFAULT_FDT_FILE override
Quoted 9 lines · Jagan Teki
Quoted 7 lines · Maxime Ripard
Quoted 6 lines · Martin Kelly
Currently,
sunxi-common.hignoresCONFIG_DEFAULT_FDT_FILEand assumes the kernel fdtfile and the u-boot devicetree names are the same. Although this is typically the case, sometimes you might want to customize one of these differently, so it's useful to allow them to be different.
Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Add logic in
sunxi-common.hto respectCONFIG_DEFAULT_FDT_FILE, if set, and default to the values it currently uses.Signed-off-by Martin Kelly <[email protected]>Acked-by Maxime Ripard <[email protected]>Applied to u-boot-sunxi/master
Thanks!