build: dtc: Disable noisy warnings by default
[openwrt/openwrt.git] / include / image.mk
index 8c4ca222df3c1fcd4bb7bd13effee207510555e7..4307ead78be07ee8519020d689370ca929f6f3ec 100644 (file)
@@ -152,6 +152,32 @@ ifdef CONFIG_TARGET_IMAGES_GZIP
   endef
 endif
 
+
+# Disable noisy checks by default as in upstream
+ifeq ($(strip $(call kernel_patchver_ge,4.6.0)),1)
+  DTC_FLAGS += -Wno-unit_address_vs_reg
+endif
+ifeq ($(strip $(call kernel_patchver_ge,4.11.0)),1)
+  DTC_FLAGS += \
+       -Wno-unit_address_vs_reg \
+       -Wno-simple_bus_reg \
+       -Wno-unit_address_format \
+       -Wno-pci_bridge \
+       -Wno-pci_device_bus_num \
+       -Wno-pci_device_reg
+endif
+ifeq ($(strip $(call kernel_patchver_ge,4.16.0)),1)
+  DTC_FLAGS += \
+       -Wno-avoid_unnecessary_addr_size \
+       -Wno-alias_paths
+endif
+ifeq ($(strip $(call kernel_patchver_ge,4.17.0)),1)
+  DTC_FLAGS += \
+       -Wno-graph_child_address \
+       -Wno-graph_port \
+       -Wno-unique_unit_address
+endif
+
 # $(1) source dts file
 # $(2) target dtb file
 # $(3) extra CPP flags
@@ -164,7 +190,7 @@ define Image/BuildDTB
                -undef -D__DTS__ $(3) \
                -o $(2).tmp $(1)
        $(LINUX_DIR)/scripts/dtc/dtc -O dtb \
-               -i$(dir $(1)) $(4) \
+               -i$(dir $(1)) $(DTC_FLAGS) $(4) \
                -o $(2) $(2).tmp
        $(RM) $(2).tmp
 endef