aports/testing/linux-spacemit/001-device-tree-overlay-support.patch
2024-09-19 17:13:50 +02:00

56 lines
1.6 KiB
Diff

From 2ccecdeaa2fad8f9fd9d828e18c04c3ce2d21197 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@xxxxx.com>
Date: Wed, 3 Apr 2024 09:41:49 -0400
Subject: [PATCH] device tree overlay support
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
---
scripts/Makefile.lib | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 68d0134bdbf9..413f9181b763 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -348,6 +348,7 @@ ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
+ -Wno-gpios_property \
-Wno-graph_child_address \
-Wno-simple_bus_reg
else
@@ -362,6 +363,11 @@ DTC_FLAGS += -Wnode_name_chars_strict \
-Wunique_unit_address
endif
+ifeq ($(CONFIG_OF_OVERLAY),y)
+# enable creation of __symbols__ node
+DTC_FLAGS += -@
+endif
+
DTC_FLAGS += $(DTC_FLAGS_$(basetarget))
# Set -@ if the target is a base DTB that overlay is applied onto
@@ -421,6 +427,18 @@ $(obj)/%.dtb: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
$(obj)/%.dtbo: $(src)/%.dtso $(DTC) FORCE
$(call if_changed_dep,dtc)
+quiet_cmd_dtco = DTCO $@
+cmd_dtco = mkdir -p $(dir ${dtc-tmp}) ; \
+ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
+ $(DTC) -@ -H epapr -O dtb -o $@ -b 0 \
+ -i $(dir $<) $(DTC_FLAGS) \
+ -Wno-interrupts_property \
+ -d $(depfile).dtc.tmp $(dtc-tmp) ; \
+ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
+
+$(obj)/%.dtbo: $(obj)/%.dts FORCE
+ $(call if_changed_dep,dtco)
+
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# Bzip2
--
2.39.2