221-compatible-old-dtc.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Revert the commit c0e032e0090d65 ("scripts/dtc: Update to upstream
  2. version v1.4.3")
  3. libreCMC uses the dtc from the kernel also in u-boot, but when we compile
  4. against kernel 4.9 we run into some errors because it is too old now.
  5. Add the options only when they are supported to make it compatible with
  6. dtc from kernel 4.9.
  7. --- a/scripts/Kbuild.include
  8. +++ b/scripts/Kbuild.include
  9. @@ -173,6 +173,11 @@ ld-version = $(shell $(LD) --version | $
  10. # Usage: $(call ld-ifversion, -ge, 22252, y)
  11. ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
  12. +# dtc-option
  13. +# Usage: DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg)
  14. +dtc-option = $(call try-run,\
  15. + echo '/dts-v1/; / {};' | $(DTC) $(1),$(1),$(2))
  16. +
  17. ######
  18. ###
  19. --- a/scripts/Makefile.extrawarn
  20. +++ b/scripts/Makefile.extrawarn
  21. @@ -56,8 +56,8 @@ endif
  22. KBUILD_CFLAGS += $(warning)
  23. -dtc-warning-2 += -Wnode_name_chars_strict
  24. -dtc-warning-2 += -Wproperty_name_chars_strict
  25. +dtc-warning-2 += $(call dtc-option,-Wnode_name_chars_strict)
  26. +dtc-warning-2 += $(call dtc-option,-Wproperty_name_chars_strict)
  27. dtc-warning := $(dtc-warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
  28. dtc-warning += $(dtc-warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS)))
  29. @@ -68,11 +68,11 @@ DTC_FLAGS += $(dtc-warning)
  30. else
  31. # Disable noisy checks by default
  32. -DTC_FLAGS += -Wno-unit_address_vs_reg
  33. -DTC_FLAGS += -Wno-simple_bus_reg
  34. -DTC_FLAGS += -Wno-unit_address_format
  35. -DTC_FLAGS += -Wno-pci_bridge
  36. -DTC_FLAGS += -Wno-pci_device_bus_num
  37. -DTC_FLAGS += -Wno-pci_device_reg
  38. +DTC_FLAGS += $(call dtc-option,-Wno-unit_address_vs_reg)
  39. +DTC_FLAGS += $(call dtc-option,-Wno-simple_bus_reg)
  40. +DTC_FLAGS += $(call dtc-option,-Wno-unit_address_format)
  41. +DTC_FLAGS += $(call dtc-option,-Wno-pci_bridge)
  42. +DTC_FLAGS += $(call dtc-option,-Wno-pci_device_bus_num)
  43. +DTC_FLAGS += $(call dtc-option,-Wno-pci_device_reg)
  44. endif