summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexandre Torgue <alexandre.torgue@foss.st.com>2022-10-21 11:44:47 +0300
committerRob Herring <robh@kernel.org>2022-10-22 00:02:05 +0300
commitae5a16c8da92f511fe633d0872043cd317966092 (patch)
tree80e47591b73b2e29b99d47536a65cb81a16a158e /scripts
parent33ce453cad470ffd92ba79534dc67946b64d13b2 (diff)
downloadlinux-ae5a16c8da92f511fe633d0872043cd317966092.tar.xz
scripts: dtc: only show unique unit address warning for enabled nodes
In some cases an hardware peripheral can be used for two exclusive usages. For example, on STM32MP15 we have the same peripheral for I2S and SPI. We have dedicated driver for each usage and so a dedicated device node in devicetree. To avoid to get useless warnings running "make W=1 dtbs", this patch adds the "-Wunique_unit_address_if_enabled" flag for a make with W=1. In this case we will detect a duplicate address only if both devices are enabled in the devicetree, which is a real error case. Signed-off-by: Alexandre Torgue <alexandre.torgue@foss.st.com> Link: https://lore.kernel.org/r/20221021084447.5550-1-alexandre.torgue@foss.st.com [robh: Refactor options and keep 'unique_unit_address' for W=2] Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.lib12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 3aa384cec76b..969de3b7bb30 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -334,7 +334,8 @@ quiet_cmd_gzip = GZIP $@
# DTC
# ---------------------------------------------------------------------------
DTC ?= $(objtree)/scripts/dtc/dtc
-DTC_FLAGS += -Wno-interrupt_provider
+DTC_FLAGS += -Wno-interrupt_provider \
+ -Wno-unique_unit_address
# Disable noisy checks by default
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
@@ -342,14 +343,17 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
-Wno-graph_child_address \
- -Wno-simple_bus_reg \
- -Wno-unique_unit_address
+ -Wno-simple_bus_reg
+else
+DTC_FLAGS += \
+ -Wunique_unit_address_if_enabled
endif
ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += -Wnode_name_chars_strict \
-Wproperty_name_chars_strict \
- -Winterrupt_provider
+ -Winterrupt_provider \
+ -Wunique_unit_address
endif
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))