* [U-Boot] [PATCH] image: fix compiling without CMD_FDT
@ 2018-12-14 7:42 Simon Goldschmidt
2018-12-15 14:56 ` Tom Rini
0 siblings, 1 reply; 4+ messages in thread
From: Simon Goldschmidt @ 2018-12-14 7:42 UTC (permalink / raw)
To: u-boot
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.
Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
---
common/bootm.c | 3 ++-
common/image-fdt.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/bootm.c b/common/bootm.c
index 8bf84ebcb7..80f304ce9f 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -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
diff --git a/common/image-fdt.c b/common/image-fdt.c
index 95748f0ae1..8ee5a13352 100644
--- a/common/image-fdt.c
+++ b/common/image-fdt.c
@@ -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:
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] image: fix compiling without CMD_FDT
2018-12-14 7:42 [U-Boot] [PATCH] image: fix compiling without CMD_FDT Simon Goldschmidt
@ 2018-12-15 14:56 ` Tom Rini
2018-12-15 15:00 ` Simon Goldschmidt
0 siblings, 1 reply; 4+ messages in thread
From: Tom Rini @ 2018-12-15 14:56 UTC (permalink / raw)
To: u-boot
On Fri, Dec 14, 2018 at 08:42:18AM +0100, Simon Goldschmidt wrote:
> 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.
>
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> ---
> common/bootm.c | 3 ++-
> common/image-fdt.c | 3 ++-
> 2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/common/bootm.c b/common/bootm.c
> index 8bf84ebcb7..80f304ce9f 100644
> --- a/common/bootm.c
> +++ b/common/bootm.c
> @@ -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
> diff --git a/common/image-fdt.c b/common/image-fdt.c
> index 95748f0ae1..8ee5a13352 100644
> --- a/common/image-fdt.c
> +++ b/common/image-fdt.c
> @@ -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:
Your whitespace was totally destroyed, please v2, thanks!
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] image: fix compiling without CMD_FDT
2018-12-15 14:56 ` Tom Rini
@ 2018-12-15 15:00 ` Simon Goldschmidt
2018-12-15 15:04 ` Tom Rini
0 siblings, 1 reply; 4+ messages in thread
From: Simon Goldschmidt @ 2018-12-15 15:00 UTC (permalink / raw)
To: u-boot
Am Sa., 15. Dez. 2018, 15:56 hat Tom Rini <trini@konsulko.com> geschrieben:
> On Fri, Dec 14, 2018 at 08:42:18AM +0100, Simon Goldschmidt wrote:
>
> > 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.
> >
> > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> > ---
> > common/bootm.c | 3 ++-
> > common/image-fdt.c | 3 ++-
> > 2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/common/bootm.c b/common/bootm.c
> > index 8bf84ebcb7..80f304ce9f 100644
> > --- a/common/bootm.c
> > +++ b/common/bootm.c
> > @@ -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
> > diff --git a/common/image-fdt.c b/common/image-fdt.c
> > index 95748f0ae1..8ee5a13352 100644
> > --- a/common/image-fdt.c
> > +++ b/common/image-fdt.c
> > @@ -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:
>
> Your whitespace was totally destroyed, please v2, thanks!
>
Sorry for not noticing that. That was my editor at work... :-(
Regards,
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] image: fix compiling without CMD_FDT
2018-12-15 15:00 ` Simon Goldschmidt
@ 2018-12-15 15:04 ` Tom Rini
0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2018-12-15 15:04 UTC (permalink / raw)
To: u-boot
On Sat, Dec 15, 2018 at 04:00:33PM +0100, Simon Goldschmidt wrote:
> Am Sa., 15. Dez. 2018, 15:56 hat Tom Rini <trini@konsulko.com> geschrieben:
>
> > On Fri, Dec 14, 2018 at 08:42:18AM +0100, Simon Goldschmidt wrote:
> >
> > > 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.
> > >
> > > Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> > > ---
> > > common/bootm.c | 3 ++-
> > > common/image-fdt.c | 3 ++-
> > > 2 files changed, 4 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/common/bootm.c b/common/bootm.c
> > > index 8bf84ebcb7..80f304ce9f 100644
> > > --- a/common/bootm.c
> > > +++ b/common/bootm.c
> > > @@ -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
> > > diff --git a/common/image-fdt.c b/common/image-fdt.c
> > > index 95748f0ae1..8ee5a13352 100644
> > > --- a/common/image-fdt.c
> > > +++ b/common/image-fdt.c
> > > @@ -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:
> >
> > 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.
--
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>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-15 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-14 7:42 [U-Boot] [PATCH] image: fix compiling without CMD_FDT Simon Goldschmidt
2018-12-15 14:56 ` Tom Rini
2018-12-15 15:00 ` Simon Goldschmidt
2018-12-15 15:04 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.