rockchip-rk3588 edge 6.7: add overlay support; add rockchip-rk3588-sata2 overlay

This commit is contained in:
Ricardo Pardini 2023-10-22 23:22:47 +02:00 committed by Igor
parent 3351056c54
commit 7436eba79c
3 changed files with 113 additions and 0 deletions

View File

@ -0,0 +1,84 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: zador-blood-stained <zador-blood-stained@users.noreply.github.com>
Date: Sat, 11 Feb 2017 20:32:53 +0300
Subject: add overlay support
- rpardini: real overlays are now bare in "overlay" directory and are handled
directly by the patching scripts. No more null-patching of overlays.
- no readme, no fixups
---
scripts/Makefile.dtbinst | 6 +++-
scripts/Makefile.lib | 17 ++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst
index 4405d5b67578..9b8c57722947 100644
--- a/scripts/Makefile.dtbinst
+++ b/scripts/Makefile.dtbinst
@@ -18,9 +18,10 @@ include $(srctree)/scripts/Kbuild.include
include $(kbuild-file)
dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-)))
+dtbos := $(addprefix $(dst)/, $(dtbo-y))
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m))
-__dtbs_install: $(dtbs) $(subdirs)
+__dtbs_install: $(dtbs) $(dtbos) $(subdirs)
@:
quiet_cmd_dtb_install = INSTALL $@
@@ -32,6 +33,9 @@ $(dst)/%.dtb: $(obj)/%.dtb
$(dst)/%.dtbo: $(obj)/%.dtbo
$(call cmd,dtb_install)
+$(dst)/%.dtbo: $(obj)/%.dtbo
+ $(call cmd,dtb_install)
+
PHONY += $(subdirs)
$(subdirs):
$(Q)$(MAKE) $(dtbinst)=$@ dst=$(if $(CONFIG_ARCH_WANT_FLAT_DTB_INSTALL),$(dst),$(patsubst $(obj)/%,$(dst)/%,$@))
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 68d0134bdbf9..cad3311611b8 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -88,6 +88,9 @@ base-dtb-y := $(foreach m, $(multi-dtb-y), $(firstword $(call suffix-search, $m,
always-y += $(dtb-y)
+# Overlay targets
+extra-y += $(dtbo-y)
+
# Add subdir path
ifneq ($(obj),.)
@@ -343,6 +346,9 @@ DTC ?= $(objtree)/scripts/dtc/dtc
DTC_FLAGS += -Wno-interrupt_provider \
-Wno-unique_unit_address
+# Overlay support
+DTC_FLAGS += -@ -Wno-unit_address_format -Wno-simple_bus_reg
+
# Disable noisy checks by default
ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
DTC_FLAGS += -Wno-unit_address_vs_reg \
@@ -421,6 +427,17 @@ $(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) -O dtb -o $@ -b 0 \
+ -i $(dir $<) $(DTC_FLAGS) \
+ -d $(depfile).dtc.tmp $(dtc-tmp) ; \
+ cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
+
+$(obj)/%.dtbo: $(src)/%.dts FORCE
+ $(call if_changed_dep,dtco)
+
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
# Bzip2
--
Armbian

View File

@ -0,0 +1,9 @@
# SPDX-License-Identifier: GPL-2.0
dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
rockchip-rk3588-sata2.dtbo
targets += $(dtbo-y)
always := $(dtbo-y)
clean-files := *.dtbo

View File

@ -0,0 +1,20 @@
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target = <&pcie2x1l1>;
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target = <&sata2>;
__overlay__ {
status = "okay";
};
};
};