diff mbox series

[U-Boot,06/40] spl: Allow sandbox to build a device-tree file

Message ID 20190130035935.235565-7-sjg@chromium.org
State Superseded
Delegated to: Bin Meng
Headers show
Series x86: Add support for booting from TPL | expand

Commit Message

Simon Glass Jan. 30, 2019, 3:59 a.m. UTC
At present only OF_SEPARATE is considered valid for building a device-tree
file in SPL. However sandbox uses OF_HOSTFILE instead. Update the logic to
handle this and make it easier to understand.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 scripts/Makefile.spl | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Bin Meng Feb. 22, 2019, 7:18 a.m. UTC | #1
Hi Simon,

On Wed, Jan 30, 2019 at 12:00 PM Simon Glass <sjg@chromium.org> wrote:
>
> At present only OF_SEPARATE is considered valid for building a device-tree
> file in SPL. However sandbox uses OF_HOSTFILE instead. Update the logic to
> handle this and make it easier to understand.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  scripts/Makefile.spl | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
> index 1430d7d851..c9eea629dd 100644
> --- a/scripts/Makefile.spl
> +++ b/scripts/Makefile.spl
> @@ -255,8 +255,20 @@ else
>  FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit
>  endif
>
> +# Build the .dtb file if:
> +#   - we are not using OF_PLATDATA
> +#   - we are using OF_CONTROL
> +#   - we have either OF_SEPARATE or OF_HOSTFILE

This is not 1:1 translation of the original logic.

The original logic was any two of the 3 macros:
$CONFIG_$(SPL_TPL_)OF_CONTROL, $CONFIG_OF_SEPARATE,
$CONFIG_$(SPL_TPL_)OF_PLATDATA, are defined. But here the new logic is
excluding $CONFIG_$(SPL_TPL_)OF_PLATDATA.

> +build_dtb :=
> +ifeq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA),)
> +ifneq ($(CONFIG_$(SPL_TPL_)OF_CONTROL),)
> +ifeq ($(CONFIG_OF_SEPARATE)$(CONFIG_OF_HOSTFILE),y)
> +build_dtb := y
> +endif
> +endif
> +endif
>
> -ifeq ($(CONFIG_$(SPL_TPL_)OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
> +ifneq ($(build_dtb),)
>  $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
>                 $(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
>                 $(FINAL_DTB_CONTAINER)  FORCE
> --

Regards,
Bin
diff mbox series

Patch

diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 1430d7d851..c9eea629dd 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -255,8 +255,20 @@  else
 FINAL_DTB_CONTAINER = $(obj)/$(SPL_BIN).multidtb.fit
 endif
 
+# Build the .dtb file if:
+#   - we are not using OF_PLATDATA
+#   - we are using OF_CONTROL
+#   - we have either OF_SEPARATE or OF_HOSTFILE
+build_dtb :=
+ifeq ($(CONFIG_$(SPL_TPL_)OF_PLATDATA),)
+ifneq ($(CONFIG_$(SPL_TPL_)OF_CONTROL),)
+ifeq ($(CONFIG_OF_SEPARATE)$(CONFIG_OF_HOSTFILE),y)
+build_dtb := y
+endif
+endif
+endif
 
-ifeq ($(CONFIG_$(SPL_TPL_)OF_CONTROL)$(CONFIG_OF_SEPARATE)$(CONFIG_$(SPL_TPL_)OF_PLATDATA),yy)
+ifneq ($(build_dtb),)
 $(obj)/$(SPL_BIN)-dtb.bin: $(obj)/$(SPL_BIN)-nodtb.bin \
 		$(if $(CONFIG_SPL_SEPARATE_BSS),,$(obj)/$(SPL_BIN)-pad.bin) \
 		$(FINAL_DTB_CONTAINER)  FORCE