Skip to contentSkip to conversation

Mediatek MT7986 pinctrl support

PATCH In review Sam Shih 2 participants 4 messages Nov 22, 2021 – Dec 15, 2021

Subsystems (2)
lore
Share & tools
lore

Sam Shih

author
#0 lore raw

v10 cover Mediatek MT7986 pinctrl support

This patch series add pinctrl support for mediatek mt7986 SoC series. It is based on patch series "Add basic SoC support for mediatek mt7986"
https://lore.kernel.org/all/[email protected]/

This patch series base on the following patches
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
that have been applied to the pin control tree

---
v10: used mt7986b.dtsi to include mt7986a.dtsi to reduce duplicate dts nodes
v9: added Acked-by and Reviewed-by tag
v8: fixed uart node in yaml dts example
v7: separate pinctrl part into a single patch series

According to the maintainer’s suggestion, this patch splits the previous thread into independent patch series.
This patch include clock driver and device tree update

Original thread:
https://lore.kernel.org/all/[email protected]/
---

Sam Shih (2):
arm64: dts: mediatek: add pinctrl support for mt7986a
arm64: dts: mediatek: add pinctrl support for mt7986b

 arch/arm64/boot/dts/mediatek/Makefile        |  1 +
 arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 20 ++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi    | 21 ++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 29 ++++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7986b.dtsi    | 12 ++++++++
 5 files changed, 83 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b.dtsi
Signature · 1 line
2.29.2
author
#1 lore raw

PATCH v10 1/2 arm64: dts: mediatek: add pinctrl support for mt7986a

Add mt7986a pinctrl node, and update pinmux setting for mt7986a

---
 arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 20 +++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7986a.dtsi    | 21 ++++++++++++++++++++
 2 files changed, 41 insertions(+)
arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts +20 -0
index 6911862390d7..5cd760abff51 100644
@@ -29,9 +29,29 @@ &uart0 {
 };
 
 &uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>;
 	status = "okay";
 };
 
 &uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
 	status = "okay";
 };
+
+&pio {
+	uart1_pins: uart1-pins {
+		mux {
+			function = "uart";
+			groups = "uart1";
+		};
+	};
+
+	uart2_pins: uart2-pins {
+		mux {
+			function = "uart";
+			groups = "uart2";
+		};
+	};
+};
arch/arm64/boot/dts/mediatek/mt7986a.dtsi +21 -0
index 77906839cc85..b8da76b6ba47 100644
@@ -107,6 +107,27 @@ watchdog: watchdog@1001c000 {
 			status = "disabled";
 		};
 
+		pio: pinctrl@1001f000 {
+			compatible = "mediatek,mt7986a-pinctrl";
+			reg = <0 0x1001f000 0 0x1000>,
+			      <0 0x11c30000 0 0x1000>,
+			      <0 0x11c40000 0 0x1000>,
+			      <0 0x11e20000 0 0x1000>,
+			      <0 0x11e30000 0 0x1000>,
+			      <0 0x11f00000 0 0x1000>,
+			      <0 0x11f10000 0 0x1000>,
+			      <0 0x1000b000 0 0x1000>;
+			reg-names = "gpio", "iocfg_rt", "iocfg_rb", "iocfg_lt",
+				    "iocfg_lb", "iocfg_tr", "iocfg_tl", "eint";
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pio 0 0 100>;
+			interrupt-controller;
+			interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&gic>;
+			#interrupt-cells = <2>;
+		};
+
 		trng: trng@1020f000 {
 			compatible = "mediatek,mt7986-rng",
 				     "mediatek,mt7623-rng";
Signature · 1 line
2.29.2
author
#2 lore raw

PATCH v10 2/2 arm64: dts: mediatek: add pinctrl support for mt7986b

In reply to Sam Shih

Add mt7986b pinctrl node

---
v10: used mt7986b.dtsi to include mt7986a.dtsi to reduce duplicate dts nodes

---
 arch/arm64/boot/dts/mediatek/Makefile        |  1 +
 arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 29 ++++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7986b.dtsi    | 12 ++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b.dtsi
arch/arm64/boot/dts/mediatek/Makefile +1 -0
index e6c3a73b9e4a..d555e43d1ccc 100644
@@ -8,6 +8,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb
arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts new file +29 -0
new file mode 100644
index 000000000000..5fb752edd754
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ * Author: Sam.Shih <[email protected]>
+ */
+
+/dts-v1/;
+#include "mt7986b.dtsi"
+
+/ {
+	model = "MediaTek MT7986b RFB";
+	compatible = "mediatek,mt7986b-rfb";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory {
+		reg = <0 0x40000000 0 0x40000000>;
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
arch/arm64/boot/dts/mediatek/mt7986b.dtsi new file +12 -0
new file mode 100644
index 000000000000..23923b9f8944
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ * Author: Sam.Shih <[email protected]>
+ */
+
+#include "mt7986a.dtsi"
+
+&pio {
+	compatible = "mediatek,mt7986b-pinctrl";
+	gpio-ranges = <&pio 0 0 41>, <&pio 66 66 35>;
+};
Signature · 1 line
2.29.2
maintainer
#3 lore raw
In reply to Sam Shih
Quoted 9 lines · Sam Shih

This patch series add pinctrl support for mediatek mt7986 SoC series. It is based on patch series "Add basic SoC support for mediatek mt7986"
https://lore.kernel.org/all/[email protected]/

This patch series base on the following patches
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
that have been applied to the pin control tree

Whole series applied to v5.16-next/dts64

Thanks!

Quoted 27 lines

---
v10: used mt7986b.dtsi to include mt7986a.dtsi to reduce duplicate dts nodes
v9: added Acked-by and Reviewed-by tag
v8: fixed uart node in yaml dts example
v7: separate pinctrl part into a single patch series

According to the maintainer’s suggestion, this patch splits the previous thread into independent patch series.
This patch include clock driver and device tree update

Original thread:
https://lore.kernel.org/all/[email protected]/
---

Sam Shih (2):
arm64: dts: mediatek: add pinctrl support for mt7986a
arm64: dts: mediatek: add pinctrl support for mt7986b

  arch/arm64/boot/dts/mediatek/Makefile        |  1 +
  arch/arm64/boot/dts/mediatek/mt7986a-rfb.dts | 20 ++++++++++++++
  arch/arm64/boot/dts/mediatek/mt7986a.dtsi    | 21 ++++++++++++++
  arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts | 29 ++++++++++++++++++++
  arch/arm64/boot/dts/mediatek/mt7986b.dtsi    | 12 ++++++++
  5 files changed, 83 insertions(+)

create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7986b.dtsi