2022-01-03 15:46:55

by Gary Bisson

[permalink] [raw]
Subject: [PATCH 0/3] meson-g12: add pwm and uart pin muxing options

Hi,

This series adds a few pin muxing options needed for our HW platform (to
be submitted soon).

1- pwm_f: adding missing both GPIOZ_12 & GPIOA_11 options
-> tested GPIOA_11 as mipi display backlight
-> order for this patch is not alphabetical but follows doc order (to
match current order)
2- uart_ao_b: adding both options for ao_b uart + its rts/cts pins
-> tested on custom hw too

Let me know if you have any questions.

Regards,
Gary

Gary Bisson (3):
pinctrl: meson-g12a: add more pwm_f options
arm64: dts: meson-g12-common: add more pwm_f options
arm64: dts: meson-g12-common: add uart_ao_b pins muxing

.../boot/dts/amlogic/meson-g12-common.dtsi | 43 +++++++++++++++++++
drivers/pinctrl/meson/pinctrl-meson-g12a.c | 6 ++-
2 files changed, 48 insertions(+), 1 deletion(-)

--
Cc: Neil Armstrong <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jerome Brunet <[email protected]>
Cc: [email protected]
Cc: [email protected]
--
2.34.1



2022-01-03 15:46:59

by Gary Bisson

[permalink] [raw]
Subject: [PATCH 1/3] pinctrl: meson-g12a: add more pwm_f options

Add missing PWM_F pin muxing for GPIOA_11 and GPIOZ_12.

Signed-off-by: Gary Bisson <[email protected]>
---
Cc: Linus Walleij <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jerome Brunet <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/pinctrl/meson/pinctrl-meson-g12a.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
index cd9656b13836..d182a575981e 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
@@ -283,6 +283,8 @@ static const unsigned int pwm_d_x6_pins[] = { GPIOX_6 };
static const unsigned int pwm_e_pins[] = { GPIOX_16 };

/* pwm_f */
+static const unsigned int pwm_f_z_pins[] = { GPIOZ_12 };
+static const unsigned int pwm_f_a_pins[] = { GPIOA_11 };
static const unsigned int pwm_f_x_pins[] = { GPIOX_7 };
static const unsigned int pwm_f_h_pins[] = { GPIOH_5 };

@@ -618,6 +620,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(tdm_c_dout2_z, 4),
GROUP(tdm_c_dout3_z, 4),
GROUP(mclk1_z, 4),
+ GROUP(pwm_f_z, 5),

/* bank GPIOX */
GROUP(sdio_d0, 1),
@@ -768,6 +771,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
GROUP(tdm_c_dout3_a, 2),
GROUP(mclk0_a, 1),
GROUP(mclk1_a, 2),
+ GROUP(pwm_f_a, 3),
};

/* uart_ao_a */
@@ -1069,7 +1073,7 @@ static const char * const pwm_e_groups[] = {
};

static const char * const pwm_f_groups[] = {
- "pwm_f_x", "pwm_f_h",
+ "pwm_f_z", "pwm_f_a", "pwm_f_x", "pwm_f_h",
};

static const char * const cec_ao_a_h_groups[] = {
--
2.34.1


2022-01-03 15:47:01

by Gary Bisson

[permalink] [raw]
Subject: [PATCH 2/3] arm64: dts: meson-g12-common: add more pwm_f options

Add missing PWM_F pin muxing for GPIOA_11 and GPIOZ_12.

Signed-off-by: Gary Bisson <[email protected]>
---
Cc: Rob Herring <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jerome Brunet <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
.../arm64/boot/dts/amlogic/meson-g12-common.dtsi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 00c6f53290d4..af1357c48bee 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -894,6 +894,22 @@ mux {
};
};

