-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BananaPi BPI-F3:
Update overlay patch and add overlays
General overlay comp patch was pulled from Meson64 6.6.y branch Signed-off-by: Patrick Yavitz <[email protected]>
- Loading branch information
Showing
3 changed files
with
231 additions
and
56 deletions.
There are no files selected for viewing
124 changes: 124 additions & 0 deletions
124
patch/kernel/archive/spacemit-6.6/006-general-add-overlay-compilation-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Martin Ayotte <[email protected]> | ||
Date: Sat, 11 Feb 2017 18:32:53 +0100 | ||
Subject: add overlay-compilation-support to spacemit linux-6.6.y | ||
|
||
- 871bed1a24e21952f7aeb1981c26ad5fc573be9d: Martin Ayotte <[email protected]>: 'add overlay-compilation-support to meson64-dev' | ||
--- | ||
arch/arm/boot/.gitignore | 2 + | ||
scripts/Makefile.dtbinst | 14 ++++++- | ||
scripts/Makefile.lib | 20 ++++++++++ | ||
3 files changed, 35 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/arch/arm/boot/.gitignore b/arch/arm/boot/.gitignore | ||
index 111111111111..222222222222 100644 | ||
--- a/arch/arm/boot/.gitignore | ||
+++ b/arch/arm/boot/.gitignore | ||
@@ -4,3 +4,5 @@ zImage | ||
xipImage | ||
bootpImage | ||
uImage | ||
+*.dtb* | ||
+*.scr | ||
diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst | ||
index 111111111111..222222222222 100644 | ||
--- a/scripts/Makefile.dtbinst | ||
+++ b/scripts/Makefile.dtbinst | ||
@@ -18,9 +18,12 @@ include $(srctree)/scripts/Kbuild.include | ||
include $(kbuild-file) | ||
|
||
dtbs := $(addprefix $(dst)/, $(dtb-y) $(if $(CONFIG_OF_ALL_DTBS),$(dtb-))) | ||
+dtbos := $(addprefix $(dst)/, $(dtbo-y)) | ||
+scrs := $(addprefix $(dst)/, $(scr-y)) | ||
+readmes := $(addprefix $(dst)/, $(dtbotxt-y)) | ||
subdirs := $(addprefix $(obj)/, $(subdir-y) $(subdir-m)) | ||
|
||
-__dtbs_install: $(dtbs) $(subdirs) | ||
+__dtbs_install: $(dtbs) $(dtbos) $(scrs) $(readmes) $(subdirs) | ||
@: | ||
|
||
quiet_cmd_dtb_install = INSTALL $@ | ||
@@ -32,6 +35,15 @@ $(dst)/%.dtb: $(obj)/%.dtb | ||
$(dst)/%.dtbo: $(obj)/%.dtbo | ||
$(call cmd,dtb_install) | ||
|
||
+$(dst)/%.dtbo: $(obj)/%.dtbo | ||
+ $(call cmd,dtb_install) | ||
+ | ||
+$(dst)/%.scr: $(obj)/%.scr | ||
+ $(call cmd,dtb_install) | ||
+ | ||
+$(dst)/README.meson-overlays: $(src)/README.meson-overlays | ||
+ $(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 111111111111..222222222222 100644 | ||
--- a/scripts/Makefile.lib | ||
+++ b/scripts/Makefile.lib | ||
@@ -343,6 +343,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 \ | ||
@@ -425,6 +428,23 @@ $(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) | ||
+ | ||
+quiet_cmd_scr = MKIMAGE $@ | ||
+cmd_scr = mkimage -C none -A $(ARCH) -T script -d $< $@ | ||
+ | ||
+$(obj)/%.scr: $(src)/%.scr-cmd FORCE | ||
+ $(call if_changed,scr) | ||
+ | ||
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp) | ||
|
||
# Bzip2 | ||
-- | ||
Armbian | ||
|
||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Zhang Ning <[email protected]> | ||
Date: Thu, 19 Sep 2019 16:20:31 +0800 | ||
Subject: general: spacemit overlays | ||
|
||
Signed-off-by: Zhang Ning <[email protected]> | ||
--- | ||
scripts/Makefile.lib | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib | ||
index 111111111111..222222222222 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) $(scr-y) $(dtbotxt-y) | ||
+ | ||
# Add subdir path | ||
|
||
ifneq ($(obj),.) | ||
-- | ||
Armbian | ||
|
56 changes: 0 additions & 56 deletions
56
patch/kernel/archive/spacemit-6.6/006-overlay-support.patch
This file was deleted.
Oops, something went wrong.
107 changes: 107 additions & 0 deletions
107
patch/kernel/archive/spacemit-6.6/007-Add-k1-bananapi-f3-overlays.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
From 1fd78e3e85d2f753909e3c9a9434c14d55762c1f Mon Sep 17 00:00:00 2001 | ||
From: Patrick Yavitz <[email protected]> | ||
Date: Sat, 15 Feb 2025 16:58:11 -0500 | ||
Subject: [PATCH] Add k1-bananapi-f3 overlays | ||
|
||
Signed-off-by: Patrick Yavitz <[email protected]> | ||
--- | ||
arch/riscv/boot/dts/spacemit/Makefile | 2 + | ||
arch/riscv/boot/dts/spacemit/overlay/Makefile | 10 +++++ | ||
.../overlay/k1-bananapi-f3-disable-qspi.dts | 13 +++++++ | ||
.../k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts | 37 +++++++++++++++++++ | ||
4 files changed, 62 insertions(+) | ||
create mode 100644 arch/riscv/boot/dts/spacemit/overlay/Makefile | ||
create mode 100644 arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts | ||
create mode 100644 arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts | ||
|
||
diff --git a/arch/riscv/boot/dts/spacemit/Makefile b/arch/riscv/boot/dts/spacemit/Makefile | ||
index 069722c63e3e..c342c1129922 100644 | ||
--- a/arch/riscv/boot/dts/spacemit/Makefile | ||
+++ b/arch/riscv/boot/dts/spacemit/Makefile | ||
@@ -12,3 +12,5 @@ dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-x_fpga.dtb k1-x_fpga_1x4.dtb k1-x_fpga_2x2. | ||
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y)) | ||
|
||
dtb-$(CONFIG_SOC_SPACEMIT_K1X) += k1-bananapi-f3.dtb | ||
+ | ||
+subdir-y += overlay | ||
diff --git a/arch/riscv/boot/dts/spacemit/overlay/Makefile b/arch/riscv/boot/dts/spacemit/overlay/Makefile | ||
new file mode 100644 | ||
index 000000000000..5b6e0e38931f | ||
--- /dev/null | ||
+++ b/arch/riscv/boot/dts/spacemit/overlay/Makefile | ||
@@ -0,0 +1,10 @@ | ||
+# SPDX-License-Identifier: GPL-2.0 | ||
+dtbo-$(CONFIG_ARCH_RV64I) += \ | ||
+ k1-bananapi-f3-disable-qspi.dtbo \ | ||
+ k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dtbo | ||
+ | ||
+targets += dtbs dtbs_install | ||
+targets += $(dtbo-y) | ||
+ | ||
+always-y := $(dtbo-y) | ||
+clean-files := *.dtbo | ||
diff --git a/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts | ||
new file mode 100644 | ||
index 000000000000..df23c4a4f80e | ||
--- /dev/null | ||
+++ b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-disable-qspi.dts | ||
@@ -0,0 +1,13 @@ | ||
+/dts-v1/; | ||
+/plugin/; | ||
+ | ||
+/ { | ||
+ compatible = "spacemit,k1-x"; | ||
+ | ||
+ fragment@0 { | ||
+ target = <&qspi>; | ||
+ __overlay__ { | ||
+ status = "disabled"; | ||
+ }; | ||
+ }; | ||
+}; | ||
diff --git a/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts | ||
new file mode 100644 | ||
index 000000000000..01e487b207d6 | ||
--- /dev/null | ||
+++ b/arch/riscv/boot/dts/spacemit/overlay/k1-bananapi-f3-i2c4-pwm7-spi3-uart5.dts | ||
@@ -0,0 +1,37 @@ | ||
+/dts-v1/; | ||
+/plugin/; | ||
+ | ||
+// Enable 26pin I2C4, PWM7, SPI3 and UART5 | ||
+// https://forum.banana-pi.org/t/bananapif3-gpio-wiringpi-gpiod-python3-periphery-adafruit-blinka-and-luma-examples/18948 | ||
+ | ||
+/ { | ||
+ compatible = "spacemit,k1-x"; | ||
+ | ||
+ fragment@0 { | ||
+ target = <&i2c4>; | ||
+ __overlay__ { | ||
+ status = "okay"; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@1 { | ||
+ target = <&pwm7>; | ||
+ __overlay__ { | ||
+ status = "okay"; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@2 { | ||
+ target = <&spi3>; | ||
+ __overlay__ { | ||
+ status = "okay"; | ||
+ }; | ||
+ }; | ||
+ | ||
+ fragment@3 { | ||
+ target = <&uart5>; | ||
+ __overlay__ { | ||
+ status = "okay"; | ||
+ }; | ||
+ }; | ||
+}; | ||
-- | ||
2.39.5 | ||
|