From 4b2f43e4e23c5e6184568a6b0bf0e85fce4aefb3 Mon Sep 17 00:00:00 2001
From: chraac <chraac@gmail.com>
Date: Fri, 5 Apr 2024 10:57:18 +0800
Subject: add dtb overlay for zero2w

---
 .../arm64/boot/dts/allwinner/overlay/Makefile |  4 ++++
 .../allwinner/overlay/sun50i-h616-gpu.dtso    | 14 +++++++++++
 .../overlay/sun50i-h616-i2c0-pi.dtso          | 23 +++++++++++++++++++
 .../overlay/sun50i-h616-i2c1-pi.dtso          | 16 +++++++++++++
 .../overlay/sun50i-h616-i2c2-pi.dtso          | 23 +++++++++++++++++++
 5 files changed, 80 insertions(+)
 create mode 100644 arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-gpu.dtso
 create mode 100644 arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0-pi.dtso
 create mode 100644 arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c1-pi.dtso
 create mode 100644 arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c2-pi.dtso

diff --git a/arch/arm64/boot/dts/allwinner/overlay/Makefile b/arch/arm64/boot/dts/allwinner/overlay/Makefile
index 718909b607a6..ccb89b5bf495 100644
--- a/arch/arm64/boot/dts/allwinner/overlay/Makefile
+++ b/arch/arm64/boot/dts/allwinner/overlay/Makefile
@@ -49,6 +49,10 @@ dtb-$(CONFIG_ARCH_SUNXI) += \
 	sun50i-h6-uart2.dtbo \
 	sun50i-h6-uart3.dtbo \
 	sun50i-h6-w1-gpio.dtbo \
+	sun50i-h616-gpu.dtbo \
+	sun50i-h616-i2c0-pi.dtbo \
+	sun50i-h616-i2c1-pi.dtbo \
+	sun50i-h616-i2c2-pi.dtbo \
 	sun50i-h616-i2c2-ph.dtbo \
 	sun50i-h616-i2c3-pg.dtbo \
 	sun50i-h616-i2c3-ph.dtbo \
diff --git a/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-gpu.dtso b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-gpu.dtso
new file mode 100644
index 000000000000..ac8846ac7d27
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-gpu.dtso
@@ -0,0 +1,14 @@
+/dts-v1/;
+/plugin/;
+
+
+/ {
+	compatible = "allwinner,sun50i-h616";
+
+	fragment@0 {
+		target = <&gpu>;
+		__overlay__ {
+			status = "okay";
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0-pi.dtso b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0-pi.dtso
new file mode 100644
index 000000000000..b5003934c895
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c0-pi.dtso
@@ -0,0 +1,23 @@
+/dts-v1/;
+/plugin/;
+
+
+/ {
+	compatible = "allwinner,sun50i-h616";
+
+	fragment@0 {
+		target = <&i2c0>;
+		__overlay__ {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c0_pins>;
+			status = "okay";
+		};
+	};
+
+	fragment@1 {
+		target = <&uart2>;
+		__overlay__ {
+			status = "disabled";
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c1-pi.dtso b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c1-pi.dtso
new file mode 100644
index 000000000000..05f3100967ff
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c1-pi.dtso
@@ -0,0 +1,16 @@
+/dts-v1/;
+/plugin/;
+
+
+/ {
+	compatible = "allwinner,sun50i-h616";
+
+	fragment@0 {
+		target = <&i2c1>;
+		__overlay__ {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c1_pi_pins>;
+			status = "okay";
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c2-pi.dtso b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c2-pi.dtso
new file mode 100644
index 000000000000..0f7d7e9968d6
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-i2c2-pi.dtso
@@ -0,0 +1,23 @@
+/dts-v1/;
+/plugin/;
+
+
+/ {
+	compatible = "allwinner,sun50i-h616";
+
+	fragment@0 {
+		target = <&i2c2>;
+		__overlay__ {
+			pinctrl-names = "default";
+			pinctrl-0 = <&i2c2_pi_pins>;
+			status = "okay";
+		};
+	};
+
+	fragment@1 {
+		target = <&uart3>;
+		__overlay__ {
+			status = "disabled";
+		};
+	};
+};
-- 
2.35.3

