Skip to contentSkip to conversation

image: fix compiling without CMD_FDT

PATCH New Simon Goldschmidt 2 participants 4 messages Dec 14, 2018 – Dec 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 common/bootm.c     | 3 ++-
 common/image-fdt.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +0 -0
index 8bf84ebcb7..80f304ce9f 100644
@@ -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
index 95748f0ae1..8ee5a13352 100644
@@ -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.11.0
#1 lore raw

PATCH 1/1 image: fix compiling without CMD_FDT

Quoted 42 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 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.

---
 common/bootm.c     | 3 ++-
 common/image-fdt.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +2 -1
index 8bf84ebcb7..80f304ce9f 100644
@@ -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
index 95748f0ae1..8ee5a13352 100644
@@ -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;
 
Quoted 1 line

error:

Your whitespace was totally destroyed, please v2, 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/20181215/66ee287b/attachment.sig>
#2 lore raw

PATCH 1/1 image: fix compiling without CMD_FDT

Am Sa., 15. Dez. 2018, 15:56 hat Tom Rini <[email protected]> geschrieben:

Quoted 39 lines · Simon Goldschmidt
Quoted 38 lines

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.

---
 common/bootm.c     | 3 ++-
 common/image-fdt.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +2 -1
index 8bf84ebcb7..80f304ce9f 100644
@@ -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
index 95748f0ae1..8ee5a13352 100644
@@ -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;
 
Quoted 9 lines
Quoted 6 lines
common/image-fdt.c +2 -1
-    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:

Your whitespace was totally destroyed, please v2, thanks!

Sorry for not noticing that. That was my editor at work... :-(

Regards,
Simon

#3 lore raw

PATCH 1/1 image: fix compiling without CMD_FDT

Quoted 46 lines · Simon Goldschmidt

Am Sa., 15. Dez. 2018, 15:56 hat Tom Rini <[email protected]> geschrieben:

Quoted 44 lines · Simon Goldschmidt
Quoted 43 lines

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.

---
 common/bootm.c     | 3 ++-
 common/image-fdt.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
common/bootm.c +2 -1
index 8bf84ebcb7..80f304ce9f 100644
@@ -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
index 95748f0ae1..8ee5a13352 100644
@@ -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;
 
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

error:

Your whitespace was totally destroyed, please v2, thanks!

Sorry for not noticing that. That was my editor at work... :-(

Not a huge deal, but I see that my "just apply it and ignore whitespace" is making the compiler very mad, ha.

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/20181215/e7370070/attachment.sig>