diff mbox series

[v2,3/6] arm64: dts: ti: k3-pinctrl: Add WKUP_EN flag

Message ID 20240729080101.3859701-4-msp@baylibre.com (mailing list archive)
State New, archived
Headers show
Series firmware: ti_sci: Partial-IO support | expand

Commit Message

Markus Schneider-Pargmann July 29, 2024, 8 a.m. UTC
WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC
in that case.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
---
 arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Nishanth Menon July 30, 2024, 12:09 p.m. UTC | #1
On 10:00-20240729, Markus Schneider-Pargmann wrote:
> WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC
> in that case.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> ---
>  arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> index 22b8d73cfd32..dd4d53e8420a 100644
> --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
> +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> @@ -12,6 +12,7 @@
>  #define PULLTYPESEL_SHIFT	(17)
>  #define RXACTIVE_SHIFT		(18)
>  #define DEBOUNCE_SHIFT		(11)
> +#define WKUP_EN_SHIFT		(29)
>  
>  #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
>  #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
> @@ -38,6 +39,8 @@
>  #define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
>  #define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
>  
> +#define WKUP_EN			(1 << WKUP_EN_SHIFT)
> +

Are we using this?

>  /* Default mux configuration for gpio-ranges to use with pinctrl */
>  #define PIN_GPIO_RANGE_IOPAD	(PIN_INPUT | 7)
>  
> -- 
> 2.45.2
>
Markus Schneider-Pargmann July 30, 2024, 12:32 p.m. UTC | #2
Hi Nishanth,

On Tue, Jul 30, 2024 at 07:09:58AM GMT, Nishanth Menon wrote:
> On 10:00-20240729, Markus Schneider-Pargmann wrote:
> > WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC
> > in that case.
> > 
> > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > ---
> >  arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > index 22b8d73cfd32..dd4d53e8420a 100644
> > --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > @@ -12,6 +12,7 @@
> >  #define PULLTYPESEL_SHIFT	(17)
> >  #define RXACTIVE_SHIFT		(18)
> >  #define DEBOUNCE_SHIFT		(11)
> > +#define WKUP_EN_SHIFT		(29)
> >  
> >  #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
> >  #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
> > @@ -38,6 +39,8 @@
> >  #define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
> >  #define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
> >  
> > +#define WKUP_EN			(1 << WKUP_EN_SHIFT)
> > +
> 
> Are we using this?

Yes, this needs to be used in pinctrl for the relevant pins. The users
are not part of this series, as it will probably be in devicetree
overlays or maybe future board files.

This is an example configuration for mcu_mcan0 that is required to
enable support for wakeup from Partial-IO:

  &mcu_pmx0 {
    mcu_mcan0_tx_pins_default: mcu-mcan0-tx-pins-default {
      pinctrl-single,pins = <
        AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */
      >;
    };

    mcu_mcan0_rx_pins_default: mcu-mcan0-rx-pins-default {
      pinctrl-single,pins = <
        AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */
      >;
    };

    mcu_mcan0_rx_pins_wakeup: mcu-mcan0-rx-pins-wakeup {
      pinctrl-single,pins = <
        AM62X_IOPAD(0x038, PIN_INPUT | WKUP_EN, 0) /* (B3) MCU_MCAN0_RX */
      >;
    };
  };

  &mcu_mcan0 {
    pinctrl-names = "default", "wakeup";
    pinctrl-0 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_default>;
    pinctrl-1 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_wakeup>;
    status = "okay";
  };

