* [PATCH] kbuild: Add dtc flag test
@ 2020-08-05 17:58 Elliot Berman
2020-08-06 2:21 ` Masahiro Yamada
0 siblings, 1 reply; 3+ messages in thread
From: Elliot Berman @ 2020-08-05 17:58 UTC (permalink / raw)
To: Masahiro Yamada, Michal Marek, Rob Herring, Frank Rowand
Cc: Elliot Berman, linux-kbuild, linux-kernel, devicetree,
Steve Muckle, Trilok Soni
Host dtc may not support the same flags as kernel's copy of dtc. Test
if dtc supports each flag when the dtc comes from host.
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
---
scripts/Makefile.lib | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 841ac03..2722a67 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -274,25 +274,35 @@ quiet_cmd_gzip = GZIP $@
# DTC
# ---------------------------------------------------------------------------
+ifeq ("$(origin DTC)", "command line")
+PHONY += $(DTC)
+dtc-option = $(call try-run, $(DTC) $1 -v,$1)
+else
+# Just add the flag. DTC is compiled later as a prerequisite, so there's no dtc
+# to test the flag against. This is okay because we're not testing flags which
+# aren't supported by in-kernel dtc to begin with.
+dtc-option = $1
+endif
+
DTC ?= $(objtree)/scripts/dtc/dtc
-DTC_FLAGS += -Wno-interrupt_provider
+DTC_FLAGS += $(call dtc-option,-Wno-interrupt_provider)
# Disable noisy checks by default
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
-DTC_FLAGS += -Wno-unit_address_vs_reg \
- -Wno-unit_address_format \
- -Wno-avoid_unnecessary_addr_size \
- -Wno-alias_paths \
- -Wno-graph_child_address \
- -Wno-simple_bus_reg \
- -Wno-unique_unit_address \
- -Wno-pci_device_reg
+DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) \
+ $(call dtc-option,-Wno-unit_address_format) \
+ $(call dtc-option,-Wno-avoid_unnecessary_addr_size) \
+ $(call dtc-option,-Wno-alias_paths) \
+ $(call dtc-option,-Wno-graph_child_address) \
+ $(call dtc-option,-Wno-simple_bus_reg) \
+ $(call dtc-option,-Wno-unique_unit_address) \
+ $(call dtc-option,-Wno-pci_device_reg)
endif
ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
-DTC_FLAGS += -Wnode_name_chars_strict \
- -Wproperty_name_chars_strict \
- -Winterrupt_provider
+DTC_FLAGS += $(call dtc-option,-Wnode_name_chars_strict) \
+ $(call dtc-option,-Wproperty_name_chars_strict) \
+ $(call dtc-option,-Winterrupt_provider)
endif
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: Add dtc flag test
2020-08-05 17:58 [PATCH] kbuild: Add dtc flag test Elliot Berman
@ 2020-08-06 2:21 ` Masahiro Yamada
[not found] ` <CAF2Aj3j7S3YXM-eFxWR7vOUMmN=gDEenmNLZP31iDTkBWG2PgQ@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2020-08-06 2:21 UTC (permalink / raw)
To: Elliot Berman
Cc: Michal Marek, Rob Herring, Frank Rowand,
Linux Kbuild mailing list, Linux Kernel Mailing List, DTML,
Steve Muckle, Trilok Soni
On Thu, Aug 6, 2020 at 2:59 AM Elliot Berman <eberman@codeaurora.org> wrote:
>
> Host dtc may not support the same flags as kernel's copy of dtc. Test
> if dtc supports each flag when the dtc comes from host.
>
> Signed-off-by: Elliot Berman <eberman@codeaurora.org>
I think this supports only the newer external DTC,
but not older ones.
This feature is intended to test the upstream DTC
before resyncing in-kernel scripts/dtc/.
> ---
> scripts/Makefile.lib | 34 ++++++++++++++++++++++------------
> 1 file changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 841ac03..2722a67 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -274,25 +274,35 @@ quiet_cmd_gzip = GZIP $@
>
> # DTC
> # ---------------------------------------------------------------------------
> +ifeq ("$(origin DTC)", "command line")
> +PHONY += $(DTC)
> +dtc-option = $(call try-run, $(DTC) $1 -v,$1)
> +else
> +# Just add the flag. DTC is compiled later as a prerequisite, so there's no dtc
> +# to test the flag against. This is okay because we're not testing flags which
> +# aren't supported by in-kernel dtc to begin with.
> +dtc-option = $1
> +endif
> +
> DTC ?= $(objtree)/scripts/dtc/dtc
> -DTC_FLAGS += -Wno-interrupt_provider
> +DTC_FLAGS += $(call dtc-option,-Wno-interrupt_provider)
>
> # Disable noisy checks by default
> ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
> -DTC_FLAGS += -Wno-unit_address_vs_reg \
> - -Wno-unit_address_format \
> - -Wno-avoid_unnecessary_addr_size \
> - -Wno-alias_paths \
> - -Wno-graph_child_address \
> - -Wno-simple_bus_reg \
> - -Wno-unique_unit_address \
> - -Wno-pci_device_reg
> +DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg) \
> + $(call dtc-option,-Wno-unit_address_format) \
> + $(call dtc-option,-Wno-avoid_unnecessary_addr_size) \
> + $(call dtc-option,-Wno-alias_paths) \
> + $(call dtc-option,-Wno-graph_child_address) \
> + $(call dtc-option,-Wno-simple_bus_reg) \
> + $(call dtc-option,-Wno-unique_unit_address) \
> + $(call dtc-option,-Wno-pci_device_reg)
> endif
>
> ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
> -DTC_FLAGS += -Wnode_name_chars_strict \
> - -Wproperty_name_chars_strict \
> - -Winterrupt_provider
> +DTC_FLAGS += $(call dtc-option,-Wnode_name_chars_strict) \
> + $(call dtc-option,-Wproperty_name_chars_strict) \
> + $(call dtc-option,-Winterrupt_provider)
> endif
>
> DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: Add dtc flag test
[not found] ` <CAF2Aj3j7S3YXM-eFxWR7vOUMmN=gDEenmNLZP31iDTkBWG2PgQ@mail.gmail.com>
@ 2021-05-24 14:21 ` Rob Herring
0 siblings, 0 replies; 3+ messages in thread
From: Rob Herring @ 2021-05-24 14:21 UTC (permalink / raw)
To: Lee Jones
Cc: Masahiro Yamada, Elliot Berman, Michal Marek, Frank Rowand,
Linux Kbuild mailing list, Linux Kernel Mailing List, DTML,
Steve Muckle, Trilok Soni
On Mon, May 24, 2021 at 6:40 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Thu, 6 Aug 2020 at 03:22, Masahiro Yamada <masahiroy@kernel.org> wrote:
>>
>> On Thu, Aug 6, 2020 at 2:59 AM Elliot Berman <eberman@codeaurora.org> wrote:
>> >
>> > Host dtc may not support the same flags as kernel's copy of dtc. Test
>> > if dtc supports each flag when the dtc comes from host.
>> >
>> > Signed-off-by: Elliot Berman <eberman@codeaurora.org>
>>
>>
>> I think this supports only the newer external DTC,
>> but not older ones.
>>
>> This feature is intended to test the upstream DTC
>> before resyncing in-kernel scripts/dtc/.
>
>
> Was there ever a follow-up to this?
As Masahiro said, using an older dtc is not a usecase we care about.
Rob
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-24 14:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-05 17:58 [PATCH] kbuild: Add dtc flag test Elliot Berman
2020-08-06 2:21 ` Masahiro Yamada
[not found] ` <CAF2Aj3j7S3YXM-eFxWR7vOUMmN=gDEenmNLZP31iDTkBWG2PgQ@mail.gmail.com>
2021-05-24 14:21 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).