* [PATCH 0/2] Add Deep Sleep pinmux macros for TI's K3 SoCs
@ 2024-11-12 11:56 Siddharth Vadapalli
2024-11-12 11:56 ` [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros Siddharth Vadapalli
2024-11-12 11:56 ` [PATCH 2/2] arm64: dts: ti: k3-am62x-sk-common: Support SoC wakeup using USB1 wakeup Siddharth Vadapalli
0 siblings, 2 replies; 5+ messages in thread
From: Siddharth Vadapalli @ 2024-11-12 11:56 UTC (permalink / raw)
To: nm, vigneshr, kristo, robh, krzk+dt, conor+dt
Cc: devicetree, linux-kernel, linux-arm-kernel, srk, s-vadapalli
Hello,
This series introduces deep sleep macros which are common to TI's K3
SoCs and can be used to configure the behavior of SoC pins during Deep
Sleep mode. Additionally, support for SoC wakeup with USB1 on AM62x
based SoCs is added with the help of the newly introduced deep sleep
macros.
Series is based on linux-next tagged next-20241112.
Regards,
Siddharth.
Siddharth Vadapalli (2):
arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros
arm64: dts: ti: k3-am62x-sk-common: Support SoC wakeup using USB1
wakeup
.../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 2 +-
arch/arm64/boot/dts/ti/k3-pinctrl.h | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
--
2.40.1
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros 2024-11-12 11:56 [PATCH 0/2] Add Deep Sleep pinmux macros for TI's K3 SoCs Siddharth Vadapalli @ 2024-11-12 11:56 ` Siddharth Vadapalli 2024-11-15 15:48 ` Rob Herring 2024-11-12 11:56 ` [PATCH 2/2] arm64: dts: ti: k3-am62x-sk-common: Support SoC wakeup using USB1 wakeup Siddharth Vadapalli 1 sibling, 1 reply; 5+ messages in thread From: Siddharth Vadapalli @ 2024-11-12 11:56 UTC (permalink / raw) To: nm, vigneshr, kristo, robh, krzk+dt, conor+dt Cc: devicetree, linux-kernel, linux-arm-kernel, srk, s-vadapalli The behavior of pins in deep sleep mode can be configured by programming the corresponding bits in the respective Pad Configuration register. Add macros to support this. Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> --- arch/arm64/boot/dts/ti/k3-pinctrl.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h index 22b8d73cfd32..cac7cccc1112 100644 --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h @@ -12,6 +12,12 @@ #define PULLTYPESEL_SHIFT (17) #define RXACTIVE_SHIFT (18) #define DEBOUNCE_SHIFT (11) +#define FORCE_DS_EN_SHIFT (15) +#define DS_EN_SHIFT (24) +#define DS_OUT_DIS_SHIFT (25) +#define DS_OUT_VAL_SHIFT (26) +#define DS_PULLUD_EN_SHIFT (27) +#define DS_PULLTYPE_SEL_SHIFT (28) #define PULL_DISABLE (1 << PULLUDEN_SHIFT) #define PULL_ENABLE (0 << PULLUDEN_SHIFT) @@ -38,6 +44,19 @@ #define PIN_DEBOUNCE_CONF5 (5 << DEBOUNCE_SHIFT) #define PIN_DEBOUNCE_CONF6 (6 << DEBOUNCE_SHIFT) +#define PIN_DS_FORCE_DISABLE (0 << FORCE_DS_EN_SHIFT) +#define PIN_DS_FORCE_ENABLE (1 << FORCE_DS_EN_SHIFT) +#define PIN_DS_IO_OVERRIDE_DISABLE (0 << DS_IO_OVERRIDE_EN_SHIFT) +#define PIN_DS_IO_OVERRIDE_ENABLE (1 << DS_IO_OVERRIDE_EN_SHIFT) +#define PIN_DS_OUT_ENABLE (0 << DS_OUT_DIS_SHIFT) +#define PIN_DS_OUT_DISABLE (1 << DS_OUT_DIS_SHIFT) +#define PIN_DS_OUT_VALUE_ZERO (0 << DS_OUT_VAL_SHIFT) +#define PIN_DS_OUT_VALUE_ONE (1 << DS_OUT_VAL_SHIFT) +#define PIN_DS_PULLUD_ENABLE (0 << DS_PULLUD_EN_SHIFT) +#define PIN_DS_PULLUD_DISABLE (1 << DS_PULLUD_EN_SHIFT) +#define PIN_DS_PULL_DOWN (0 << DS_PULLTYPE_SEL_SHIFT) +#define PIN_DS_PULL_UP (1 << DS_PULLTYPE_SEL_SHIFT) + /* Default mux configuration for gpio-ranges to use with pinctrl */ #define PIN_GPIO_RANGE_IOPAD (PIN_INPUT | 7) -- 2.40.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros 2024-11-12 11:56 ` [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros Siddharth Vadapalli @ 2024-11-15 15:48 ` Rob Herring 2024-11-18 5:19 ` Siddharth Vadapalli 0 siblings, 1 reply; 5+ messages in thread From: Rob Herring @ 2024-11-15 15:48 UTC (permalink / raw) To: Siddharth Vadapalli Cc: nm, vigneshr, kristo, krzk+dt, conor+dt, devicetree, linux-kernel, linux-arm-kernel, srk On Tue, Nov 12, 2024 at 05:26:49PM +0530, Siddharth Vadapalli wrote: > The behavior of pins in deep sleep mode can be configured by programming > the corresponding bits in the respective Pad Configuration register. Add > macros to support this. > > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> > --- > arch/arm64/boot/dts/ti/k3-pinctrl.h | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h > index 22b8d73cfd32..cac7cccc1112 100644 > --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h > +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h > @@ -12,6 +12,12 @@ > #define PULLTYPESEL_SHIFT (17) > #define RXACTIVE_SHIFT (18) > #define DEBOUNCE_SHIFT (11) > +#define FORCE_DS_EN_SHIFT (15) > +#define DS_EN_SHIFT (24) > +#define DS_OUT_DIS_SHIFT (25) > +#define DS_OUT_VAL_SHIFT (26) > +#define DS_PULLUD_EN_SHIFT (27) > +#define DS_PULLTYPE_SEL_SHIFT (28) > > #define PULL_DISABLE (1 << PULLUDEN_SHIFT) > #define PULL_ENABLE (0 << PULLUDEN_SHIFT) > @@ -38,6 +44,19 @@ > #define PIN_DEBOUNCE_CONF5 (5 << DEBOUNCE_SHIFT) > #define PIN_DEBOUNCE_CONF6 (6 << DEBOUNCE_SHIFT) > > +#define PIN_DS_FORCE_DISABLE (0 << FORCE_DS_EN_SHIFT) > +#define PIN_DS_FORCE_ENABLE (1 << FORCE_DS_EN_SHIFT) > +#define PIN_DS_IO_OVERRIDE_DISABLE (0 << DS_IO_OVERRIDE_EN_SHIFT) > +#define PIN_DS_IO_OVERRIDE_ENABLE (1 << DS_IO_OVERRIDE_EN_SHIFT) > +#define PIN_DS_OUT_ENABLE (0 << DS_OUT_DIS_SHIFT) > +#define PIN_DS_OUT_DISABLE (1 << DS_OUT_DIS_SHIFT) > +#define PIN_DS_OUT_VALUE_ZERO (0 << DS_OUT_VAL_SHIFT) > +#define PIN_DS_OUT_VALUE_ONE (1 << DS_OUT_VAL_SHIFT) > +#define PIN_DS_PULLUD_ENABLE (0 << DS_PULLUD_EN_SHIFT) > +#define PIN_DS_PULLUD_DISABLE (1 << DS_PULLUD_EN_SHIFT) > +#define PIN_DS_PULL_DOWN (0 << DS_PULLTYPE_SEL_SHIFT) > +#define PIN_DS_PULL_UP (1 << DS_PULLTYPE_SEL_SHIFT) Are you going to go add the 0 defines to all the existing cases? If you do, it's a lot of pointless churn. If you don't, then it is inconsistent when they do get used. I would drop them all. Rob ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros 2024-11-15 15:48 ` Rob Herring @ 2024-11-18 5:19 ` Siddharth Vadapalli 0 siblings, 0 replies; 5+ messages in thread From: Siddharth Vadapalli @ 2024-11-18 5:19 UTC (permalink / raw) To: Rob Herring Cc: Siddharth Vadapalli, nm, vigneshr, kristo, krzk+dt, conor+dt, devicetree, linux-kernel, linux-arm-kernel, srk On Fri, Nov 15, 2024 at 09:48:22AM -0600, Rob Herring wrote: Hello Rob, > On Tue, Nov 12, 2024 at 05:26:49PM +0530, Siddharth Vadapalli wrote: > > The behavior of pins in deep sleep mode can be configured by programming > > the corresponding bits in the respective Pad Configuration register. Add > > macros to support this. > > > > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> > > --- > > arch/arm64/boot/dts/ti/k3-pinctrl.h | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/ti/k3-pinctrl.h b/arch/arm64/boot/dts/ti/k3-pinctrl.h > > index 22b8d73cfd32..cac7cccc1112 100644 > > --- a/arch/arm64/boot/dts/ti/k3-pinctrl.h > > +++ b/arch/arm64/boot/dts/ti/k3-pinctrl.h > > @@ -12,6 +12,12 @@ > > #define PULLTYPESEL_SHIFT (17) > > #define RXACTIVE_SHIFT (18) > > #define DEBOUNCE_SHIFT (11) > > +#define FORCE_DS_EN_SHIFT (15) > > +#define DS_EN_SHIFT (24) > > +#define DS_OUT_DIS_SHIFT (25) > > +#define DS_OUT_VAL_SHIFT (26) > > +#define DS_PULLUD_EN_SHIFT (27) > > +#define DS_PULLTYPE_SEL_SHIFT (28) > > > > #define PULL_DISABLE (1 << PULLUDEN_SHIFT) > > #define PULL_ENABLE (0 << PULLUDEN_SHIFT) > > @@ -38,6 +44,19 @@ > > #define PIN_DEBOUNCE_CONF5 (5 << DEBOUNCE_SHIFT) > > #define PIN_DEBOUNCE_CONF6 (6 << DEBOUNCE_SHIFT) > > > > +#define PIN_DS_FORCE_DISABLE (0 << FORCE_DS_EN_SHIFT) > > +#define PIN_DS_FORCE_ENABLE (1 << FORCE_DS_EN_SHIFT) > > +#define PIN_DS_IO_OVERRIDE_DISABLE (0 << DS_IO_OVERRIDE_EN_SHIFT) > > +#define PIN_DS_IO_OVERRIDE_ENABLE (1 << DS_IO_OVERRIDE_EN_SHIFT) > > +#define PIN_DS_OUT_ENABLE (0 << DS_OUT_DIS_SHIFT) > > +#define PIN_DS_OUT_DISABLE (1 << DS_OUT_DIS_SHIFT) > > +#define PIN_DS_OUT_VALUE_ZERO (0 << DS_OUT_VAL_SHIFT) > > +#define PIN_DS_OUT_VALUE_ONE (1 << DS_OUT_VAL_SHIFT) > > +#define PIN_DS_PULLUD_ENABLE (0 << DS_PULLUD_EN_SHIFT) > > +#define PIN_DS_PULLUD_DISABLE (1 << DS_PULLUD_EN_SHIFT) > > +#define PIN_DS_PULL_DOWN (0 << DS_PULLTYPE_SEL_SHIFT) > > +#define PIN_DS_PULL_UP (1 << DS_PULLTYPE_SEL_SHIFT) > > Are you going to go add the 0 defines to all the existing cases? If you > do, it's a lot of pointless churn. If you don't, then it is inconsistent > when they do get used. I would drop them all. The "0 defines" are present for the existing cases as well, namely: PULL_ENABLE, PULL_DOWN and INPUT_DISABLE are all "0 defines". Other existing macros are defined in terms of the above, due to which it might have appeared to be the case that only some of the "0 defines" are present. For example, the following macros make use of the "0 defines": PIN_OUTPUT, PIN_OUTPUT_PULLUP, PIN_OUTPUT_PULLDOWN and PIN_INPUT_PULLDOWN So the current patch is consistent with the existing convention followed in the k3-pinctrl.h file. Please let me know if I should still drop the "0 defines" in this patch. Regards, Siddharth. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] arm64: dts: ti: k3-am62x-sk-common: Support SoC wakeup using USB1 wakeup 2024-11-12 11:56 [PATCH 0/2] Add Deep Sleep pinmux macros for TI's K3 SoCs Siddharth Vadapalli 2024-11-12 11:56 ` [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros Siddharth Vadapalli @ 2024-11-12 11:56 ` Siddharth Vadapalli 1 sibling, 0 replies; 5+ messages in thread From: Siddharth Vadapalli @ 2024-11-12 11:56 UTC (permalink / raw) To: nm, vigneshr, kristo, robh, krzk+dt, conor+dt Cc: devicetree, linux-kernel, linux-arm-kernel, srk, s-vadapalli After the SoC has entered the Deep Sleep mode, USB1 can be used to wakeup the SoC based on USB events triggered by USB devices. This requires that the pin corresponding to the Type-A connector remains pulled up even after the SoC has entered the Deep Sleep mode. Hence, enable Deep Sleep pullup / pulldown selection for the USB1_DRVVBUS pin and set its Deep Sleep state to PULL_UP. Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> --- arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi index 6957b3e44c82..8b6316454639 100644 --- a/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi @@ -256,7 +256,7 @@ AM62X_IOPAD(0x12c, PIN_OUTPUT, 0) /* (AD19/V15) RGMII1_TX_CTL */ main_usb1_pins_default: main-usb1-default-pins { pinctrl-single,pins = < - AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18/E16) USB1_DRVVBUS */ + AM62X_IOPAD(0x0258, PIN_OUTPUT | PIN_DS_PULLUD_ENABLE | PIN_DS_PULL_UP, 0) /* (F18/E16) USB1_DRVVBUS */ >; }; -- 2.40.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-18 5:22 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-11-12 11:56 [PATCH 0/2] Add Deep Sleep pinmux macros for TI's K3 SoCs Siddharth Vadapalli 2024-11-12 11:56 ` [PATCH 1/2] arm64: dts: ti: k3-pinctrl: Introduce deep sleep macros Siddharth Vadapalli 2024-11-15 15:48 ` Rob Herring 2024-11-18 5:19 ` Siddharth Vadapalli 2024-11-12 11:56 ` [PATCH 2/2] arm64: dts: ti: k3-am62x-sk-common: Support SoC wakeup using USB1 wakeup Siddharth Vadapalli
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).