+ pwm_f_z_pins: pwm-f-z {
+ mux {
+ groups = "pwm_f_z";
+ function = "pwm_f";
+ bias-disable;
+ };
+ };
+
+ pwm_f_a_pins: pwm-f-a {
+ mux {
+ groups = "pwm_f_a";
+ function = "pwm_f";
+ bias-disable;
+ };
+ };
+
pwm_f_x_pins: pwm-f-x {
mux {
groups = "pwm_f_x";
--
2.34.1


2022-01-03 15:47:07

by Gary Bisson

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: meson-g12-common: add uart_ao_b pins muxing

- RX/TX signals can be mapped on 2 different pairs of pins so supporting
both options
- RTS/CTS signals however only have 1 option available

Signed-off-by: Gary Bisson <[email protected]>
---
Cc: Rob Herring <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Jerome Brunet <[email protected]>
Cc: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
.../boot/dts/amlogic/meson-g12-common.dtsi | 27 +++++++++++++++++++
1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index af1357c48bee..3a7773ffbd08 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -1952,6 +1952,33 @@ mux {
};
};

+ uart_ao_b_1_pins: uart-ao-b-1 {
+ mux {
+ groups = "uart_ao_b_tx_2",
+ "uart_ao_b_rx_3";
+ function = "uart_ao_b";
+ bias-disable;
+ };
+ };
+
+ uart_ao_b_2_pins: uart-ao-b-2 {
+ mux {
+ groups = "uart_ao_b_tx_8",
+ "uart_ao_b_rx_9";
+ function = "uart_ao_b";
+ bias-disable;
+ };
+ };
+
+ uart_ao_b_cts_rts_pins: uart-ao-b-cts-rts {
+ mux {
+ groups = "uart_ao_b_cts",
+ "uart_ao_b_rts";
+ function = "uart_ao_b";
+ bias-disable;
+ };
+ };
+
pwm_a_e_pins: pwm-a-e {
mux {
groups = "pwm_a_e";
--
2.34.1


2022-01-12 08:30:44

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 1/3] pinctrl: meson-g12a: add more pwm_f options

On 03/01/2022 16:46, Gary Bisson wrote:
> Add missing PWM_F pin muxing for GPIOA_11 and GPIOZ_12.
>
> Signed-off-by: Gary Bisson <[email protected]>
> ---
> Cc: Linus Walleij <[email protected]>
> Cc: Neil Armstrong <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jerome Brunet <[email protected]>
> Cc: Martin Blumenstingl <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/pinctrl/meson/pinctrl-meson-g12a.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
> index cd9656b13836..d182a575981e 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
> @@ -283,6 +283,8 @@ static const unsigned int pwm_d_x6_pins[] = { GPIOX_6 };
> static const unsigned int pwm_e_pins[] = { GPIOX_16 };
>
> /* pwm_f */
> +static const unsigned int pwm_f_z_pins[] = { GPIOZ_12 };
> +static const unsigned int pwm_f_a_pins[] = { GPIOA_11 };
> static const unsigned int pwm_f_x_pins[] = { GPIOX_7 };
> static const unsigned int pwm_f_h_pins[] = { GPIOH_5 };
>
> @@ -618,6 +620,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
> GROUP(tdm_c_dout2_z, 4),
> GROUP(tdm_c_dout3_z, 4),
> GROUP(mclk1_z, 4),
> + GROUP(pwm_f_z, 5),
>
> /* bank GPIOX */
> GROUP(sdio_d0, 1),
> @@ -768,6 +771,7 @@ static struct meson_pmx_group meson_g12a_periphs_groups[] = {
> GROUP(tdm_c_dout3_a, 2),
> GROUP(mclk0_a, 1),
> GROUP(mclk1_a, 2),
> + GROUP(pwm_f_a, 3),
> };
>
> /* uart_ao_a */
> @@ -1069,7 +1073,7 @@ static const char * const pwm_e_groups[] = {
> };
>
> static const char * const pwm_f_groups[] = {
> - "pwm_f_x", "pwm_f_h",
> + "pwm_f_z", "pwm_f_a", "pwm_f_x", "pwm_f_h",
> };
>
> static const char * const cec_ao_a_h_groups[] = {
>

Reviewed-by: Neil Armstrong <[email protected]>

2022-01-12 08:30:59

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 2/3] arm64: dts: meson-g12-common: add more pwm_f options

On 03/01/2022 16:46, Gary Bisson wrote:
> Add missing PWM_F pin muxing for GPIOA_11 and GPIOZ_12.
>
> Signed-off-by: Gary Bisson <[email protected]>
> ---
> Cc: Rob Herring <[email protected]>
> Cc: Neil Armstrong <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jerome Brunet <[email protected]>
> Cc: Martin Blumenstingl <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> .../arm64/boot/dts/amlogic/meson-g12-common.dtsi | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 00c6f53290d4..af1357c48bee 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -894,6 +894,22 @@ mux {
> };
> };
>
> + pwm_f_z_pins: pwm-f-z {
> + mux {
> + groups = "pwm_f_z";
> + function = "pwm_f";
> + bias-disable;
> + };
> + };
> +
> + pwm_f_a_pins: pwm-f-a {
> + mux {
> + groups = "pwm_f_a";
> + function = "pwm_f";
> + bias-disable;
> + };
> + };
> +
> pwm_f_x_pins: pwm-f-x {
> mux {
> groups = "pwm_f_x";
>

Reviewed-by: Neil Armstrong <[email protected]>

2022-01-12 08:33:49

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: meson-g12-common: add uart_ao_b pins muxing

Hi,

On 03/01/2022 16:46, Gary Bisson wrote:
> - RX/TX signals can be mapped on 2 different pairs of pins so supporting
> both options
> - RTS/CTS signals however only have 1 option available
>
> Signed-off-by: Gary Bisson <[email protected]>
> ---
> Cc: Rob Herring <[email protected]>
> Cc: Neil Armstrong <[email protected]>
> Cc: Kevin Hilman <[email protected]>
> Cc: Jerome Brunet <[email protected]>
> Cc: Martin Blumenstingl <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> ---
> .../boot/dts/amlogic/meson-g12-common.dtsi | 27 +++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index af1357c48bee..3a7773ffbd08 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -1952,6 +1952,33 @@ mux {
> };
> };
>
> + uart_ao_b_1_pins: uart-ao-b-1 {
> + mux {
> + groups = "uart_ao_b_tx_2",
> + "uart_ao_b_rx_3";
> + function = "uart_ao_b";
> + bias-disable;
> + };
> + };
> +
> + uart_ao_b_2_pins: uart-ao-b-2 {
> + mux {
> + groups = "uart_ao_b_tx_8",
> + "uart_ao_b_rx_9";
> + function = "uart_ao_b";
> + bias-disable;
> + };
> + };

I'm not fan of these nodes namings.

Perhaps :
- uart-ao-b-2-3
- uart-ao-b-8-9

so the actual pins numbers used are more clear ?

> +
> + uart_ao_b_cts_rts_pins: uart-ao-b-cts-rts {
> + mux {
> + groups = "uart_ao_b_cts",
> + "uart_ao_b_rts";
> + function = "uart_ao_b";
> + bias-disable;
> + };
> + };
> +
> pwm_a_e_pins: pwm-a-e {
> mux {
> groups = "pwm_a_e";
>


2022-01-12 13:01:25

by Gary Bisson

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: meson-g12-common: add uart_ao_b pins muxing

Hi,

On Wed, Jan 12, 2022 at 09:33:42AM +0100, Neil Armstrong wrote:
> Hi,
>
> On 03/01/2022 16:46, Gary Bisson wrote:
> > - RX/TX signals can be mapped on 2 different pairs of pins so supporting
> > both options
> > - RTS/CTS signals however only have 1 option available
> >
> > Signed-off-by: Gary Bisson <[email protected]>
> > ---
> > Cc: Rob Herring <[email protected]>
> > Cc: Neil Armstrong <[email protected]>
> > Cc: Kevin Hilman <[email protected]>
> > Cc: Jerome Brunet <[email protected]>
> > Cc: Martin Blumenstingl <[email protected]>
> > Cc: [email protected]
> > Cc: [email protected]
> > Cc: [email protected]
> > ---
> > .../boot/dts/amlogic/meson-g12-common.dtsi | 27 +++++++++++++++++++
> > 1 file changed, 27 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> > index af1357c48bee..3a7773ffbd08 100644
> > --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> > +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> > @@ -1952,6 +1952,33 @@ mux {
> > };
> > };
> >
> > + uart_ao_b_1_pins: uart-ao-b-1 {
> > + mux {
> > + groups = "uart_ao_b_tx_2",
> > + "uart_ao_b_rx_3";
> > + function = "uart_ao_b";
> > + bias-disable;
> > + };
> > + };
> > +
> > + uart_ao_b_2_pins: uart-ao-b-2 {
> > + mux {
> > + groups = "uart_ao_b_tx_8",
> > + "uart_ao_b_rx_9";
> > + function = "uart_ao_b";
> > + bias-disable;
> > + };
> > + };
>
> I'm not fan of these nodes namings.
>
> Perhaps :
> - uart-ao-b-2-3
> - uart-ao-b-8-9
>
> so the actual pins numbers used are more clear ?

Sure, I wasn't convinced by that naming either. I although thought
about:
- uart-ao-b
- uart-ao-b-alt

Let me know which one you prefer and I'll respin the patch.
Also let me know if I should re-send the entire series or just this
patch.

Regards,
Gary

2022-01-12 14:34:08

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 3/3] arm64: dts: meson-g12-common: add uart_ao_b pins muxing

On 12/01/2022 14:01, Gary Bisson wrote:
> Hi,
>
> On Wed, Jan 12, 2022 at 09:33:42AM +0100, Neil Armstrong wrote:
>> Hi,
>>
>> On 03/01/2022 16:46, Gary Bisson wrote:
>>> - RX/TX signals can be mapped on 2 different pairs of pins so supporting
>>> both options
>>> - RTS/CTS signals however only have 1 option available
>>>
>>> Signed-off-by: Gary Bisson <[email protected]>
>>> ---
>>> Cc: Rob Herring <[email protected]>
>>> Cc: Neil Armstrong <[email protected]>
>>> Cc: Kevin Hilman <[email protected]>
>>> Cc: Jerome Brunet <[email protected]>
>>> Cc: Martin Blumenstingl <[email protected]>
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> Cc: [email protected]
>>> ---
>>> .../boot/dts/amlogic/meson-g12-common.dtsi | 27 +++++++++++++++++++
>>> 1 file changed, 27 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
>>> index af1357c48bee..3a7773ffbd08 100644
>>> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
>>> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
>>> @@ -1952,6 +1952,33 @@ mux {
>>> };
>>> };
>>>
>>> + uart_ao_b_1_pins: uart-ao-b-1 {
>>> + mux {
>>> + groups = "uart_ao_b_tx_2",
>>> + "uart_ao_b_rx_3";
>>> + function = "uart_ao_b";
>>> + bias-disable;
>>> + };
>>> + };
>>> +
>>> + uart_ao_b_2_pins: uart-ao-b-2 {
>>> + mux {
>>> + groups = "uart_ao_b_tx_8",
>>> + "uart_ao_b_rx_9";
>>> + function = "uart_ao_b";
>>> + bias-disable;
>>> + };
>>> + };
>>
>> I'm not fan of these nodes namings.
>>
>> Perhaps :
>> - uart-ao-b-2-3
>> - uart-ao-b-8-9
>>
>> so the actual pins numbers used are more clear ?
>
> Sure, I wasn't convinced by that naming either. I although thought
> about:
> - uart-ao-b
> - uart-ao-b-alt

Not sure about these because it means one is the default and the second
is an alternate one, and I'm not sure about that. If it's the case, then
this naming is ok.

>
> Let me know which one you prefer and I'll respin the patch.
> Also let me know if I should re-send the entire series or just this
> patch.

I'm lazy, so the entire patchset please :-)

Thanks,
Neil

>
> Regards,
> Gary
>


2022-01-17 01:36:45

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 1/3] pinctrl: meson-g12a: add more pwm_f options

On Mon, Jan 3, 2022 at 4:46 PM Gary Bisson
<[email protected]> wrote:

> Add missing PWM_F pin muxing for GPIOA_11 and GPIOZ_12.
>
> Signed-off-by: Gary Bisson <[email protected]>

This patch 1/3 applied for v5.18.

Yours,
Linus Walleij