Best
Markus
Nishanth Menon July 30, 2024, 12:37 p.m. UTC | #3
On 14:32-20240730, Markus Schneider-Pargmann wrote:
> Hi Nishanth,
> 
> On Tue, Jul 30, 2024 at 07:09:58AM GMT, Nishanth Menon wrote:
> > On 10:00-20240729, Markus Schneider-Pargmann wrote:
> > > WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC
> > > in that case.
> > > 
> > > Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> > > ---
> > >  arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > > index 22b8d73cfd32..dd4d53e8420a 100644
> > > --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > > +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
> > > @@ -12,6 +12,7 @@
> > >  #define PULLTYPESEL_SHIFT	(17)
> > >  #define RXACTIVE_SHIFT		(18)
> > >  #define DEBOUNCE_SHIFT		(11)
> > > +#define WKUP_EN_SHIFT		(29)
> > >  
> > >  #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
> > >  #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
> > > @@ -38,6 +39,8 @@
> > >  #define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
> > >  #define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
> > >  
> > > +#define WKUP_EN			(1 << WKUP_EN_SHIFT)
> > > +
> > 
> > Are we using this?
> 
> Yes, this needs to be used in pinctrl for the relevant pins. The users
> are not part of this series, as it will probably be in devicetree
> overlays or maybe future board files.
> 
> This is an example configuration for mcu_mcan0 that is required to
> enable support for wakeup from Partial-IO:
> 
>   &mcu_pmx0 {
>     mcu_mcan0_tx_pins_default: mcu-mcan0-tx-pins-default {
>       pinctrl-single,pins = <
>         AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */
>       >;
>     };
> 
>     mcu_mcan0_rx_pins_default: mcu-mcan0-rx-pins-default {
>       pinctrl-single,pins = <
>         AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */
>       >;
>     };
> 
>     mcu_mcan0_rx_pins_wakeup: mcu-mcan0-rx-pins-wakeup {
>       pinctrl-single,pins = <
>         AM62X_IOPAD(0x038, PIN_INPUT | WKUP_EN, 0) /* (B3) MCU_MCAN0_RX */
>       >;
>     };
>   };
> 
>   &mcu_mcan0 {
>     pinctrl-names = "default", "wakeup";
>     pinctrl-0 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_default>;
>     pinctrl-1 = <&mcu_mcan0_tx_pins_default>, <&mcu_mcan0_rx_pins_wakeup>;
>     status = "okay";
>   };


Please introduce at least 1 user in the series? or if there are
dependencies, then we can hold back this patch till the right users are
available.
Krzysztof Kozlowski Aug. 6, 2024, 6:28 a.m. UTC | #4
On 30/07/2024 14:32, Markus Schneider-Pargmann wrote:
> Hi Nishanth,
> 
> On Tue, Jul 30, 2024 at 07:09:58AM GMT, Nishanth Menon wrote:
>> On 10:00-20240729, Markus Schneider-Pargmann wrote:
>>> WKUP_EN is a flag to enable pin wakeup. Any activity will wakeup the SoC
>>> in that case.
>>>
>>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>>> ---
>>>  arch/arm64/boot/dts/ti/k3-pinctrl.h | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
>>> index 22b8d73cfd32..dd4d53e8420a 100644
>>> --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
>>> +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
>>> @@ -12,6 +12,7 @@
>>>  #define PULLTYPESEL_SHIFT	(17)
>>>  #define RXACTIVE_SHIFT		(18)
>>>  #define DEBOUNCE_SHIFT		(11)
>>> +#define WKUP_EN_SHIFT		(29)
>>>  
>>>  #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
>>>  #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
>>> @@ -38,6 +39,8 @@
>>>  #define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
>>>  #define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
>>>  
>>> +#define WKUP_EN			(1 << WKUP_EN_SHIFT)
>>> +
>>
>> Are we using this?
> 
> Yes, this needs to be used in pinctrl for the relevant pins. The users
> are not part of this series, as it will probably be in devicetree
> overlays or maybe future board files.

You cannot add some code without users claiming that "someone, someday
might need it". It's just dead code.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h
index 22b8d73cfd32..dd4d53e8420a 100644
--- a/arch/arm64/boot/dts/ti/k3-pinctrl.h
+++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h
@@ -12,6 +12,7 @@ 
 #define PULLTYPESEL_SHIFT	(17)
 #define RXACTIVE_SHIFT		(18)
 #define DEBOUNCE_SHIFT		(11)
+#define WKUP_EN_SHIFT		(29)
 
 #define PULL_DISABLE		(1 << PULLUDEN_SHIFT)
 #define PULL_ENABLE		(0 << PULLUDEN_SHIFT)
@@ -38,6 +39,8 @@ 
 #define PIN_DEBOUNCE_CONF5	(5 << DEBOUNCE_SHIFT)
 #define PIN_DEBOUNCE_CONF6	(6 << DEBOUNCE_SHIFT)
 
+#define WKUP_EN			(1 << WKUP_EN_SHIFT)
+
 /* Default mux configuration for gpio-ranges to use with pinctrl */
 #define PIN_GPIO_RANGE_IOPAD	(PIN_INPUT | 7)