image: fix compiling without CMD_FDT
PATCH v2 1/1 image: fix compiling without CMD_FDT
From: Simon Goldschmidt <[email protected]>
Booting an image currently sets the environment variable "fdtaddr" by calling into 'cmd/fdt.c'. As a result, linking U-Boot fails if CMD_FDT is not enabled.
Fix this by adding 'if (CONFIG_IS_ENABLED(CMD_FDT))' to the two places where 'set_working_fdt_addr()' is called.
---
Changes in v2:
- fixed whitespace (v1 had spaces instead of tabs)
common/bootm.c | 3 ++- common/image-fdt.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +2 -1
@@ -262,7 +262,8 @@ int bootm_find_images(int flag, int argc, char * const argv[])puts ("Could not find a valid device tree\n" ); return 1; } -set_working_fdt_addr (map_to_sysmem (images.ft_addr)); +if (CONFIG_IS_ENABLED (CMD_FDT )) +set_working_fdt_addr (map_to_sysmem (images.ft_addr));#endif #if IMAGE_ENABLE_FIT
common/image-fdt.c +2 -1
@@ -193,7 +193,8 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) *of_flat_tree = of_start; *of_size = of_len; -set_working_fdt_addr (map_to_sysmem (*of_flat_tree)); +if (CONFIG_IS_ENABLED (CMD_FDT )) +set_working_fdt_addr (map_to_sysmem (*of_flat_tree));return 0 ; error:
Signature · 1 line
2.17.1
PATCH v2 1/1 image: fix compiling without CMD_FDT
Booting an image currently sets the environment variable "fdtaddr" by calling into 'cmd/fdt.c'. As a result, linking U-Boot fails if CMD_FDT is not enabled.
Fix this by adding 'if (CONFIG_IS_ENABLED(CMD_FDT))' to the two places where 'set_working_fdt_addr()' is called.
---
Changes in v2:
- fixed whitespace (v1 had spaces instead of tabs)
common/bootm.c | 3 ++- common/image-fdt.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +0 -0
@@ -262,7 +262,8 @@ int bootm_find_images(int flag, int argc, char *
const argv[])
puts("Could not find a valid device tree\n"); return 1;
}
- set_working_fdt_addr(map_to_sysmem(images.ft_addr));
+ if (CONFIG_IS_ENABLED(CMD_FDT))
+ set_working_fdt_addr(map_to_sysmem(images.ft_addr));
#endif
#if IMAGE_ENABLE_FIT
common/image-fdt.c +0 -0
@@ -193,7 +193,8 @@ int boot_relocate_fdt(struct lmb *lmb, char
**of_flat_tree, ulong *of_size)
*of_flat_tree = of_start;
*of_size = of_len;
- set_working_fdt_addr(map_to_sysmem(*of_flat_tree));
+ if (CONFIG_IS_ENABLED(CMD_FDT))
+ set_working_fdt_addr(map_to_sysmem(*of_flat_tree));
return 0;
error:
Signature · 1 line
2.17.1
PATCH v2 1/1 image: fix compiling without CMD_FDT
Quoted 8 lines · Simon Goldschmidt
Booting an image currently sets the environment variable "fdtaddr" by calling into '
cmd/fdt.c'. As a result, linking U-Boot fails ifCMD_FDTis not enabled.Fix this by adding 'if (
CONFIG_IS_ENABLED(CMD_FDT))' to the two places where 'set_working_fdt_addr()' is called.Signed-off-by Simon Goldschmidt <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190115/e6ec9726/attachment.sig>
PATCH v2 1/1 image: fix compiling without CMD_FDT
In reply to Simon GoldschmidtQuoted 11 lines · Simon Goldschmidt
From: Simon Goldschmidt <[email protected]>
Booting an image currently sets the environment variable "fdtaddr" by calling into '
cmd/fdt.c'. As a result, linking U-Boot fails ifCMD_FDTis not enabled.Fix this by adding 'if (
CONFIG_IS_ENABLED(CMD_FDT))' to the two places where 'set_working_fdt_addr()' is called.Signed-off-by Simon Goldschmidt <[email protected]>
Quoted 8 lines
---
Changes in v2:
- fixed whitespace (v1 had spaces instead of tabs)common/bootm.c | 3 ++- common/image-fdt.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)