meson64-6.17: rework g12b pinmux/pinctrl; thanks to retro98boy

> The kernel upstream fixed the missing PWM pinctrl C code for g12b and
> sm1, but did not add these PWM pinctrl nodes in the device tree.
> Therefore, only need to delete the
> meson-g12b-pinctrl-Add-missing-pinmux-for-pwm.patch from the repository
> and add a meson-g12b-dt-Add-missing-pinmux-node-for-pwm.patch.
> This patch does not include all PWM pinctrl nodes, only adding some
> g12b PWM pinctrl nodes as in the old patch. Notably, pwm_b_z_pins was
> renamed to pwm_b_z0_pins, but this is not used in the build repository.

- thus:
  - added `meson-g12b-dt-Add-missing-pinmux-node-for-pwm.patch`
  - dropped `meson-g12b-pinctrl-Add-missing-pinmux-for-pwm.patch`
  - kept `dt/meson-g12b-a311d-cainiao-cniot-core.dts`

Co-authored-by: retro98boy <retro98boy@qq.com>
This commit is contained in:
Ricardo Pardini 2025-10-05 17:31:11 +02:00 committed by Igor
parent 1eb1e6a552
commit 06675ca040
2 changed files with 64 additions and 135 deletions

View File

@ -0,0 +1,64 @@
From 3f936558703991a4a820f3efd9b40ca5d586dd21 Mon Sep 17 00:00:00 2001
From: retro98boy <retro98boy@qq.com>
Date: Wed, 8 Oct 2025 19:06:53 +0800
Subject: [PATCH] arm64: dts: amlogic: Add several missing g12b pinmux node for
pwm functions
Related commits: https://github.com/torvalds/linux/commit/b58ea88d301cd4c0403f298468442dacac4f8c4e
---
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 42 +++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
index 86e6ceb31..067820380 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
@@ -149,3 +149,45 @@ &pmu {
&npu {
power-domains = <&pwrc PWRC_G12A_NNA_ID>;
};
+
+&periphs_pinctrl {
+ pwm_b_h_pins: pwm-b-h {
+ mux {
+ groups = "pwm_b_h";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_b_z0_pins: pwm-b-z0 {
+ mux {
+ groups = "pwm_b_z0";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_c_z_pins: pwm-c-z {
+ mux {
+ groups = "pwm_c_z";
+ function = "pwm_c";
+ bias-disable;
+ };
+ };
+
+ pwm_d_z_pins: pwm-d-z {
+ mux {
+ groups = "pwm_d_z";
+ function = "pwm_d";
+ bias-disable;
+ };
+ };
+
+ pwm_d_a_pins: pwm-d-a {
+ mux {
+ groups = "pwm_d_a";
+ function = "pwm_d";
+ bias-disable;
+ };
+ };
+};
--
2.51.0

View File

@ -1,135 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Yuntian Zhang <yt@radxa.com>
Date: Thu, 13 Jan 2022 21:34:10 +0800
Subject: pinctrl: meson: Add several missing pinmux for pwm functions
The following pin definitions are mentioned in A311D Quick
Reference Manual and S922X Public Datasheet, but not in S905Y2
Quick Reference Manual, so adding them to meson-g12b family.
They are currently exposed in Radxa Zero 2's GPIO header.
Signed-off-by: Yuntian Zhang <yt@radxa.com>
---
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 42 ++++++++++
drivers/pinctrl/meson/pinctrl-meson-g12a.c | 16 +++-
2 files changed, 55 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
index 111111111111..222222222222 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b.dtsi
@@ -149,3 +149,45 @@ &pmu {
&npu {
power-domains = <&pwrc PWRC_G12A_NNA_ID>;
};
+
+&periphs_pinctrl {
+ pwm_b_h_pins: pwm-b-h {
+ mux {
+ groups = "pwm_b_h";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_b_z_pins: pwm-b-z {
+ mux {
+ groups = "pwm_b_z";
+ function = "pwm_b";
+ bias-disable;
+ };
+ };
+
+ pwm_c_z_pins: pwm-c-z {
+ mux {
+ groups = "pwm_c_z";
+ function = "pwm_c";
+ bias-disable;
+ };
+ };
+
+ pwm_d_z_pins: pwm-d-z {
+ mux {
+ groups = "pwm_d_z";
+ function = "pwm_d";
+ bias-disable;
+ };
+ };
+
+ pwm_d_a_pins: pwm-d-a {
+ mux {
+ groups = "pwm_d_a";
+ function = "pwm_d";
+ bias-disable;
+ };
+ };
+};
diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
index 111111111111..222222222222 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
@@ -271,17 +271,22 @@ static const unsigned int eth_act_led_pins[] = { GPIOZ_15 };
static const unsigned int pwm_a_pins[] = { GPIOX_6 };
/* pwm_b */
+static const unsigned int pwm_b_h_pins[] = { GPIOH_7 };
static const unsigned int pwm_b_x7_pins[] = { GPIOX_7 };
static const unsigned int pwm_b_x19_pins[] = { GPIOX_19 };
+static const unsigned int pwm_b_z_pins[] = { GPIOZ_0 };
/* pwm_c */
static const unsigned int pwm_c_c_pins[] = { GPIOC_4 };
static const unsigned int pwm_c_x5_pins[] = { GPIOX_5 };
static const unsigned int pwm_c_x8_pins[] = { GPIOX_8 };
+static const unsigned int pwm_c_z_pins[] = { GPIOZ_1 };
/* pwm_d */
static const unsigned int pwm_d_x3_pins[] = { GPIOX_3 };
static const unsigned int pwm_d_x6_pins[] = { GPIOX_6 };
+static const unsigned int pwm_d_z_pins[] = { GPIOZ_2 };
+static const unsigned int pwm_d_a_pins[] = { GPIOA_4 };
/* pwm_e */
static const unsigned int pwm_e_pins[] = { GPIOX_16 };
@@ -594,6 +599,10 @@ static const struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(bt565_a_din5, 2),
GROUP(bt565_a_din6, 2),
GROUP(bt565_a_din7, 2),
+ GROUP(pwm_b_z, 5),
+ GROUP(pwm_c_z, 5),
+ GROUP(pwm_d_z, 2),
+ GROUP(pwm_d_a, 3),
GROUP(tsin_b_valid_z, 3),
GROUP(tsin_b_sop_z, 3),
GROUP(tsin_b_din0_z, 3),
@@ -726,6 +735,7 @@ static const struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(uart_c_rts, 2),
GROUP(iso7816_clk_h, 1),
GROUP(iso7816_data_h, 1),
+ GROUP(pwm_b_h, 5),
GROUP(pwm_f_h, 4),
GROUP(cec_ao_a_h, 4),
GROUP(cec_ao_b_h, 5),
@@ -1066,15 +1076,15 @@ static const char * const pwm_a_groups[] = {
};
static const char * const pwm_b_groups[] = {
- "pwm_b_x7", "pwm_b_x19",
+ "pwm_b_h", "pwm_b_x7", "pwm_b_x19", "pwm_b_z",
};
static const char * const pwm_c_groups[] = {
- "pwm_c_c", "pwm_c_x5", "pwm_c_x8",
+ "pwm_c_c", "pwm_c_x5", "pwm_c_x8", "pwm_c_z",
};
static const char * const pwm_d_groups[] = {
- "pwm_d_x3", "pwm_d_x6",
+ "pwm_d_x3", "pwm_d_x6", "pwm_d_z", "pwm_d_a",
};
static const char * const pwm_e_groups[] = {
--
Armbian