build/patch/kernel/archive/odroidxu4-5.15/broken/0056-ODROID-XU4-Introduce-device-tree-overlay.patch

358 lines
8.7 KiB
Diff
Raw Permalink Normal View History

From e9f620ec2b1b93e7ab6320702ac0916e2dcc6f0c Mon Sep 17 00:00:00 2001
From: Yang Deokgyu <secugyu@gmail.com>
Date: Thu, 5 Dec 2019 18:07:13 +0900
Subject: [PATCH 056/109] ODROID-XU4: Introduce device tree overlay
Copy *.dtbo files at arch/arm/boot/dts/overlays to boot
partition, e.g, /media/boot/overlays/. Then use "fdtoverlay" tool
to integrate DTB and DTBOs. Or, you also can use "fdt apply" u-boot
command to prepare device tree blob at booting time.
Signed-off-by: Yang Deokgyu <secugyu@gmail.com>
Change-Id: I40e6a915e2149952fb548f64e7fae335ba12db18
---
Makefile | 2 +-
arch/arm/boot/dts/Makefile | 4 +++
arch/arm/boot/dts/exynos5422-odroidxu4.dts | 8 ++---
arch/arm/boot/dts/overlays/Makefile | 12 +++++++
.../dts/overlays/hktft-cs-ogst-overlay.dts | 36 +++++++++++++++++++
.../arm/boot/dts/overlays/hktft32-overlay.dts | 36 +++++++++++++++++++
.../arm/boot/dts/overlays/hktft35-overlay.dts | 36 +++++++++++++++++++
arch/arm/boot/dts/overlays/i2c1-overlay.dts | 12 +++++++
arch/arm/boot/dts/overlays/i2c5-overlay.dts | 12 +++++++
.../arm/boot/dts/overlays/spidev1-overlay.dts | 20 +++++++++++
scripts/Makefile.dtbinst | 3 +-
scripts/Makefile.lib | 16 ++++++++-
12 files changed, 190 insertions(+), 7 deletions(-)
create mode 100644 arch/arm/boot/dts/overlays/Makefile
create mode 100644 arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/hktft32-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/hktft35-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/i2c1-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/i2c5-overlay.dts
create mode 100644 arch/arm/boot/dts/overlays/spidev1-overlay.dts
diff --git a/Makefile b/Makefile
index 78b0941f0de4..3848550790f9 100644
--- a/Makefile
+++ b/Makefile
@@ -1381,7 +1381,7 @@ ifneq ($(dtstree),)
$(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
%.dtbo: include/config/kernel.release scripts_dtc
- $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@
+ $(Q)$(MAKE) $(build)=$(dtstree)/overlays $(dtstree)/overlays/$@
PHONY += dtbs dtbs_install dtbs_check
dtbs: include/config/kernel.release scripts_dtc
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 8e5d4ab4e75e..29e11aa614be 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -1438,3 +1438,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \
aspeed-bmc-portwell-neptune.dtb \
aspeed-bmc-quanta-q71l.dtb \
aspeed-bmc-supermicro-x11spi.dtb
+
+targets += $(dtb-y)
+
+subdir-y := overlays
diff --git a/arch/arm/boot/dts/exynos5422-odroidxu4.dts b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
index 9b218e1a3bec..6b88dcb68844 100644
--- a/arch/arm/boot/dts/exynos5422-odroidxu4.dts
+++ b/arch/arm/boot/dts/exynos5422-odroidxu4.dts
@@ -137,25 +137,25 @@ &usbdrd_dwc3_1 {
/* i2c@12C70000 */
&i2c_1 {
- status = "okay";
+ status = "disabled";
samsung,i2c-max-bus-freq = <400000>;
};
/* i2c@12cb0000 */
&hsi2c_5 {
- status = "okay";
+ status = "disabled";
samsung,hs-mode;
clock-frequency = <400000>;
};
&spi_1 {
- status = "okay";
+ status = "disabled";
samsung,spi-src-clk = <0>;
num-cs = <2>;
cs-gpios = <&gpa2 5 GPIO_ACTIVE_HIGH>, <&gpx2 1 GPIO_ACTIVE_HIGH>;
spidev: spidev@0 {
- status = "okay";
+ status = "disabled";
reg = <0>;
compatible = "odroid,spidev";
spi-max-frequency = <1000000>;
diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile
new file mode 100644
index 000000000000..9502f67ce928
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -0,0 +1,12 @@
+# Overlays for the Odroid platform
+
+dtbo-y += \
+ spidev1-overlay.dtbo \
+ i2c1-overlay.dtbo \
+ i2c5-overlay.dtbo \
+ hktft32-overlay.dtbo \
+ hktft35-overlay.dtbo \
+ hktft-cs-ogst-overlay.dtbo
+
+targets += $(dtbo-y)
+always := $(dtbo-y)
diff --git a/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts b/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts
new file mode 100644
index 000000000000..a727fb311574
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/hktft-cs-ogst-overlay.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&i2c_1>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@1 {
+ target = <&hsi2c_5>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@2 {
+ target = <&spi_1>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@3 {
+ target = <&hktft_cs_ogst>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/hktft32-overlay.dts b/arch/arm/boot/dts/overlays/hktft32-overlay.dts
new file mode 100644
index 000000000000..7bda6cd8e6d8
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/hktft32-overlay.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&i2c_1>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@1 {
+ target = <&hsi2c_5>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@2 {
+ target = <&spi_1>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@3 {
+ target = <&hktft32>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/hktft35-overlay.dts b/arch/arm/boot/dts/overlays/hktft35-overlay.dts
new file mode 100644
index 000000000000..a656dd272165
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/hktft35-overlay.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&i2c_1>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@1 {
+ target = <&hsi2c_5>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@2 {
+ target = <&spi_1>;
+
+ __overlay__ {
+ status = "disabled";
+ };
+ };
+
+ fragment@3 {
+ target = <&hktft35>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/i2c1-overlay.dts b/arch/arm/boot/dts/overlays/i2c1-overlay.dts
new file mode 100644
index 000000000000..2fd27754e7c8
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/i2c1-overlay.dts
@@ -0,0 +1,12 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&i2c_1>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/i2c5-overlay.dts b/arch/arm/boot/dts/overlays/i2c5-overlay.dts
new file mode 100644
index 000000000000..9ef9e66699e0
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/i2c5-overlay.dts
@@ -0,0 +1,12 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&hsi2c_5>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/overlays/spidev1-overlay.dts b/arch/arm/boot/dts/overlays/spidev1-overlay.dts
new file mode 100644
index 000000000000..c5cb6bcb6011
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/spidev1-overlay.dts
@@ -0,0 +1,20 @@
+/dts-v1/;
+/plugin/;
+
+/ {
+ fragment@0 {
+ target = <&spi_1>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+
+ fragment@1 {
+ target = <&spidev>;
+
+ __overlay__ {
+ status = "okay";
+ };
+ };
+};
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index ba01f5ba2517..079b83308011 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -18,9 +18,10 @@ include scripts/Kbuild.include
include $(src)/Makefile
dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
+dtbos := $(addprefix $(dst)/, $(dtbo-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
-__dtbs_install: $(dtbs) $(subdirs)
+__dtbs_install: $(dtbs) $(dtbos) $(subdirs)
@:
quiet_cmd_dtb_install = INSTALL $@
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8cd67b1b6d15..30e7a5d6e680 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -291,12 +291,14 @@ DTC_FLAGS += -Wno-interrupt_provider
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
-Wno-unit_address_format \
+ -Wno-gpios_property \
-Wno-avoid_unnecessary_addr_size \
-Wno-alias_paths \
-Wno-graph_child_address \
-Wno-simple_bus_reg \
-Wno-unique_unit_address \
- -Wno-pci_device_reg
+ -Wno-pci_device_reg \
+ --symbol
endif
ifneq ($(findstring 2,$(KBUILD_EXTRA_WARN)),)
@@ -354,6 +356,18 @@ endef
$(obj)/%.dt.yaml: $(src)/%.dts $(DTC) $(DT_TMP_SCHEMA) FORCE
$(call if_changed_rule,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.25.1