484 lines
11 KiB
Diff
484 lines
11 KiB
Diff
From f714d89ebd3ee718cb7ab8574ec92407b50b5aee Mon Sep 17 00:00:00 2001
|
|
From: Paolo Sabatino <paolo.sabatino@gmail.com>
|
|
Date: Sun, 20 Mar 2022 09:30:24 +0000
|
|
Subject: [PATCH] rk3288: general add overlays
|
|
|
|
---
|
|
arch/arm/boot/dts/overlay/Makefile | 26 +++++++
|
|
.../boot/dts/overlay/README.rockchip-overlays | 78 +++++++++++++++++++
|
|
arch/arm/boot/dts/overlay/rockchip-ds1307.dts | 23 ++++++
|
|
.../boot/dts/overlay/rockchip-fixup.scr-cmd | 4 +
|
|
arch/arm/boot/dts/overlay/rockchip-i2c1.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-i2c4.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-spi0.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-spi2.dts | 16 ++++
|
|
.../arm/boot/dts/overlay/rockchip-spidev0.dts | 35 +++++++++
|
|
.../arm/boot/dts/overlay/rockchip-spidev2.dts | 35 +++++++++
|
|
arch/arm/boot/dts/overlay/rockchip-uart1.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-uart2.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-uart3.dts | 16 ++++
|
|
arch/arm/boot/dts/overlay/rockchip-uart4.dts | 16 ++++
|
|
.../arm/boot/dts/overlay/rockchip-w1-gpio.dts | 23 ++++++
|
|
15 files changed, 352 insertions(+)
|
|
create mode 100644 arch/arm/boot/dts/overlay/Makefile
|
|
create mode 100644 arch/arm/boot/dts/overlay/README.rockchip-overlays
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
|
create mode 100644 arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
|
|
|
diff --git a/arch/arm/boot/dts/overlay/Makefile b/arch/arm/boot/dts/overlay/Makefile
|
|
new file mode 100644
|
|
index 00000000000..56d8cb187aa
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/Makefile
|
|
@@ -0,0 +1,26 @@
|
|
+# SPDX-License-Identifier: GPL-2.0
|
|
+dtbo-$(CONFIG_ARCH_ROCKCHIP) += \
|
|
+ rockchip-ds1307.dtbo \
|
|
+ rockchip-i2c1.dtbo \
|
|
+ rockchip-i2c4.dtbo \
|
|
+ rockchip-spi0.dtbo \
|
|
+ rockchip-spi2.dtbo \
|
|
+ rockchip-spidev0.dtbo \
|
|
+ rockchip-spidev2.dtbo \
|
|
+ rockchip-uart1.dtbo \
|
|
+ rockchip-uart2.dtbo \
|
|
+ rockchip-uart3.dtbo \
|
|
+ rockchip-uart4.dtbo \
|
|
+ rockchip-w1-gpio.dtbo
|
|
+
|
|
+scr-$(CONFIG_ARCH_ROCKCHIP) += \
|
|
+ rockchip-fixup.scr
|
|
+
|
|
+dtbotxt-$(CONFIG_ARCH_ROCKCHIP) += \
|
|
+ README.rockchip-overlays
|
|
+
|
|
+targets += $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
|
+
|
|
+always := $(dtbo-y) $(scr-y) $(dtbotxt-y)
|
|
+clean-files := *.dtbo *.scr
|
|
+
|
|
diff --git a/arch/arm/boot/dts/overlay/README.rockchip-overlays b/arch/arm/boot/dts/overlay/README.rockchip-overlays
|
|
new file mode 100644
|
|
index 00000000000..df4559ca262
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/README.rockchip-overlays
|
|
@@ -0,0 +1,78 @@
|
|
+This document describes overlays provided in the kernel packages
|
|
+For generic Armbian overlays documentation please see
|
|
+https://docs.armbian.com/User-Guide_Allwinner_overlays/
|
|
+
|
|
+### Platform:
|
|
+
|
|
+rockchip (Rockchip)
|
|
+
|
|
+### Provided overlays:
|
|
+
|
|
+- ds1307
|
|
+- i2c1
|
|
+- i2c4
|
|
+- spi0
|
|
+- spi2
|
|
+- spidev0
|
|
+- spidev2
|
|
+- uart1
|
|
+- uart2
|
|
+- uart3
|
|
+- uart4
|
|
+- w1-gpio
|
|
+
|
|
+### Overlay details:
|
|
+
|
|
+### ds1307
|
|
+
|
|
+Activates ds1307 rtc on i2c1
|
|
+
|
|
+### i2c1
|
|
+
|
|
+Activate i2c1
|
|
+
|
|
+### i2c4
|
|
+
|
|
+Activate i2c4
|
|
+
|
|
+### spi0
|
|
+
|
|
+Activate spi0
|
|
+conflicts with uart4
|
|
+
|
|
+### spi2
|
|
+
|
|
+Activate spi2
|
|
+
|
|
+### spidev0
|
|
+
|
|
+Activate spidev on spi0
|
|
+Depends on spi0
|
|
+
|
|
+### spidev2
|
|
+
|
|
+Activate spidev on spi2
|
|
+depends on spi2
|
|
+
|
|
+### uart1
|
|
+
|
|
+Activate uart1
|
|
+
|
|
+### uart2
|
|
+
|
|
+Activate uart2
|
|
+
|
|
+### uart3
|
|
+
|
|
+Activate uart3
|
|
+
|
|
+### uart4
|
|
+
|
|
+Activate uart4
|
|
+Conflicts with spi0
|
|
+
|
|
+### w1-gpio
|
|
+
|
|
+Activates 1-wire gpio master on GPIO0 17
|
|
+
|
|
+
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-ds1307.dts b/arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
|
new file mode 100644
|
|
index 00000000000..ab7d648c2aa
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-ds1307.dts
|
|
@@ -0,0 +1,23 @@
|
|
+/* Definitions for ds1307
|
|
+* From ASUS: https://github.com/TinkerBoard/debian_kernel/commits/develop/arch/arm/boot/dts/overlays/ds1307-overlay.dts
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&i2c1>;
|
|
+ __overlay__ {
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+ rtc: ds1307@68 {
|
|
+ compatible = "dallas,ds1307";
|
|
+ reg = <0x68>;
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd b/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
|
new file mode 100644
|
|
index 00000000000..d4c39e20a3a
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-fixup.scr-cmd
|
|
@@ -0,0 +1,4 @@
|
|
+# overlays fixup script
|
|
+# implements (or rather substitutes) overlay arguments functionality
|
|
+# using u-boot scripting, environment variables and "fdt" command
|
|
+
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c1.dts b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
|
new file mode 100644
|
|
index 00000000000..f09f85e42cb
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c1.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for i2c1
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&i2c1>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-i2c4.dts b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
|
new file mode 100644
|
|
index 00000000000..5b43b85045f
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-i2c4.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for i2c4
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&i2c4>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-spi0.dts b/arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
|
new file mode 100644
|
|
index 00000000000..d2dfcd6220e
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-spi0.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for spi0
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&spi0>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-spi2.dts b/arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
|
new file mode 100644
|
|
index 00000000000..2cd50ae4b9d
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-spi2.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for spi2
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&spi2>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-spidev0.dts b/arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
|
new file mode 100644
|
|
index 00000000000..728cde52351
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-spidev0.dts
|
|
@@ -0,0 +1,35 @@
|
|
+/* Definition for SPI0 Spidev
|
|
+ * spi port for Tinker Board
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/{
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+
|
|
+ target = <&spi0>;
|
|
+ __overlay__ {
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+
|
|
+ spidev@0 {
|
|
+ compatible = "rockchip,spi_tinker";
|
|
+ reg = <0>;
|
|
+ spi-max-frequency = <50000000>;
|
|
+ spi-cpha = <1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+
|
|
+ spidev@1 {
|
|
+ compatible = "rockchip,spi_tinker";
|
|
+ reg = <1>;
|
|
+ spi-max-frequency = <50000000>;
|
|
+ spi-cpha = <1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-spidev2.dts b/arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
|
new file mode 100644
|
|
index 00000000000..262bb61d959
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-spidev2.dts
|
|
@@ -0,0 +1,35 @@
|
|
+/* Definition for SPI2 Spidev
|
|
+ * spi port for Tinker Board
|
|
+ */
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/{
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+
|
|
+ target = <&spi2>;
|
|
+ __overlay__ {
|
|
+ #address-cells = <1>;
|
|
+ #size-cells = <0>;
|
|
+
|
|
+ spidev@0 {
|
|
+ compatible = "rockchip,spi_tinker";
|
|
+ reg = <0>;
|
|
+ spi-max-frequency = <50000000>;
|
|
+ spi-cpha = <1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+
|
|
+ spidev@1 {
|
|
+ compatible = "rockchip,spi_tinker";
|
|
+ reg = <1>;
|
|
+ spi-max-frequency = <50000000>;
|
|
+ spi-cpha = <1>;
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart1.dts b/arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
|
new file mode 100644
|
|
index 00000000000..8604ff90d2a
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-uart1.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for uart1
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&uart1>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart2.dts b/arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
|
new file mode 100644
|
|
index 00000000000..a57873d560b
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-uart2.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for uart2
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&uart2>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart3.dts b/arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
|
new file mode 100644
|
|
index 00000000000..d1b77ffbf31
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-uart3.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for uart3
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&uart3>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-uart4.dts b/arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
|
new file mode 100644
|
|
index 00000000000..13fd8f4eca9
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-uart4.dts
|
|
@@ -0,0 +1,16 @@
|
|
+/* Definitions for uart4
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+
|
|
+ fragment@0 {
|
|
+ target = <&uart4>;
|
|
+ __overlay__ {
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+};
|
|
diff --git a/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts b/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
|
new file mode 100644
|
|
index 00000000000..cc1f50a91bb
|
|
--- /dev/null
|
|
+++ b/arch/arm/boot/dts/overlay/rockchip-w1-gpio.dts
|
|
@@ -0,0 +1,23 @@
|
|
+/* 1-Wire GPIO
|
|
+* From ASUS: https://github.com/TinkerBoard/debian_kernel/blob/develop/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts
|
|
+*
|
|
+*
|
|
+*/
|
|
+
|
|
+/dts-v1/;
|
|
+/plugin/;
|
|
+
|
|
+/ {
|
|
+ compatible = "rockchip,rk3288";
|
|
+ fragment@0 {
|
|
+ target-path = "/";
|
|
+ __overlay__ {
|
|
+ w1: onewire@0 {
|
|
+ compatible = "w1-gpio";
|
|
+ pinctrl-names = "default";
|
|
+ gpios = <&gpio0 17 0>;
|
|
+ status = "okay";
|
|
+ };
|
|
+ };
|
|
+ };
|
|
+};
|
|
--
|
|
2.30.2
|
|
|